-
Notifications
You must be signed in to change notification settings - Fork 21
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
RCAL-728: Fix meta.model_type
to reflect the data model's type
#296
RCAL-728: Fix meta.model_type
to reflect the data model's type
#296
Conversation
d638039
to
eb600a1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
- Coverage 97.17% 96.98% -0.20%
==========================================
Files 28 28
Lines 2516 2521 +5
==========================================
Hits 2445 2445
- Misses 71 76 +5 ☔ View full report in Codecov by Sentry. |
super().__init__(init, **kwargs) | ||
|
||
if init is not None: | ||
self.meta.model_type = self.__class__.__name__ |
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.
This decides that the meta.model_type
string should be the name of the model
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.
I think this is correct. model_type
should be the name of the datamodel to instantiate.
While I think this PR addresses the issue, looking at the current state of the schemas I am a bit confused. I see spacetelescope/rad#278 added a |
I think you mean
For both purposes, these exist only to enable testing in Note that in addition to the above Note that as the schemas are currently structured, |
8724eee
to
5e8515f
Compare
It just occurred to me that an alternate/additional solution to the problem this PR is attempting to solve is to do something similar to #295. Namely, set Doing this alone has the drawback that |
Resolves RCAL-728
Closes spacetelescope/romancal#1036
This PR ensures that during model initialization, the
meta.model_type
is set to reflect the "model_type" of the datamodel. This does not enforce this past initialization.Note, I chose "model_type" to mean the "name" (
__class__.__name__
) of the RDM datamodel. This is an arbitrary minimal choice. A reasonable alternative is the CamelCase-ification of the root name of the top level schema, eg.../wfi_science_raw
->WfiScienceRawModel
orWfiScienceRaw
, but the__class__.__name__
corresponding to this is acutallyScienceRawModel
. In any case, we need to clarify our model-naming conventions and decide how they map to themeta.model_type
.Checklist
CHANGES.rst
under the corresponding subsection