-
Notifications
You must be signed in to change notification settings - Fork 3
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
astropy 5 not compatible with focalplane calibration ecsv #157
Comments
From @kfanning in Slack while I was filing ticket:
|
If one version of astropy can write a table to ecsv, it seems reasonable for future versions of astropy to be able to read it, so this looks like an astropy feature regression to me, or otherwise an astropy 4.x table writing bug if it is genuinely writing invalid ecsv. Mini test:
both astropy 4 and 5 are able to internally round-trip this case, and astropy 4 can read the astropy 5 file but not vice-a-versa (i.e. the opposite of the typical case: astropy 4 is future compatible, but astropy 5 is not backwards compatible...) Astropy 5 produces:
while astropy 4 produces:
[I probably should have posted that to astropy instead, but I've also probably already spent too much time on this today so I'm going to go back to Fuji for now...] |
For reference, this change originates in Astropy 4.3, https://docs.astropy.org/en/stable/changelog.html#id51. Actually, I think between that and the example above, we have a workaround:
Still, is it really the intention of the originating code to write out a JSON-valued column? |
Found the relevant astropy issue: astropy/astropy#12840. The eventual fix will be to convert the exception into a warning, but that is still an open PR. |
@sbailey, could you let me know what the level of urgency is on this? I have no familiarity with these files or even whether they are used by the pipeline at all. |
See also https://github.com/astropy/astropy-APEs/blob/main/APE6.rst#object-columns for the official documentation of object columns in ECSV 1.0. The short version is that object columns are expected to be JSON-encoded. A string like |
These files are used in the daily focal plane calibration sync for ops planning. At the moment this isn't causing any issues while that process uses the desi 21.7e environment. It sounds like the format of the file should be changed before running this process in a newer environment. I've looked at Joe's script making these and I think I can change it. I think it will be the least intrusive to save these as JSON encoded lists of strings, rather than saving these columns with sets in them and hoping for the best. I need to know if the daily sync uses these columns at all to make sure I don't break anything by changing the format. Do we want older files updated to the newer format? Do we have a location to store the originally formatted old files? Do we even care about the old files? |
Sorry I am late to this discussion, just a couple points:
|
For additional reference, the function which takes the calibration dump table and extracts the information is here |
Sorry to let this hang. I think an ideal solution would be one where we update the format of the FP dumps to a new format which breaks neither astropy 4 or astropy 5. Ted has confirmed that we don't use these two columns, so it sounds like it may be possible to produce an astropy 4 & 5 compatible file? Then we can migrate the FP sync script install to astropy 5. |
That sounds fine with me. |
@schlafly, did this ever get resolved? |
It looks like astropy was updated to change this to a warning, so reading these files with astropy 5 today is possible with that warning (for now). I don't know who is maintaining the FP dumping code but that is really where any updates need to happen. @ClairePpt , any idea who would be best to update the focal plane dump output? The issue is that the files currently contain some object value columns which astropy is trying to deprecate or change. We don't actually use them downstream though the focal plane team may well use them. |
Focal plane calibration ecsv files used for updating the desimodel focalplane model are not compatible with astropy 5.0 (thanks to @kfanning for reporting).
Using current main environment based on astropy 5.0:
This works fine with astropy 4.0.1.post1:
In the input file, there are two "object" columns:
that are dumps as string representations of arrays in the table rows:
Other snippets from the header:
@weaverba137 could you investigate if this is actually invalid ecsv that astropy 4.0.1 was more forgiving about, or whether this is an astropy 5.0 parsing bug?
@kfanning could you confirm which version of astropy is used to dump these, or whether they are being constructed by hand outside of astropy?
The text was updated successfully, but these errors were encountered: