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

DM-12243: make inputCount more robust #99

Merged
merged 6 commits into from Nov 8, 2017
Merged

Conversation

PaulPrice
Copy link
Contributor

And run it in forced coadd measurement.

Copy link
Contributor

@natelust natelust left a comment

Choose a reason for hiding this comment

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

One question, and a few things to look at

@@ -50,7 +50,7 @@ def setDefaults(self):
self.measurement.copyColumns["id"] = "id"
self.measurement.copyColumns["parent"] = "parent"
self.references.removePatchOverlaps = False # see validate() for why
self.measurement.plugins.names |= ['base_InputCount']
self.measurement.plugins.names |= ['base_InputCount', 'base_Variance']
Copy link
Contributor

Choose a reason for hiding this comment

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

why do these get promoted to always be run, as opposed to camera configs or run specific configs? Is this something we thing everyone will want all the time?

def getTransformClass(self):
return self._generic.getTransformClass()

return ForcedFromGenericPlugin
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would prefer to see these as class methods on the generic plugin class called something like make<Single/forced>Plugin, so that something that is wrapped can just be singleFooPlugin = genericFooPluging.makeSingle("name"), each of these could then even deffer to a third more common code base to reduce duplication further if desired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good idea. I'll give it a go.


def __init__(self, config, name, schema, metadata, logName=None):
SingleFramePlugin.__init__(self, config, name, schema, metadata, logName=logName)
self._generic = GenericPluginClass(config, name, schema, metadata)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am nearly positive that if you are creating these classes inside a function the GenericPluginClass (or cls; see below) variable will be in a closure, and there is no need to explicitly store another pointer to it inside the self object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm storing an instance, not the class itself. I don't think we want to instantiate it every time we want to use it.
Or have I misunderstood your point?

@@ -50,6 +50,7 @@ def setDefaults(self):
self.measurement.copyColumns["id"] = "id"
self.measurement.copyColumns["parent"] = "parent"
self.references.removePatchOverlaps = False # see validate() for why
self.measurement.plugins.names |= ['base_InputCount', 'base_Variance']
Copy link
Contributor

Choose a reason for hiding this comment

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

why do these get promoted to always be run, as opposed to camera configs or run specific configs? Is this something we thing everyone will want all the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certainly the InputCount is something everyone will want to use (e.g., it can be used as a poor-man's detection limit). HSC experience is that the Variance is helpful too.

Having it only in unforced measurement isn't as helpful because it can be
skipped if the centroid is flagged, leaving us without a count measurement.
Even if the centroid has been declared to be bad (through the flag), still
attempt to measure the number of inputs at the position, as this might
provide something useful.
@PaulPrice
Copy link
Contributor Author

Moved the factory functions into the GenericPlugin as classmethods, and rebased against master.
Rerunning Jenkins...

@PaulPrice PaulPrice force-pushed the tickets/DM-12243 branch 2 times, most recently from 731e41b to 394599c Compare November 7, 2017 12:02
Some measurement plugins are really generic in the sense that it
doesn't matter whether they are run as a single-frame or forced
plugin, but the plumbing is slightly different (most notably, the
signature of the 'measure' method). To work around this, added a
GenericPlugin class and methods that will use that to produce the
appropriate SingleFramePlugin and ForcedPlugin classes so common
code can be used for both.
These previously only worked in single-frame measurement, but they would
be useful in forced measurement too. Using the new GenericPlugin, we can
use the same code to achieve both. This necessitated some small changes in
the error handling.
@PaulPrice PaulPrice merged commit c2f11c2 into master Nov 8, 2017
@ktlim ktlim deleted the tickets/DM-12243 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