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-16017: Prototype a metrics-handling Task #30

Merged
merged 2 commits into from Dec 13, 2018
Merged

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Dec 6, 2018

This PR adds prototype implementations of the MetricTask and MetricsControllerTask classes described by DMTN-098. The implementation of MetricsControllerTask currently relies on a hard-coded copy of ap.verify.measurements.profiling.TimingMetricTask (see lsst/ap_verify#55 for the "real" version). Its removal is ticketed as DM-16535; setting up a proper configuration system for MetricsControllerTask was deemed too challenging for an initial prototype.

This PR adds API documentation but no package-level documentation. The current code is not suitable for general use, so I would prefer to defer writing package-level docs until MetricsControllerTask is closer to its intended form.

Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

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

Looks good. Mostly just thoughts on the docs. The only code recommendation I have from an lsst.verify point of view is that I think you can get away with just instantiating a job = Job() in the controller, rather than also loading up metric and specification data (job = Job.load_metrics_package())

python/lsst/verify/compatibility/metricTask.py Outdated Show resolved Hide resolved
python/lsst/verify/compatibility/metricTask.py Outdated Show resolved Hide resolved
python/lsst/verify/compatibility/metricTask.py Outdated Show resolved Hide resolved
python/lsst/verify/compatibility/metricsControllerTask.py Outdated Show resolved Hide resolved
python/lsst/verify/compatibility/metricsControllerTask.py Outdated Show resolved Hide resolved
python/lsst/verify/compatibility/metricsControllerTask.py Outdated Show resolved Hide resolved

return Struct(jobs=jobs)

def _nameJobFile(self, index, dataId):
Copy link
Member

Choose a reason for hiding this comment

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

Normally when we say "file" in Python we're talking about a file handle. I think in this case its a "Path" instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

"path" seems kind of redundant with "name"; would _jobFilePath be acceptable?

jobs = []
index = 0
for dataref in datarefs:
job = Job.load_metrics_package()
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need to load the metrics package into the Job since you aren't working with job.metrics or job.specs. I think

job = Job()

is sufficient (and faster).

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you elaborate? While it would certainly make testing easier for me, SQR-019 recommends the current method.

Also, I noticed while working on a previous ticket that I get errors if I try to use the wrong units for a measurement value. Will those checks still happen if I use a bare Job, and if so, when/where? During SQuaSH upload?

Copy link
Member

Choose a reason for hiding this comment

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

The unit compatibility check will happen during dispatch_verify, which does run Job.load_metrics_package and integrates in the metric and specification with any new measurement data.

Unless you think tasks will need to do something based on metric and specification data, you can save time by not loading it at this point.

python/lsst/verify/compatibility/metricsControllerTask.py Outdated Show resolved Hide resolved
This commit includes MetricTask and unit test code, but not
documentation. A guide to the MetricTask framework is not being added
at this stage; it will be written once prototyping is complete.
@kfindeisen kfindeisen force-pushed the tickets/DM-16017 branch 2 times, most recently from 7daed43 to 05ff133 Compare December 13, 2018 21:46
The current implementation is extremely crude, and has some hard-coded
dependencies on the LSST pipelines. These will be removed in future work.
@kfindeisen kfindeisen merged commit 11001f1 into master Dec 13, 2018
@kfindeisen kfindeisen deleted the tickets/DM-16017 branch December 13, 2018 22:49
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

4 participants