Skip to content

Commit

Permalink
Minor review-inspired cleanups for PipelineGraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Aug 3, 2023
1 parent 1253e4f commit b875dd9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/lsst/pipe/base/pipeline_graph/_pipeline_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def resolve(self, registry: Registry) -> None:
Notes
-----
The `universe` attribute are set to ``registry.dimensions`` and used to
The `universe` attribute is set to ``registry.dimensions`` and used to
set all `TaskNode.dimensions` attributes. Dataset type nodes are
resolved by first looking for a registry definition, then using the
producing task's definition, then looking for consistency between all
Expand Down Expand Up @@ -582,12 +582,10 @@ def add_task(
it references and marks the graph as unsorted. It is most effiecient
to add all tasks up front and only then resolve and/or sort the graph.
"""
key = NodeKey(NodeType.TASK, label)
init_key = NodeKey(NodeType.TASK_INIT, label)
task_node = TaskNode._from_imported_data(
key,
init_key,
_TaskNodeImportedData.configure(label, task_class, config, connections),
key=NodeKey(NodeType.TASK, label),
init_key=NodeKey(NodeType.TASK_INIT, label),
data=_TaskNodeImportedData.configure(label, task_class, config, connections),
universe=self.universe,
)
self.add_task_nodes([task_node])
Expand Down Expand Up @@ -1449,7 +1447,10 @@ def _init_from_args(
self._dataset_types = DatasetTypeMappingView(self._xgraph)
self._raw_data_id: dict[str, Any]
if isinstance(data_id, DataCoordinate):
universe = data_id.universe
if universe is None:
universe = data_id.universe
else:
assert universe is data_id.universe, "data_id.universe and given universe differ"

Check warning on line 1453 in python/lsst/pipe/base/pipeline_graph/_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/pipeline_graph/_pipeline_graph.py#L1453

Added line #L1453 was not covered by tests
self._raw_data_id = data_id.byName()
elif data_id is None:
self._raw_data_id = {}
Expand Down

0 comments on commit b875dd9

Please sign in to comment.