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-43615: Add visit summary metric dispatching to CalibrateImageTask #945

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jrmullaney
Copy link
Contributor

No description provided.

@jrmullaney jrmullaney requested review from ctslater and parejkoj and removed request for ctslater June 12, 2024 15:47
Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Two significant concerns about this approach. If we can't fix the circular imports problem, I'd be interested in brainstorming another approach (I give one suggested way, but there may be others).

@@ -41,6 +41,23 @@
from . import measurePsf, repair, photoCal, computeExposureSummaryStats, snapCombine


class _EmptyTargetTask(pipeBase.PipelineTask):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of this approach. Could those metrics be moved into a different package, to fix the circular import problem? Alternately, could we modify ConfigurableField to allow optional and then let target=None? That seems like a better approach, though it still doesn't solve the problem of not being able to test the new if branch.

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 also not a fan, and I like to think this is a temporary workaround the to the circular import problem. The reason we didn't go down the target=None route was to ensure that a meaningful error message was raised if one tried to implement metric-writing without retargeting.

The circular import arises solely due to analysis_tools needing pipe_tasks to be set up to import the LoadReferenceCatalogTask; if that (and colorterms, which LoadReferenceCatalogTask uses) can be moved out of pipe_tasks, then the circular import is fixed. However, I don't know whether that is something that would be considered feasible.

Could those metrics be moved into a different package...?

My understanding is that we want to avoid/move away from having metrics created outside of analysis_tools (is that what you mean?), in order to ensure that the same tool run from within a task or as a standalone analysis tool will produce the same results (from this post by @natelust; apologies to Nate if there is any misunderstanding on my part on this).

I seem to recall @TallJimbo saying that he was "ok" with this (temporary??) workaround, but that's not to say that it shouldn't be reconsidered. It may come down to how critical it is to have metric creation in here for OR4; but that decision is above my pay grade :) .

Again, apologies if I've misrepresented either Nate or Jim.

Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly is the circular import problem, anyway? analysis_tools does not depend on pipe_tasks.

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 believe analysis_tools -> cp_pipe -> pipe_tasks is the dependency.

python/lsst/pipe/tasks/calibrateImage.py Outdated Show resolved Hide resolved
python/lsst/pipe/tasks/calibrateImage.py Show resolved Hide resolved
python/lsst/pipe/tasks/calibrateImage.py Show resolved Hide resolved
python/lsst/pipe/tasks/calibrateImage.py Show resolved Hide resolved
python/lsst/pipe/tasks/calibrateImage.py Outdated Show resolved Hide resolved
@@ -41,6 +41,23 @@
from . import measurePsf, repair, photoCal, computeExposureSummaryStats, snapCombine


class _EmptyTargetTask(pipeBase.PipelineTask):
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 also not a fan, and I like to think this is a temporary workaround the to the circular import problem. The reason we didn't go down the target=None route was to ensure that a meaningful error message was raised if one tried to implement metric-writing without retargeting.

The circular import arises solely due to analysis_tools needing pipe_tasks to be set up to import the LoadReferenceCatalogTask; if that (and colorterms, which LoadReferenceCatalogTask uses) can be moved out of pipe_tasks, then the circular import is fixed. However, I don't know whether that is something that would be considered feasible.

Could those metrics be moved into a different package...?

My understanding is that we want to avoid/move away from having metrics created outside of analysis_tools (is that what you mean?), in order to ensure that the same tool run from within a task or as a standalone analysis tool will produce the same results (from this post by @natelust; apologies to Nate if there is any misunderstanding on my part on this).

I seem to recall @TallJimbo saying that he was "ok" with this (temporary??) workaround, but that's not to say that it shouldn't be reconsidered. It may come down to how critical it is to have metric creation in here for OR4; but that decision is above my pay grade :) .

Again, apologies if I've misrepresented either Nate or Jim.

python/lsst/pipe/tasks/calibrateImage.py Show resolved Hide resolved
@@ -41,6 +41,23 @@
from . import measurePsf, repair, photoCal, computeExposureSummaryStats, snapCombine


class _EmptyTargetTask(pipeBase.PipelineTask):
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 believe analysis_tools -> cp_pipe -> pipe_tasks is the dependency.

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.

2 participants