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 #411

Merged
merged 31 commits into from Apr 8, 2024
Merged

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Mar 28, 2024

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

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

Project coverage is 80.88%. Comparing base (3034863) to head (4c8f616).

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

Files Patch % Lines
python/lsst/pipe/base/tests/simpleQGraph.py 45.90% 27 Missing and 6 partials ⚠️
...n/lsst/pipe/base/pipeline_graph/_pipeline_graph.py 51.42% 14 Missing and 3 partials ⚠️
python/lsst/pipe/base/pipeTools.py 0.00% 7 Missing ⚠️
python/lsst/pipe/base/pipeline_graph/_tasks.py 86.95% 3 Missing ⚠️
python/lsst/pipe/base/graph/graph.py 88.23% 1 Missing and 1 partial ⚠️
python/lsst/pipe/base/graph/quantumNode.py 60.00% 2 Missing ⚠️
python/lsst/pipe/base/pipeline.py 88.23% 2 Missing ⚠️
python/lsst/pipe/base/execution_reports.py 95.00% 0 Missing and 1 partial ⚠️
python/lsst/pipe/base/graphBuilder.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #411      +/-   ##
==========================================
- Coverage   82.40%   80.88%   -1.52%     
==========================================
  Files          93       92       -1     
  Lines       10660    10685      +25     
  Branches     2020     2049      +29     
==========================================
- Hits         8784     8643     -141     
- Misses       1522     1699     +177     
+ Partials      354      343      -11     

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

@TallJimbo TallJimbo force-pushed the tickets/DM-40441 branch 2 times, most recently from defaef5 to 692638f Compare March 28, 2024 20:18
This was added _just_ before TaskDef was approved for deprecation on
RFC-949, and I'm sure nothing outside ctrl_mpexec is using it, so I'm
not going through a deprecation period for it.
After DM-38498 datastore records were mistakenly being attached whether
requested or not.
Apparently this was only exported publicly by the graphBuilder module,
and while that was sort of an accident (it wasn't in __all__), it also
makes sense as the only code using it, and that makes
all_dimensions_quantum_graph_builder the logical new home.
@@ -101,6 +102,19 @@ class QuantumNode:
creation.
"""

@property
def task_node(self) -> TaskNode:
Copy link
Member

Choose a reason for hiding this comment

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

Is this property something that can easily be added to a test?

@@ -44,13 +48,31 @@
if TYPE_CHECKING:
from .taskFactory import TaskFactory

# TODO: remove this module on DM-40443.
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't look like anything in lsst_distrib or ci is using this code. GitHub shows no-one using it either (other than forks of pipe_base) so removing this file completely seems entirely possible.

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 that I've already got the deprecation in, I figure it'll still be easier for me to leave it as is and drop it on DM-40443.

@@ -601,6 +596,17 @@ def findSubsetsWithLabel(self, label: str) -> set[str]:
results.add(subset.label)
return results

@property
def task_labels(self) -> Set[str]:
Copy link
Member

Choose a reason for hiding this comment

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

Add a test?

@@ -260,6 +261,47 @@ def __deepcopy__(self, memo: dict) -> PipelineGraph:
# that mutable state is copied.
return self.copy()

def diff_tasks(self, other: PipelineGraph) -> list[str]:
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to test this in pipe_base?

python/lsst/pipe/base/tests/simpleQGraph.py Show resolved Hide resolved
Eventually (DM-40442) these classes will be more tightly integrated,
but this piece lets us start to modernize downstream code in advance.
Like the pipeline_graph attribute of QuantumGraph, eventually
(DM-40442) we'll want this to be more tightly integrated, probably
replacing the TaskDef as the true attribute, but for now this is enough
to allow downstream code to be more forward-looking by avoiding
deprecated or soon-to-be-deprecated TaskDef interfaces.
Passing a subclass instance of Task.ConfigClass is a weird thing to do,
but it's seems harder to prohibit it than just accept it, and we have
some tests in ctrl_mpexec that depend on doing just that.
This also makes the first argument to TaskFactory.makeTask
positional-only, which is formally backwards incompatible but not
something I'm worried about in practice.
I originally hoped we could minimize how much of the
PipelineTaskConnections interface PipelineGraph would have to expose,
with the idea being that PipelineTaskConnections would be one interface
that task authors write to, and TaskNode would be a slightly different
interface that the execution system writes against, and that decoupling
those would be good for stability.  But we've always had to punch holes
to allow the task to customize its execution in various respects, and
at this point it's best to just provide access to the connections class
itself, too, even if we'd still prefer to have other TaskNode
interfaces used by the execution system where possible.
This was the last usage of BaseConnections.makeDatasetType, so we can
deprecate it now.
This also solidifies the definition of what we mean by label-range
slicing for task that lack a dependency relationship to one or both
bounds.
FieldValidationError has more useful state for diagonstics than most
other exceptions, and that's worth preserving when validation fails.
v26 came and went while this branch was sidetracked.
This provides a way to get the labels of the tasks without the
expensive (and not-always-possible) step of making a PipelineGraph.
@TallJimbo TallJimbo merged commit df8e01f into main Apr 8, 2024
11 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-40441 branch April 8, 2024 20:02
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