lsst-pipe-base 29.2025.2700__py3-none-any.whl → 29.2025.2900__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,6 +45,7 @@ __all__ = [
45
45
  import dataclasses
46
46
  import itertools
47
47
  import string
48
+ import uuid
48
49
  import warnings
49
50
  from collections import UserDict, defaultdict
50
51
  from collections.abc import Collection, Generator, Iterable, Iterator, Mapping, Sequence, Set
@@ -1271,6 +1272,52 @@ class QuantaAdjuster:
1271
1272
  for edge in self._task_node.iter_all_inputs()
1272
1273
  }
1273
1274
 
1275
+ def get_prerequisite_inputs(
1276
+ self,
1277
+ quantum_data_id: DataCoordinate,
1278
+ ) -> dict[str, dict[uuid.UUID, DataCoordinate]]:
1279
+ """Return the data IDs of all prerequisite inputs to a quantum.
1280
+
1281
+ Parameters
1282
+ ----------
1283
+ quantum_data_id : `~lsst.daf.butler.DataCoordinate`
1284
+ Data ID of the quantum to get the inputs of.
1285
+
1286
+ Returns
1287
+ -------
1288
+ inputs : `dict` [ `str`, \
1289
+ `dict` [ `uuid.UUID`, `~lsst.daf.butler.DataCoordinate` ] ]
1290
+ Dataset IDs and and data IDs of prerequisite inputs, keyed by the
1291
+ connection name (the internal task name, not the dataset type
1292
+ name). This only contains prerequisite inputs, not init-inputs or
1293
+ regular inputs.
1294
+
1295
+ Notes
1296
+ -----
1297
+ If two connections have the same dataset type, the current
1298
+ implementation assumes the set of datasets is the same for the two
1299
+ connections. This limitation may be removed in the future.
1300
+
1301
+ Unlike regular inputs, prerequisite inputs are not looked up from input
1302
+ collections or indexed by data ID. Instead, they are uniquely
1303
+ identified by dataset UUID and reused directly between quanta.
1304
+ """
1305
+ from .quantum_graph_skeleton import PrerequisiteDatasetKey, QuantumKey
1306
+
1307
+ by_dataset_type_name: defaultdict[str, dict[uuid.UUID, DataCoordinate]] = defaultdict(dict)
1308
+ quantum_key = QuantumKey(self._task_node.label, quantum_data_id.required_values)
1309
+
1310
+ for dataset_key in self._skeleton.iter_inputs_of(quantum_key):
1311
+ if not isinstance(dataset_key, PrerequisiteDatasetKey):
1312
+ continue
1313
+ by_dataset_type_name[dataset_key.parent_dataset_type_name][
1314
+ uuid.UUID(bytes=dataset_key.dataset_id_bytes)
1315
+ ] = self._skeleton.get_data_id(dataset_key)
1316
+ return {
1317
+ edge.connection_name: by_dataset_type_name[edge.parent_dataset_type_name]
1318
+ for edge in self._task_node.iter_all_inputs()
1319
+ }
1320
+
1274
1321
  def get_outputs(self, quantum_data_id: DataCoordinate) -> dict[str, list[DataCoordinate]]:
1275
1322
  """Return the data IDs of all regular outputs to a quantum.
1276
1323
 
@@ -1340,6 +1387,45 @@ class QuantaAdjuster:
1340
1387
  )
1341
1388
  self._skeleton.add_input_edge(quantum_key, dataset_key)
1342
1389
 
1390
+ def add_prerequisite_input(
1391
+ self, quantum_data_id: DataCoordinate, connection_name: str, dataset_uuid: uuid.UUID
1392
+ ) -> None:
1393
+ """Add a new prerequisite input to a quantum.
1394
+
1395
+ Parameters
1396
+ ----------
1397
+ quantum_data_id : `~lsst.daf.butler.DataCoordinate`
1398
+ Data ID of the quantum to add an input to.
1399
+ connection_name : `str`
1400
+ Name of the connection (the task-internal name, not the butler
1401
+ dataset type name).
1402
+ dataset_uuid : `uuid.UUID`
1403
+ UUID of the prerequisite input dataset. Must already exist in the
1404
+ graph as an input to a different quantum of this task, and must be
1405
+ a prerequisite input, not a regular input or init-input.
1406
+
1407
+ Notes
1408
+ -----
1409
+ If two connections have the same dataset type, the current
1410
+ implementation assumes the set of datasets is the same for the two
1411
+ connections. This limitation may be removed in the future.
1412
+
1413
+ Unlike regular inputs, prerequisite inputs are not looked up from input
1414
+ collections or indexed by data ID. Instead, they are uniquely
1415
+ identified by dataset UUID and reused directly between quanta.
1416
+ """
1417
+ from .quantum_graph_skeleton import PrerequisiteDatasetKey, QuantumKey
1418
+
1419
+ quantum_key = QuantumKey(self._task_node.label, quantum_data_id.required_values)
1420
+ read_edge = self._task_node.prerequisite_inputs[connection_name]
1421
+ dataset_key = PrerequisiteDatasetKey(read_edge.parent_dataset_type_name, dataset_uuid.bytes)
1422
+ if dataset_key not in self._skeleton:
1423
+ raise LookupError(
1424
+ f"Prerequisite Dataset {read_edge.parent_dataset_type_name}@{dataset_uuid} "
1425
+ "is not already in the graph."
1426
+ )
1427
+ self._skeleton.add_input_edge(quantum_key, dataset_key)
1428
+
1343
1429
  def move_output(
1344
1430
  self, quantum_data_id: DataCoordinate, connection_name: str, dataset_data_id: DataCoordinate
1345
1431
  ) -> None:
@@ -353,6 +353,8 @@ class PrerequisiteFinder:
353
353
  where=" AND ".join(where_terms),
354
354
  bind=bind,
355
355
  with_dimension_records=True,
356
+ limit=None,
357
+ explain=False,
356
358
  )
357
359
  except MissingDatasetTypeError:
358
360
  return []
@@ -383,6 +385,8 @@ class PrerequisiteFinder:
383
385
  collections=input_collections,
384
386
  data_id=data_id,
385
387
  with_dimension_records=True,
388
+ limit=None,
389
+ explain=False,
386
390
  )
387
391
  except MissingDatasetTypeError:
388
392
  return []
@@ -351,7 +351,7 @@ class QuantumGraphSkeleton:
351
351
  key = DatasetKey(parent_dataset_type_name, data_id.required_values)
352
352
  self._xgraph.add_node(key, data_id=data_id, **attrs)
353
353
  if is_global_init_output:
354
- assert isinstance(key, DatasetKey)
354
+ assert isinstance(key, DatasetKey), str(key)
355
355
  self._global_init_outputs.add(key)
356
356
  return key
357
357
 
@@ -448,7 +448,7 @@ class QuantumGraphSkeleton:
448
448
 
449
449
  Dataset nodes that are not already present will be created.
450
450
  """
451
- assert task_key in self._xgraph
451
+ assert task_key in self._xgraph, str(task_key)
452
452
  self._xgraph.add_edges_from((dataset_key, task_key) for dataset_key in dataset_keys)
453
453
 
454
454
  def remove_input_edges(
@@ -513,8 +513,8 @@ class QuantumGraphSkeleton:
513
513
  Identifier for the dataset node. Must identify a node already
514
514
  present in the graph.
515
515
  """
516
- assert task_key in self._xgraph
517
- assert dataset_key in self._xgraph
516
+ assert task_key in self._xgraph, str(task_key)
517
+ assert dataset_key in self._xgraph, str(dataset_key)
518
518
  self._xgraph.add_edge(task_key, dataset_key)
519
519
 
520
520
  def remove_output_edge(self, dataset_key: DatasetKey) -> None:
@@ -528,7 +528,7 @@ class QuantumGraphSkeleton:
528
528
  present in the graph.
529
529
  """
530
530
  (task_key,) = self._xgraph.predecessors(dataset_key)
531
- assert dataset_key in self._xgraph
531
+ assert dataset_key in self._xgraph, str(dataset_key)
532
532
  self._xgraph.remove_edge(task_key, dataset_key)
533
533
 
534
534
  def remove_orphan_datasets(self) -> None:
@@ -140,6 +140,22 @@ class _DataIdMatchTreeVisitor(TreeVisitor):
140
140
  # docstring is inherited from base class
141
141
  raise NotImplementedError()
142
142
 
143
+ def visitCircleNode(self, ra: Any, dec: Any, radius: Any, node: Node) -> Any:
144
+ # docstring is inherited from base class
145
+ raise NotImplementedError()
146
+
147
+ def visitBoxNode(self, ra: Any, dec: Any, width: Any, height: Any, node: Node) -> Any:
148
+ # docstring is inherited from base class
149
+ raise NotImplementedError()
150
+
151
+ def visitPolygonNode(self, vertices: list[tuple[Any, Any]], node: Node) -> Any:
152
+ # docstring is inherited from base class
153
+ raise NotImplementedError()
154
+
155
+ def visitRegionNode(self, pos: Any, node: Node) -> Any:
156
+ # docstring is inherited from base class
157
+ raise NotImplementedError()
158
+
143
159
  def visitGlobNode(self, expression: Any, pattern: Any, node: Node) -> Any:
144
160
  # docstring is inherited from base class
145
161
  raise NotImplementedError()
lsst/pipe/base/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.2700"
2
+ __version__ = "29.2025.2900"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-pipe-base
3
- Version: 29.2025.2700
3
+ Version: 29.2025.2900
4
4
  Summary: Pipeline infrastructure for the Rubin Science Pipelines.
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: BSD 3-Clause License
@@ -8,13 +8,13 @@ lsst/pipe/base/_observation_dimension_packer.py,sha256=78Jg2OVFOdXIK62TS2Y3X4095
8
8
  lsst/pipe/base/_quantumContext.py,sha256=gb60mTHbgOIEptYvJ64SaChvViXyeKJlG6kEHq4nYVw,19345
9
9
  lsst/pipe/base/_status.py,sha256=tvKm-z_haZGksOR4nQ-ePJgbLag-e3t4nQY47yLFP2M,15741
10
10
  lsst/pipe/base/_task_metadata.py,sha256=wKZJWWLBByaUMx0253Dre2P241mSM1U0CCywcZmoF4k,24978
11
- lsst/pipe/base/all_dimensions_quantum_graph_builder.py,sha256=YCgDh-P1HxgS2zH2fP57uYCCZGI9DxBLIcXihnc-czQ,45758
11
+ lsst/pipe/base/all_dimensions_quantum_graph_builder.py,sha256=sXE87X0ZfsOm9Kqs7tK5ZIDOZuAS6YN38LHzVuR5hpM,72620
12
12
  lsst/pipe/base/automatic_connection_constants.py,sha256=H5uuh1rYRpjndgPdb0dh1L_-OyLKdT6VWOZTAb__xCU,3298
13
13
  lsst/pipe/base/caching_limited_butler.py,sha256=u1uJYzCE7OxW8MW8Xv2LDB9-Nuj-Ao8lBJcDttKrc1Y,7700
14
14
  lsst/pipe/base/config.py,sha256=yNipVEc6awwhU_O9I01g20OnvQrs28dAwkXuI1hrlYE,11982
15
15
  lsst/pipe/base/configOverrides.py,sha256=B0An8EaX76VzWnC5dJxvyZ2AhVzawMtq7qlE9ma5lkc,14661
16
16
  lsst/pipe/base/connectionTypes.py,sha256=5QbyL7MAikohjXimXbmtPWryjLCZZXlS_vPzIWy5mzI,16708
17
- lsst/pipe/base/connections.py,sha256=248r_HT3mNDPrJzTviq3dp3zGKdfUchSPWZRupKAkV0,62795
17
+ lsst/pipe/base/connections.py,sha256=_tr_9RWs-LWetDW1tJX3ZROE5ZqvlLdIRStnz_11J5U,66707
18
18
  lsst/pipe/base/dot_tools.py,sha256=o_bDp9vW-4PelE7kWodH6pWVIRuyGlTRFv-kR_YKfLo,13824
19
19
  lsst/pipe/base/executionButlerBuilder.py,sha256=-vv-1aGm06RM4fJECjvJL0ZXHrwth7Hjt0jIfkKYY18,21254
20
20
  lsst/pipe/base/execution_reports.py,sha256=jYtWCD4PkEAeVUpKIxuiJJVgsCm7qiwCorWVgNHkVgU,17270
@@ -22,17 +22,17 @@ lsst/pipe/base/mermaid_tools.py,sha256=b_15oqCcxSom4ecMTDX8tfEtxe8W-juPVL65HOMyw
22
22
  lsst/pipe/base/pipeline.py,sha256=FVaiLhgw9Pzo-nzXKS0dLNafegP0AMZKLtPlSvOSkRU,37563
23
23
  lsst/pipe/base/pipelineIR.py,sha256=DDOAYHnMP-iw021RDMYsZnvb21tWumLjYqO5d38q_Zk,44300
24
24
  lsst/pipe/base/pipelineTask.py,sha256=K3GdjJLvy8A7I-jzQiERQZaYF7mC1LM3iB5TmUtbOCI,8394
25
- lsst/pipe/base/prerequisite_helpers.py,sha256=WxfIGkF0Wlucp9mE3Wp3E6K2M6d66O0oZrWecRqn5CI,28312
25
+ lsst/pipe/base/prerequisite_helpers.py,sha256=bmiebQ4veSrypZgAXjmCBFfj8fUtPW9eRQaVShhxdBQ,28446
26
26
  lsst/pipe/base/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  lsst/pipe/base/quantum_graph_builder.py,sha256=ugTOV5Qe6iWlaX9Zm1HoNWfnFFhohSmIrSFkCFUVOZM,54808
28
- lsst/pipe/base/quantum_graph_skeleton.py,sha256=02LhoasjEIO2-r3Ec79qh1eRdd74BU6CdrWqwAHtqJ8,24888
28
+ lsst/pipe/base/quantum_graph_skeleton.py,sha256=iBSVCAV1OznYd70Lg4bLn0nMqjW5m9-kH5eecPn8DYw,24964
29
29
  lsst/pipe/base/quantum_provenance_graph.py,sha256=llXcqu-50dtjkt_sVqAhBU10htfkxMiiArNN0_GqL1g,93034
30
30
  lsst/pipe/base/struct.py,sha256=Fa-UkpuXOxdzKWbHrMUkJYOszZuBXCm2NesXNR0IOPQ,5048
31
31
  lsst/pipe/base/task.py,sha256=XHBd-7m1a4-6LgobBYA1DgY4H7EV-_RWKfxbhZbMmD4,15145
32
32
  lsst/pipe/base/taskFactory.py,sha256=4GhN2DozPM8suBYIvoKN4E6VP0I3mYZHBjCUO5JcCGk,2901
33
33
  lsst/pipe/base/testUtils.py,sha256=lSBKMhoKflbi8JkMNYfEqqHNl-rtFI8UYT3QneDYpLo,18477
34
34
  lsst/pipe/base/utils.py,sha256=JmEt3l0xrh9uayKrSXuQEq12aXOhDr2YXmbYduaxCko,1940
35
- lsst/pipe/base/version.py,sha256=ijvsqTn7akfUc9cY8XFVpeeoU8nGM3T0Tr7idt4aIaw,55
35
+ lsst/pipe/base/version.py,sha256=BkpxVcOPL9P6Qn_EFUUQAdB03ij-q8vMFePg6-6B224,55
36
36
  lsst/pipe/base/cli/__init__.py,sha256=861tXIAW7SqtqNUYkjbeEdfg8lDswXsjJQca0gVCFz4,54
37
37
  lsst/pipe/base/cli/_get_cli_subcommands.py,sha256=g_af64klRybBGKAg7fmBSZBdw2LYBAsFON_yQIMZON0,1289
38
38
  lsst/pipe/base/cli/cmd/__init__.py,sha256=BGicstnryQ48rYcNRh4fa6Vy63ZIlZ_pPAEa17jhkwY,1519
@@ -83,16 +83,16 @@ lsst/pipe/base/tests/pipelineStepTester.py,sha256=KGxdB8gdVpSey2RUGURDIzIfPL-4qv
83
83
  lsst/pipe/base/tests/simpleQGraph.py,sha256=G9C69caX8479JR9h48ERhOFvLTPJCoj5gKf_eRoaALQ,19660
84
84
  lsst/pipe/base/tests/util.py,sha256=eWuIRz55HYgNmMkexinN9HjUFmPC3uapO8jMjcQY-ao,4010
85
85
  lsst/pipe/base/tests/mocks/__init__.py,sha256=NrIJYDeYgR3HsOJXBEXi8EXDhhV7iw7dgwK9qlQ59PA,1551
86
- lsst/pipe/base/tests/mocks/_data_id_match.py,sha256=WU0-5cPsU4565UhlsvQwhZKP5RzPJPyZ8sGio1CKAPI,6813
86
+ lsst/pipe/base/tests/mocks/_data_id_match.py,sha256=v33QZhZm-srXZAXZ8NbNKGN-_ql4AzaArBUk1lxhyss,7474
87
87
  lsst/pipe/base/tests/mocks/_pipeline_task.py,sha256=fqaJ-tB7K3jxlfCvCSnVd_GNrz-JhX7FB914h7nHLXc,29366
88
88
  lsst/pipe/base/tests/mocks/_storage_class.py,sha256=gC0czHURMk7PWj8N6dLxnY5V4HWX5i8ukb5SZbgWKy8,25257
89
- lsst_pipe_base-29.2025.2700.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
90
- lsst_pipe_base-29.2025.2700.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
91
- lsst_pipe_base-29.2025.2700.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
92
- lsst_pipe_base-29.2025.2700.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
93
- lsst_pipe_base-29.2025.2700.dist-info/METADATA,sha256=QrlYDFp0W1-8CEpO0DmmdXYDSvNQ1ioYpXbpHoDxt_M,2195
94
- lsst_pipe_base-29.2025.2700.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
- lsst_pipe_base-29.2025.2700.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
96
- lsst_pipe_base-29.2025.2700.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
97
- lsst_pipe_base-29.2025.2700.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
98
- lsst_pipe_base-29.2025.2700.dist-info/RECORD,,
89
+ lsst_pipe_base-29.2025.2900.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
90
+ lsst_pipe_base-29.2025.2900.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
91
+ lsst_pipe_base-29.2025.2900.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
92
+ lsst_pipe_base-29.2025.2900.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
93
+ lsst_pipe_base-29.2025.2900.dist-info/METADATA,sha256=0x-2fKPnTuJeCbcnZ_pi91bxzF1rbMXSmhOObDh90Sw,2195
94
+ lsst_pipe_base-29.2025.2900.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
+ lsst_pipe_base-29.2025.2900.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
96
+ lsst_pipe_base-29.2025.2900.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
97
+ lsst_pipe_base-29.2025.2900.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
98
+ lsst_pipe_base-29.2025.2900.dist-info/RECORD,,