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-40441: first batch of deprecations from RFC-949 #287

Merged
merged 19 commits into from Apr 8, 2024
Merged

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Mar 28, 2024

Requires lsst/pipe_base#411

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes (the pipe_base changelog entry covers these changes, too)

The same code was already being called in the end, but now we're
bypassing the soon-to-be-deprecated backwards-compatibility shim.
These have apparently been there from the beginning, but seem to have
never been used and never documented.
This also deprecates iterable-of-TaskDef inputs to
SimplePipelineExecutor.
This deprecates the 'builder' argument to make_quantum_graph in favor
of the new 'builder_class' argument.
Since the QG is now frequently responsible for carrying information
about registry dataset types to executing code, we don't want it to be
legal to change the registry definition after making a QG and then run
that QG.  We also can't really stop it most of the time, but we can at
least make these tests not do it.
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 79.28571% with 58 lines in your changes are missing coverage. Please review.

Project coverage is 86.83%. Comparing base (716b37d) to head (f5ec60c).

❗ Current head f5ec60c differs from pull request most recent head fab8c00. Consider uploading reports for the commit fab8c00 to get more accurate results

Files Patch % Lines
python/lsst/ctrl/mpexec/singleQuantumExecutor.py 72.50% 10 Missing and 1 partial ⚠️
python/lsst/ctrl/mpexec/taskFactory.py 54.54% 8 Missing and 2 partials ⚠️
python/lsst/ctrl/mpexec/preExecInit.py 63.63% 6 Missing and 2 partials ⚠️
python/lsst/ctrl/mpexec/cmdLineFwk.py 64.70% 5 Missing and 1 partial ⚠️
...thon/lsst/ctrl/mpexec/separablePipelineExecutor.py 50.00% 4 Missing and 2 partials ⚠️
python/lsst/ctrl/mpexec/log_capture.py 69.23% 2 Missing and 2 partials ⚠️
...ython/lsst/ctrl/mpexec/simple_pipeline_executor.py 76.47% 4 Missing ⚠️
python/lsst/ctrl/mpexec/dotTools.py 25.00% 3 Missing ⚠️
tests/test_executors.py 93.02% 0 Missing and 3 partials ⚠️
python/lsst/ctrl/mpexec/util.py 86.66% 1 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
- Coverage   87.29%   86.83%   -0.47%     
==========================================
  Files          49       49              
  Lines        4472     4542      +70     
  Branches      771      780       +9     
==========================================
+ Hits         3904     3944      +40     
- Misses        415      441      +26     
- Partials      153      157       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

My main question is about the v26 vs v27 timeline for removal.

python/lsst/ctrl/mpexec/log_capture.py Outdated Show resolved Hide resolved
):
raise
expected = self.full_butler.registry.getDatasetType(dataset_type.name)
raise ConflictingDefinitionError(
Copy link
Member

Choose a reason for hiding this comment

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

Since you are raising the same exception can you instead annotate the original exception?

except ConflictingDefinitionError as e:
    expected = self.full_butler.registry.getDatasetType(dataset_type.name)
    e.add_note(
        f"DatasetType definition in registry has changed since the QuantumGraph was built: "
        f"{dataset_type} (graph) != {expected} (registry)."
    )
    raise

?

Copy link
Member Author

Choose a reason for hiding this comment

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

I gave this a try, but that changes which message appears as the primary one, and in this case we want the new message to be more prominent than the original.

except ConflictingDefinitionError:
if not _check_compatibility(
Copy link
Member

Choose a reason for hiding this comment

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

I assume the compatibility check is now done lower down and I haven't read the pipe_base changes yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, specifically in PipelineGraph.resolve.

if builder:
warnings.warn(
"The 'builder' argument to SeparablePipelineBuilder.make_quantum_graph "
"is deprecated in favor of 'builder_class', and will be removed after v26.",
Copy link
Member

Choose a reason for hiding this comment

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

You want to remove it all before 27 comes out?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, just an old branch I forgot to update.

quantum_graph = graph_builder.makeGraph(
pipeline, collections=butler.collections, run=butler.run, userQuery=where, bind=bind
# TODO: disable this block and adjust docs and annotations
# on DM-40443.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe DM-40443 should be made a blocker of DM-37430? (the v27 pipelines release ticket)

Copy link
Member Author

Choose a reason for hiding this comment

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

Given the errors I made in version numbers on this ticket, I'm setting the release ticket to block DM-40443 instead.

requirements.txt Outdated
@@ -5,7 +5,7 @@ pydantic >=2,<3.0
networkx
git+https://github.com/lsst/resources@main#egg=lsst-resources
Copy link
Member

Choose a reason for hiding this comment

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

Please modernize all these when you go in to remove the ticket branch.

lsst-resources @ git+https://github.com/lsst/resources@main
lsst-daf-butler @ git+https://github.com/lsst/daf_butler@main
lsst-utils @ git+https://github.com/lsst/utils@main
lsst-pipe-base @ git+https://github.com/lsst/pipe_base@main
lsst-pex-config @ git+https://github.com/lsst/pex_config@main

...instead of PipelineDatasetTypes.

This includes a check on changes to registry dataset types between QG
generation and execution, but only when executing with full butler.
Calling code in this package will be updated to avoid the new warning
in a later commit.
Calling code in this package will be updated to avoid the new warning
in a later commit.
This should eliminate all new deprecation warnings from internal
ctrl_mpexec calls.
It's easier to deprecate the whole function than it is to migrate its
return type.
I'm deferring actually removing this usage to DM-40639, since there's
an opportunity to easily make a nice improvement to this code at the
same time, but only after DM-39779 merges (and I don't want to increase
the scope of this ticket further).
@TallJimbo TallJimbo force-pushed the tickets/DM-40441 branch 2 times, most recently from 94a2200 to 734861c Compare April 8, 2024 16:37
@TallJimbo TallJimbo merged commit d04c916 into main Apr 8, 2024
13 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-40441 branch April 8, 2024 20:11
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