-
Notifications
You must be signed in to change notification settings - Fork 28
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
Put real file names in meta.resample.meta. #1209
Put real file names in meta.resample.meta. #1209
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1209 +/- ##
==========================================
+ Coverage 79.03% 79.05% +0.02%
==========================================
Files 116 116
Lines 7985 7994 +9
==========================================
+ Hits 6311 6320 +9
Misses 1674 1674
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I think that the container should store the asn member names. As is, the container loses the given filename and assumes that the meta.filename is the name on disk. That is clearly incorrect here. |
Yes, the alternative I proposed is adding a new attribute to the model container that contains the file names. I can code that option up later. |
I too agree with using |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
1d31f61
to
b61e70b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR puts the real file names in meta.resample.members rather than the individual file name meta.filename attributes. This is intended to address #1154 , but is rather awkward.
The challenge is that the ModelContainer passed to resample doesn't know about the original file names. This PR digs around the private contents of the datamodel to grab the input file name, and if that fails, falls back to img.meta.filename. But relying on img._asdf._fname is clearly asking for trouble.
The alternative would be to teach ModelContainer about the input file names if it's read from an association. That would add a new filenames member to ModelContainer that defaults to None, and sets the new filenames to be equal to _models if everything is a string. Then resample would check that attribute and use it if it's not None.
Thoughts on what the preferred approach is here? @ddavis-stsci , @mairanteodoro , you may have thoughts here?
Checklist
CHANGES.rst
under the corresponding subsection