Skip to content
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

meas_base review for tickets/DM-3182 #21

Merged
merged 4 commits into from Jul 28, 2015
Merged

meas_base review for tickets/DM-3182 #21

merged 4 commits into from Jul 28, 2015

Conversation

TallJimbo
Copy link
Member

No description provided.

@TallJimbo TallJimbo changed the title meas_base review for tickets/D82 meas_base review for tickets/DM-3182 Jul 23, 2015
@TallJimbo
Copy link
Member Author

I'm not convinced moving BaseMeasurementTask into its own file is an improvement, at least not on its own - before, we had a nice symmetry between base.py, forcedMeasurement.py, and sfm.py, where each held both the plugin base class and the task driver (and their configs), and that's now been lost. Admittedly, base.py also had a bunch of other helper code, but if you're going to move BaseMeasurementTask into its own file, I think you should do the same with the other two files, and rename what's left over to e.g. basePlugin.py. I'm ambivalent as to whether you do that or just leave the organization as it was, but I'd rather not land halfway in between.


self.schema must be available when this is called
"""
self.makeSubtask("applyApCorr", schema=self.schema)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this provides enough convenience/code-sharing to be worthwhile, but I don't care deeply enough about it to fight it if you feel strongly about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is safety I'm worried about. Without it I see no reason that people who author new subclasses will understand the need to instantiate the aperture correction subtask. However, I'll remove it for now, since it does add clutter.

@TallJimbo
Copy link
Member Author

On the question of whether to just extract the ApCorrMap from the Exposure, I think that's a bigger issue than we want to try to address here, but maybe we can hedge a bit and provide both: have an apCorrMap argument that, if None, will be set to Exposure.getApCorrMap().

@r-owen
Copy link
Contributor

r-owen commented Jul 23, 2015

Regarding adding baseMeasurment: I agree about the lost symmetry. I will move the two base plugin classes into baseMeasurement.py, which restores symmetry and leaves base.py for really basic stuff and avoids a circular import, which was the primary motivation for the reorganization. I think renaming sfm.py to singleFrameMeasurement.py would also be an improvement for readability.

@r-owen
Copy link
Contributor

r-owen commented Jul 23, 2015

I am very reluctant to add apCorrMap as an argument to the measure methods until we demonstrate a need for it. I had started out using it but I feel it results in clutter and needless complexity. It will be very easy to add later if it proves useful.

@TallJimbo
Copy link
Member Author

Please go ahead and rename sfm.py if you're up to it. It sounds like the right place to do it. Maybe we should reconsider renaming base.py, too, if it's just the utility code now?

Leaving out the apCorrMap argument is fine with me.

Move BasePlugin, BasePluginConfig, BaseMeasurementTask and
BaseMeasurementConfig to a new module baseMeasurement.py
in order to allow BaseMeasurementTask access to ApplyApCorrTask.
Without this refactoring it would be very difficult to avoid a
circular import. This change is arguably an improvement because it
moves higher-level code out of base.py and moves BaseMeasurementTask
into a more obvious module (one that analogous to sfm.py and
forcedMeasurement.py)
@r-owen r-owen force-pushed the tickets/DM-3182 branch 2 times, most recently from 7981a53 to 4d91e80 Compare July 24, 2015 00:03
BaseMeasurementTask and its subtasks now apply aperture correction
as part of the run method. Most of the work is done in
BaseMeaurementTask._applyApCorrIfWanted, a simple private wrapper
around self.apCorrMap.run that only applies aperture corrections
if wanted.
- Eliminate use of "from X import *"
- Remove unused imports
- Add a missing math import in one test
- Add __all__ to some modules to avoid importing too many symbols
- Import a few more files in __init__ (whose symbols were being
  pulled in due to lack of "__all__" in other modules).
- Reorder a few imports to meet LSST standards
- Stop assigning to variables that are not used; this showed
  up in a few unit tests and I left the computation in place,
  since performing the computation looked like it would
  probably be a useful test.
@r-owen r-owen merged commit b6d951f into master Jul 28, 2015
@ktlim ktlim deleted the tickets/DM-3182 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants