Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'mmap' has no attribute 'MAP_PRIVATE' #7

Open
Byorun-repo opened this issue Aug 4, 2023 · 0 comments
Open

Comments

@Byorun-repo
Copy link

Byorun-repo commented Aug 4, 2023

When I tried running the BurstData tutorial notebook I get the following error


AttributeError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 bd = BurstData(
2 fp=fil_file,
3 dm=475.28400,
4 tcand=2.0288800,
5 width=2,
6 snr=16.8128,
7 )

File ~\Desktop....\burstfit\burstfit-main\burstfit\data.py:44, in BurstData.init(self, fp, dm, tcand, width, snr, min_samp, kill_mask, spectral_kurtosis_sigma, savgol_frequency_window, savgol_sigma, flag_rfi)
29 def init(
30 self,
31 fp=None,
(...)
41 flag_rfi=False,
42 ):
---> 44 Candidate.init(
45 self,
46 fp=fp,
47 dm=dm,
48 tcand=tcand,
49 width=width,
50 label=-1,
51 snr=snr,
52 min_samp=min_samp,
53 device=0,
54 kill_mask=kill_mask,
55 spectral_kurtosis_sigma=spectral_kurtosis_sigma,
56 savgol_frequency_window=savgol_frequency_window,
57 savgol_sigma=savgol_sigma,
58 flag_rfi=flag_rfi,
59 )
60 self.dispersed_at_dm = None
61 self.i0 = None

File C:\Python310\lib\site-packages\your\candidate.py:51, in Candidate.init(self, fp, dm, tcand, width, label, snr, min_samp, device, kill_mask, spectral_kurtosis_sigma, savgol_frequency_window, savgol_sigma, flag_rfi)
35 def init(
36 self,
37 fp=None,
(...)
49 flag_rfi=False,
50 ):
---> 51 Your.init(self, fp)
52 self.dm = dm
53 self.tcand = tcand

File C:\Python310\lib\site-packages\your\your.py:72, in Your.init(self, file)
70 logger.debug(f"Reading the file(s): {self.your_file}")
71 self.formatclass = FORMATS[self.format]
---> 72 self.formatclass.init(self, self.your_file)
73 if not self.source_name:
74 logger.info(
75 f"Source name not present in the file. Setting source name to TEMP"
76 )

File C:\Python310\lib\site-packages\your\formats\pysigproc.py:87, in SigprocFile.init(self, fp, copy_hdr)
84 self.fp = fp
85 self.read_header(self.fp)
86 self._mmdata = mmap.mmap(
---> 87 self.fp.fileno(), 0, mmap.MAP_PRIVATE, mmap.PROT_READ
88 )
90 self.bw = self.nchans * self.foff
91 self.cfreq = self.fch1 + (self.bw / 2) - (self.foff / 2)

AttributeError: module 'mmap' has no attribute 'MAP_PRIVATE'

How do I resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant