-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add AbstractModelContainer #118
Conversation
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
Roman regression tests: https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/436/ JWST regression tests: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1013/ |
@schlafly I don't seem to be able to request you as a reviewer for this PR. Given that it relates to roman (and jwst) is there someone that can review this with an eye for the romancal interaction? |
I do not like this approach as it digs us further into reliance on old difficult to follow Python practices. Instead this (and for that matter This is precisely what the intent for stpipe/src/stpipe/datamodel.py Lines 18 to 31 in de7afd9
makes it so that any object containing crds_observatory , get_crds_parameters , and save attributes will pass an isinstance(object, AbstractDataModel) check without any need for inheritance. The lack of inheritance is necessary because there is no good reason for "DataModel-libraries" which are "stpipe -compatible" to require stpipe as a dependency. In fact, this is counter-productive in general as those libraries should be functional outside of pipeline execution code, e.g. opening the results of a pipeline run. For example both:
do NOT have any inheritance from Since Thus I suggest that the proposed notion of an |
Sorry, I can't provide useful feedback about this kind of thing. Since Roman & JWST regression tests pass it looks fine to me and I would approve were I able. I will defer to you and William on protocols vs. abstract interfaces vs. ... |
I'm closing this in favor of changes to the |
This PR adds
AbstractModelContainer
which behaves similarly to AbstractDataModel.The interface/protocol for
AbstractModelContainer
was constructed to:crds_observatory
attribute__iter__
attribute)save
methodAbstractDataModel
read_asn
methodfrom_asn
methodTo test the new
AbstractModelContainer
the jwst and romancal tests were updated. This conflicts with the changes in #116 It expands upon the changes in that PR to include running the integration tests when jwst and romancal/roman_datamodels are installed in the CI and extends those tests to test bothAbstractDataModel
andAbstractModelContainer
.This PR is likely an alternative to spacetelescope/stdatamodels#102