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
DAMD-97: Add missing 2D pipeline outputs #281
Conversation
Moved I/O code to datamodel, so now we need to piggyback on that. Changed so that the Table class is built on top of the pfs.datamodel.PfsTable class, which provides the schema and I/O functions that we delegate to. Table uses the PfsTable schema to set up the properties and a dynamically created RowClass. We use this scheme instead of inheritance because we want to base Table on pandas.DataFrame instead of numpy.ndarray (Table needs to be performant, whereas PfsTable just needs to do I/O). In the process, changed ArcLineSet so that it uses "flux" and "fluxErr" instead of "intensity" and "intensityErr". ReferenceLineSet continues to use "intensity", since those numbers could be anything, whereas ArcLineSet's intensity measurements are actually flux that we measure.
black does it, so let's allow it.
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.
Changes look fine. Minor comments added.
| @@ -24,14 +35,44 @@ class FocalPlaneFunction(ABC): | |||
| A model of some spectrum as a function of position on the focal plane. | |||
|
|
|||
| This is an abstract base class. Subclasses need to override: | |||
| * ``DamdClass`` class variable: subclass of `pfs.datamodel.PfsTable` that | |||
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.
For this case, DamdClass is a subclass of PfsFocalPlaneFunction, not PfsTable
| return super().__getattribute__(name) | ||
|
|
||
| def __setattr__(self, name: str, value: Any): | ||
| return super().__setattr__(name, value) |
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.
Is there a corresponding LSST ticket to fix this permanently in the stack?
I'm sick of getting mypy errors when looking up Struct attributes.
Pushing I/O down to datamodel requires a bit of a redesign. We want the I/O only in the datamodel classes; functional code belongs in drp_stella. But I want to avoid multiple inheritance because it's annoying. So instead of inheriting from the datamodel class, compose it and forward most attribute lookups there. So the datamodel class holds the data, the drp_stella class holds the datamodel class and uses that to do the functional parts. The refactored code has been reformatted with black and is mypy-clean.
e677710
to
62f4701
Compare
No description provided.