MazinLab / MKIDCore

Core Tools
GNU General Public License v3.0
4 stars 0 forks source link

CSV import gets clobbered this makes Photontable in MKIDPipeline non importable #4

Closed ld-cd closed 1 month ago

ld-cd commented 6 months ago

Traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-28f7bf35f856> in <module>
----> 1 from mkidpipeline.photontable import PhotonTable

~/Workspace/analysis/MKIDPipeline/mkidpipeline/photontable.py in <module>
      7 from ruamel.yaml.comments import CommentedSeq
      8
----> 9 import mkidcore.metadata
     10 from mkidcore.binfile.mkidbin import PhotonCType, PhotonNumpyType
     11 from mkidcore.corelog import getLogger

~/Workspace/analysis/MKIDCore/mkidcore/metadata.py in <module>
    169
    170
--> 171 MEC_KEY_INFO = _parse_inst_keys('mec_keys.csv')
    172 XKID_KEY_INFO = _parse_inst_keys('xkid_keys.csv')
    173 DEFAULT_MEC_CARDSET = {k: v.fits_card for k, v in MEC_KEY_INFO.items()}

~/Workspace/analysis/MKIDCore/mkidcore/metadata.py in _parse_inst_keys(csv)
    144 def _parse_inst_keys(csv):
    145     with open(pkg.resource_filename('mkidcore', csv)) as f:
--> 146         data = [row for row in csv.reader(f)]
    147
    148     data = [{k.strip().lower().replace(' ', '_').replace('?', ''): v.strip() for k, v in zip(data[0], l)} for l in

AttributeError: 'str' object has no attribute 'reader'

Cause

baileyji commented 6 months ago

This was fixed and pushed elsewhere, suggesting you are testing with code that is not up to date.

ld-cd commented 6 months ago

Again this is the develop, if there's a fix it should be merged here by whoever the maintainer currently is so that people don't keep hitting it. Again Andrew hit this in July and I attempted to help him fix it but was told not to work on issues with the pipeline.

ld-cd commented 1 month ago

Resolved on main branch