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-16536: Migrate all metrics from ap.verify.measurements #63

Merged
merged 7 commits into from Mar 18, 2019

Conversation

kfindeisen
Copy link
Member

This PR replaces all functions previously in lsst.ap.verify.measurements with MetricTask equivalents in other packages (except for TimingMetricTask, which cannot be reasonably placed in any other Stack package). The hardcoded references inside measurements/compute_metrics.py are replaced with MetricTaskConfig instances; two default configs for supporting CI are provided in config/.

Correctly handling lsst.ap.association.TotalUnassociatedDiaObjectsMetricTask required a significant rewrite of the post-ApPipeTask control flow, which had been written on the assumption that all metrics are calculated after every image. The current solution (hardcoding the existence of two MetricsControllerTasks, one for image- and one for dataset-level metrics) is clumsy both for the user and for code maintainers, but I believe it is better to defer generalizing the code to another, more focused ticket.

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. Is it written down somewhere why the TimingMetricTask remains in lsst.ap.verify? I didn't quite catch that.

@kfindeisen
Copy link
Member Author

kfindeisen commented Mar 12, 2019

It came up in the RFC-550 discussion. Where would be a good place to document a decision like that?

@jonathansick
Copy link
Member

Oh I see. I don't entirely understand how that circular dependency comes up. I'll have to take a closer look at how these tasks work. Until I understand the nature of the issue I can't really say if or where it should be documented.

@kfindeisen
Copy link
Member Author

MetricTask (Gen 2 or Gen 3, it doesn't matter) inherits from lsst.pipe.base.Task, so pipe_base must be built before verify. A hypothetical lsst.pipe.base.TimingMetricTask would inherit from MetricTask, so verify would need to be built before pipe_base.

@jonathansick
Copy link
Member

Sorry for being confused, but I thought the hope would be to migrate TimingMetricTask to lsst.verify, not lsst.pipe.base.

@kfindeisen
Copy link
Member Author

Ah. Yes, that would work from a dependency point of view, but I thought the RFC consensus was that code associated with specific metrics would not go into lsst.verify. We could make an exception, but that makes me wonder if there would be other exceptions later.

@kfindeisen
Copy link
Member Author

@jonathansick so should I take any action on TimingMetricTask? Everything else is ready to go.

@jonathansick
Copy link
Member

By all means, this is good to go.

We could make an exception, but that makes me wonder if there would be other exceptions later.

So I definitely feel that something like AM1MetricTask, or some other very domain-specific measurement task, ought to belong in the package most associated the metric. But something like timing (if I understand the task's intent well enough) seems so broadly applicable that it could belong in lsst.verify. Do you agree with that?

@kfindeisen
Copy link
Member Author

@jonathansick Fine. Any preferences on whether profiling.py goes into a specific subpackage or directly into lsst.verify? I'm a bit worried about namespace clutter/confusion, but it's your package.

@kfindeisen
Copy link
Member Author

Given the issue I just ran into with documentation builds, I'll merge as-is and open another ticket for moving TimingMetricTask to verify.

This commit decouples the MetricsControllerTask invocation from the
old-style measurement code, making it possible to request measurements
at any granularity.
Since this commit removes all use of the old-style metrics, the
corresponding files are deleted as well.
AutoJob is no longer used by any code in ap_verify. Since SQuaSH
upload was part of AutoJob, but there is no compelling case to
reproduce the feature in the new metrics code, all SQuaSH-related code
has been removed. The --silent command-line argument is deprecated.
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