Possible bug on ccdproc.ImageFileCollection (original) (raw)
Summary
Last Saturday 26th my automated builds started to fail for no apparent reason. Today I have tracked it to ImageFileCollection from ccdproc version 1.3.0.post1, here is a ugly sample code that can reproduce the error.
Minimum sample code
For running it you will need this directory and replace full path into full_path variable
import os from ccdproc import ImageFileCollection
full_path = '/replace/with/full/path/to/ref_comp'
file_collection = ImageFileCollection(full_path)
file_collection_pd = file_collection.summary.to_pandas()
this filtering should leave just one file in the collection.
fc = file_collection_pd[ (file_collection_pd['object'] == 'HgArNe') & (file_collection_pd['wavmode'] == '400 m2')]
if len(fc) == 1: print("The file name should print without blanks around =={:s}==".format(fp.file.to_string(index=False)))
print("Notice the blank?")
print(os.path.join(full_path, file_collection_pd.file.to_string(index=False)))else: print("please make sure only one file will match the filtering conditions")
In my case when I run this with ccdproc.__version == '1.3.0' it works as expected. File name does not start with blank space.
(goodman_pipeline) [simon@ctioy9 sandbox]$ python3.6 -c "import ccdproc; print(ccdproc.version)" 1.3.0 (goodman_pipeline) [simon@ctioy9 sandbox]$ python3.6 testing_collection.py The file name should print without blanks around ==goodman_comp_400M2_GG455_HgArNe.fits== Notice the blank? /data/simon/development/soar/goodman_pipeline/goodman_pipeline/data/ref_comp/goodman_comp_400M2_GG455_HgArNe.fits
With ccdproc.__version == '1.3.0.post1'
(goodman_pipeline) [simon@ctioy9 sandbox]$ python3.7 -c "import ccdproc; print(ccdproc.version)" 1.3.0.post1 (goodman_pipeline) [simon@ctioy9 sandbox]$ python3.7 testing_collection.py The file name should print without blanks around == goodman_comp_400M2_GG455_HgArNe.fits== Notice the blank? /data/simon/development/soar/goodman_pipeline/goodman_pipeline/data/ref_comp/ goodman_comp_400M2_GG455_HgArNe.fits
Versions
(goodman_pipeline) [simon@ctioy9 sandbox]$ python3.6 versions.py 2.0.2 1.3.0 1.13.3 (goodman_pipeline) [simon@ctioy9 sandbox]$ python3.7 versions.py 3.1.1 1.3.0.post1 1.15.2 (goodman_pipeline) [simon@ctioy9 sandbox]$ cat versions.py import astropy print(astropy.version) import ccdproc print(ccdproc.version) import numpy print(numpy.version) (goodman_pipeline) [simon@ctioy9 sandbox]$