You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to let you know about a small hiccup that I encountered when running redmapper with the latest version of fitsio. There are many instances within the source code which call the decode method on byte strings loaded with fitsio e.g. reading the master galaxy table within redmapper/configuration.py.
However this causes errors of the following type of error:
File "/u/jacobic/hyperpipes/src/scripts/redmapper_calibrate.py", line 18, in <module>
calib = redmapper.calibration.RedmapperCalibrator(args.configfile)
File "/u/jacobic/.local/anaconda3/envs/redmapper/lib/python3.7/site-packages/redmapper-0.2.5-py3.7-linux-x86_64.egg/redmapper/calibration/calibrate.py", line 46, in __init__
self.config = Configuration(conf)
File "/u/jacobic/.local/anaconda3/envs/redmapper/lib/python3.7/site-packages/redmapper-0.2.5-py3.7-linux-x86_64.egg/redmapper/configuration.py", line 426, in __init__
gal_stats = self._galfile_stats()
File "/u/jacobic/.local/anaconda3/envs/redmapper/lib/python3.7/site-packages/redmapper-0.2.5-py3.7-linux-x86_64.egg/redmapper/configuration.py", line 649, in _galfile_stats
mode = master['MODE'][0].rstrip().decode()
AttributeError: 'str' object has no attribute 'decode'
The reason for this is explained here (see penultimate section):
python 3 strings:
As of version 1.0.0, fitsio now supports Python 3 strings natively. This support means that for Python 3, native strings are read from and written correctly to FITS files. All byte string columns are treated as ASCII-encoded unicode strings as well. For FITS files written with a previous version of fitsio, the data in Python 3 will now come back as a string and not a byte string. Note that this support is not the same as full unicode support. Internally, fitsio only supports the ASCII character set.
Downgrading from v1.03 to v0.9.12 resolves the issue. Would it be possible to add this information to the requirements section of the README? or ideally remove the calls to decode and state the minimum version of fitsio should be 1.00.
Thanks in advance,
Jacob
The text was updated successfully, but these errors were encountered:
Ah, good point, I had been meaning to test the code with the latest fitsio but hadn't yet (oops). I'll either fix this or add the requirement in the next week or so. Thanks for letting me know!
Hi guys
Thanks for all your hard work with this package!
I just wanted to let you know about a small hiccup that I encountered when running
redmapper
with the latest version offitsio
. There are many instances within the source code which call the decode method on byte strings loaded withfitsio
e.g. reading the master galaxy table withinredmapper/configuration.py
.However this causes errors of the following type of error:
The reason for this is explained here (see penultimate section):
Downgrading from v1.03 to v0.9.12 resolves the issue. Would it be possible to add this information to the requirements section of the README? or ideally remove the calls to decode and state the minimum version of
fitsio
should be 1.00.Thanks in advance,
Jacob
The text was updated successfully, but these errors were encountered: