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

tickets/DM-17390 Update CalibrateTask to be a PipelineTask #264

Merged
merged 2 commits into from Jan 26, 2019

Conversation

natelust
Copy link
Contributor

No description provided.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

Mostly just naming consistency and other stylistic comments (though I do think the naming consistency issues for config options are important).

@@ -166,9 +168,90 @@ class CalibrateConfig(pexConfig.Config):
doc="Injection of fake sources for testing purposes (must be "
"retargeted)"
)
icSourceSchema = InitInputDatasetField(
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about calling this inputSourceSchema (and similarly inputSourceCatalog), below, for more consistency with the output dataset field names?

dimensions=("Instrument", "Visit", "Detector"),
scalar=True
)
outputCatalog = OutputDatasetField(
Copy link
Member

Choose a reason for hiding this comment

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

Should standardize on either Cat or Catalog as the suffix for all of these, at least to the extent possible without breaking the current run signature.

storageClass="Catalog",
dimensions=("Instrument", "Visit", "Detector"),
scalar=True
)
Copy link
Member

Choose a reason for hiding this comment

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

It'd be good to have more consistency between the match dataset field names and the config options that control whether to produce them, too; maybe just "matches" and "matchesDenormalized"?

self.pixelMargin = photoRefObjLoader.config.pixelMargin
# If this is gen 3 don't allow LoadAstometryNet loader
if initInputs is not None and photoRefObjLoader is LoadAstrometryNetObjectsTask:
raise RuntimeError("Astrometry Net tasks are not compatible with gen 3 middleware")
Copy link
Member

Choose a reason for hiding this comment

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

It would probably be good to add a few more comments to the logic here to note which code paths are expected for PipelineTask execution vs. CmdLineTask execution. We'll certainly appreciate that later when we come back to remove the latter.

@@ -403,11 +507,10 @@ def runDataRef(self, dataRef, exposure=None, background=None, icSourceCat=None,
by icSourceKeys, or None;
@param[in] doUnpersist unpersist data:
- if True, exposure, background and icSourceCat are read from
dataRef and those three arguments must all be None;
dataRef and those three arguments must l be None;
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change this? If the old documentation was incorrect, I don't see where.

- if False the exposure must be provided; background and
icSourceCat are optional. True is intended for running as a
command-line task, False for running as a subtask

command-line task, False for running as a k
Copy link
Member

Choose a reason for hiding this comment

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

Something got mangled here; maybe the whole line change was accidental?

refObjLoader = ReferenceObjectLoader(inputDataIds['astromRefCat'],
butler,
self.config.astromRefObjLoader,
self.log)
Copy link
Member

Choose a reason for hiding this comment

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

With four arguments in a call I'd recommend using kwargs (same below).

expId, expBits = butler.registry.packDataId("VisitDetector",
inputDataIds['exposure'],
returnMaxBits=True)
inputData['exposureIdInfo'] = ExposureIdInfo(expId, expBits)
Copy link
Member

Choose a reason for hiding this comment

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

Probably a topic to discuss after the demo, but I wonder if it would be more readable to instead just pass extra keyword arguments (especially those that don't represent datasets) to run explicitly, rather than putting them in inputData.


results = self.run(**inputData)

if self.config.doWriteMatches and results.astromMatches is not None:
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for the first clause here to be true while the second is false? If so, that could be a problem in the future (because we're lying to the activator about what it should expect to see in the outputs). If we can easily convince ourselves that if self.config.doWriteMatches alone is sufficient here now, that'd be ideal; if not, I'd like to at least add a warning if results.astromMatrches is unexpectedly None and open a ticket to follow up later.

@@ -598,6 +734,10 @@ def run(self, exposure, exposureIdInfo=None, background=None,
sourceCat=sourceCat,
astromMatches=astromMatches,
matchMeta=matchMeta,

Copy link
Member

Choose a reason for hiding this comment

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

Just seems like a weird place for a newline. I'd either drop it or replace it with comment headings if you want to define groups of output struct fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants