Skip to content

Commit

Permalink
Switch to DataCoordinate.make_empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Nov 21, 2023
1 parent 9930cb6 commit 9f3e0d1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions python/lsst/pipe/base/_dataset_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

# Use an empty dataID as a default.
def _default_dataId() -> DataCoordinate:
return DataCoordinate.makeEmpty(DimensionUniverse())
return DataCoordinate.make_empty(DimensionUniverse())

Check warning on line 47 in python/lsst/pipe/base/_dataset_handle.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/_dataset_handle.py#L47

Added line #L47 was not covered by tests


@dataclasses.dataclass(frozen=True, init=False)
Expand All @@ -56,7 +56,7 @@ class InMemoryDatasetHandle:
parameters will be converted into a dataId-like entity.
"""

_empty = DataCoordinate.makeEmpty(DimensionUniverse())
_empty = DataCoordinate.make_empty(DimensionUniverse())

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/pipe/base/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def get_data_id(self, universe: DimensionUniverse) -> DataCoordinate:
instrument_class = cast(PipeBaseInstrument, doImportType(instrument_class_name))
if instrument_class is not None:
return DataCoordinate.standardize(instrument=instrument_class.getName(), universe=universe)
return DataCoordinate.makeEmpty(universe)
return DataCoordinate.make_empty(universe)

Check warning on line 637 in python/lsst/pipe/base/pipeline.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/pipeline.py#L637

Added line #L637 was not covered by tests

def addTask(self, task: type[PipelineTask] | str, label: str) -> None:
"""Add a new task to the pipeline, or replace a task that is already
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/pipe/base/quantum_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(
raise ValueError("No output RUN collection provided.")
self.output_run = output_run
self.skip_existing_in = skip_existing_in
self.empty_data_id = DataCoordinate.makeEmpty(butler.dimensions)
self.empty_data_id = DataCoordinate.make_empty(butler.dimensions)
self.clobber = clobber
# See whether the output run already exists.
self.output_run_exists = False
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dataset_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_dataset_handle_dataid(self):
hdl = InMemoryDatasetHandle(42)
self.assertEqual(dict(hdl.dataId.required), {})

dataId = DataCoordinate.makeEmpty(DimensionUniverse())
dataId = DataCoordinate.make_empty(DimensionUniverse())
hdl = InMemoryDatasetHandle(42, dataId=dataId)
self.assertIs(hdl.dataId, dataId)

Expand Down
12 changes: 6 additions & 6 deletions tests/test_pipeline_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ def test_inputs_compatible_with_registry(self) -> None:
b_i.adapt_dataset_type(dataset_type),
dataset_type.overrideStorageClass(get_mock_name("ArrowAstropy")),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1251 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1251

Added line #L1251 was not covered by tests
ref = DatasetRef(dataset_type, data_id, run="r")
a_ref = a_i.adapt_dataset_ref(ref)
b_ref = b_i.adapt_dataset_ref(ref)
Expand Down Expand Up @@ -1277,7 +1277,7 @@ def test_output_compatible_with_registry(self) -> None:
a_o.adapt_dataset_type(dataset_type),
dataset_type.overrideStorageClass(get_mock_name("ArrowTable")),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1280 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1280

Added line #L1280 was not covered by tests
ref = DatasetRef(dataset_type, data_id, run="r")
a_ref = a_o.adapt_dataset_ref(ref)
self.assertEqual(a_ref, ref.overrideStorageClass(get_mock_name("ArrowTable")))
Expand Down Expand Up @@ -1310,7 +1310,7 @@ def test_inputs_compatible_with_output(self) -> None:
b_i.adapt_dataset_type(graph.dataset_types["d"].dataset_type),
graph.dataset_types["d"].dataset_type.overrideStorageClass(get_mock_name("ArrowAstropy")),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1313 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1313

Added line #L1313 was not covered by tests
ref = DatasetRef(graph.dataset_types["d"].dataset_type, data_id, run="r")
a_ref = a_o.adapt_dataset_ref(ref)
b_ref = b_i.adapt_dataset_ref(ref)
Expand Down Expand Up @@ -1342,7 +1342,7 @@ def test_component_resolved_by_input(self) -> None:
b_i.adapt_dataset_type(parent_dataset_type),
parent_dataset_type.makeComponentDatasetType("schema"),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1345 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1345

Added line #L1345 was not covered by tests
ref = DatasetRef(parent_dataset_type, data_id, run="r")
a_ref = a_i.adapt_dataset_ref(ref)
b_ref = b_i.adapt_dataset_ref(ref)
Expand Down Expand Up @@ -1376,7 +1376,7 @@ def test_component_resolved_by_output(self) -> None:
b_i.adapt_dataset_type(parent_dataset_type),
parent_dataset_type.makeComponentDatasetType("schema"),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1379 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1379

Added line #L1379 was not covered by tests
ref = DatasetRef(parent_dataset_type, data_id, run="r")
a_ref = a_o.adapt_dataset_ref(ref)
b_ref = b_i.adapt_dataset_ref(ref)
Expand Down Expand Up @@ -1405,7 +1405,7 @@ def test_component_resolved_by_registry(self) -> None:
b_i.adapt_dataset_type(parent_dataset_type),
parent_dataset_type.makeComponentDatasetType("schema"),
)
data_id = DataCoordinate.makeEmpty(self.dimensions)
data_id = DataCoordinate.make_empty(self.dimensions)

Check warning on line 1408 in tests/test_pipeline_graph.py

View check run for this annotation

Codecov / codecov/patch

tests/test_pipeline_graph.py#L1408

Added line #L1408 was not covered by tests
ref = DatasetRef(parent_dataset_type, data_id, run="r")
b_ref = b_i.adapt_dataset_ref(ref)
self.assertEqual(b_ref, ref.makeComponentRef("schema"))
Expand Down
6 changes: 3 additions & 3 deletions tests/test_quantumGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _makeDatasetType(connection):
initRefs = [
DatasetRef(
initInputDSType,
DataCoordinate.makeEmpty(universe),
DataCoordinate.make_empty(universe),
run=self.input_collection,
)
]
Expand All @@ -229,7 +229,7 @@ def _makeDatasetType(connection):
if connections.initOutputs:
initOutputDSType = _makeDatasetType(connections.initOutput)
initRefs = [
DatasetRef(initOutputDSType, DataCoordinate.makeEmpty(universe), run=self.output_run)
DatasetRef(initOutputDSType, DataCoordinate.make_empty(universe), run=self.output_run)
]
init_dataset_refs[initOutputDSType] = initRefs[0]
initOutputs[taskDef] = initRefs
Expand Down Expand Up @@ -262,7 +262,7 @@ def _makeDatasetType(connection):
self.packagesDSType = DatasetType("packages", universe.empty, storageClass="Packages")
dataset_types.add(self.packagesDSType)
globalInitOutputs = [
DatasetRef(self.packagesDSType, DataCoordinate.makeEmpty(universe), run=self.output_run)
DatasetRef(self.packagesDSType, DataCoordinate.make_empty(universe), run=self.output_run)
]
self.qGraph = QuantumGraph(
quantumMap,
Expand Down

0 comments on commit 9f3e0d1

Please sign in to comment.