fix(card): Don't write a units field for undefined values - #43
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
==========================================
+ Coverage 46.15% 46.35% +0.19%
==========================================
Files 17 17
Lines 2550 2550
==========================================
+ Hits 1177 1182 +5
+ Misses 1373 1368 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Do the brackets occur when reading (or parsing) a Card or when writing (or instantiating) a Card? If the former, then the brackets are in the original FITS file and will not be modified. A basic requirement of FITSFiles is to maintain the original card format so that the written file is byte-for-byte as close to the read file as possible. If the latter, then I'll take a look at it. Although that behaviour seems very unusual as I have not yet included support for units. |
|
It looks to be when writing, which then gets picked up again on read:
|
barrettp
left a comment
There was a problem hiding this comment.
Good catch. The error would probably be found once units are implemented properly.
Hi Paul, I ran into this edge case while integrating FITSFiles.jl with AstroImages.jl. Would it make sense to drop the
[]that sneaks into the comments section when the field is undefined?Before
After
This makes handling empty fields easier downstream