-
Notifications
You must be signed in to change notification settings - Fork 2
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-46059: Add new metric to capture uncapped offsets between amp interfaces during ampOffsetTask execution #318
base: main
Are you sure you want to change the base?
Conversation
41278ee
to
0eaa7c2
Compare
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've one mandatory change, but I also wonder whether we could simplify this more generally...see comments below, and my direct messages on slack.
@@ -89,3 +106,29 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs): | |||
raise NoWorkFound(f"No metadata entries for {taskName}.") | |||
outputs = self.run(data=metadata, plotInfo=plotInfo) | |||
butlerQC.put(outputs, outputRefs) | |||
|
|||
|
|||
class DictTypeDatasetMetadataAnalysisTask(AnalysisPipelineTask): |
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.
Should we simply call this DatasetMetadataAnalysisTask
, or do we expect there to be other, non-dict datasets?
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.
We also expect non-dict metadata that simply offer a value for each metric name; I can add one for such regular 1:1
mappings for completeness. This specific ticket focuses on the interactions between many amplifiers on a detector, so it made sense to store information about all those so-called interface offsets in a dictionary that pairs amp names with the offsets, rather than cluttering our metadata with less human-readable names.
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.
Introduced the DatasetMetadataAnalysisTask
class, which adapts its behavior based on the metricsStoredAsDict
config option.
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.
In that case, do feel free to revert back to DictTypeDatasetMetadataAnalysisTask
and remove the metricsStoredAsDict
parameter. I'll leave that up to you, though.
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 having it this way with metricsStoredAsDict
is more future-proof because most metrics I know are not stored as dictionaries.
8037a9e
to
8dc3992
Compare
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'm happy for this to be merged once you've made the requested changes. All are very minor.
Thanks for this!
pipelines/calexpMetrics.yaml
Outdated
metadataDimensions: ["instrument", "visit", "detector"] | ||
atools.calexpMetadataMetrics: MetadataMetricTool | ||
connections.inputName: calibrate_metadata | ||
connections.outputName: calibrate_metadata_analysis |
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.
Could you remove _analysis
from this output name, please? While I had thought it was a problem, it turns out it isn't, as _metrics
is added to the end of the output name - so what we'd end up with here is calibrate_metadata_analysis_metrics
. I'd rather keep the names as short as possible, while still being meaningful and unique. Might be worth adding a # Appended with "_metrics"
- or similar - comment here so I don't get confused again!
Sorry for the confusion!
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.
Done!
pipelines/pviMetrics.yaml
Outdated
metadataDimensions: ["instrument", "visit", "detector"] | ||
atools.calibrateImageMetadataMetrics: MetadataMetricTool | ||
connections.inputName: calibrateImage_metadata | ||
connections.outputName: calibrateImage_metadata_analysis |
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.
Same applies here (i.e., please remove _analysis
).
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.
Done!
pipelines/visitQualityCore.yaml
Outdated
metadataDimensions: ["instrument", "visit", "detector"] | ||
atools.calexpMetadataMetrics: MetadataMetricTool | ||
connections.inputName: calibrate_metadata | ||
connections.outputName: calibrate_metadata_analysis |
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.
And here! :)
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.
Done!
dimensions=frozenset(config.metadataDimensions), | ||
) | ||
|
||
self.dimensions = frozenset(config.inputDimensions) |
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.
self.dimensions = frozenset(config.inputDimensions)
should come before super().__init__(config=config)
so that the inputDimensions
are picked-up here, when the metrics output connection is defined. Otherwise, the output metric bundle doesn't have any dimensions!
I should have realised this when I asked you to set dimensions={}
above - sorry for my oversight.
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.
Done!
5533deb
to
20a34cc
Compare
No description provided.