lsst-pipe-base 29.2025.2800__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 []
lsst/pipe/base/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.2800"
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.2800
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
@@ -14,7 +14,7 @@ lsst/pipe/base/caching_limited_butler.py,sha256=u1uJYzCE7OxW8MW8Xv2LDB9-Nuj-Ao8l
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,7 +22,7 @@ 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
28
  lsst/pipe/base/quantum_graph_skeleton.py,sha256=iBSVCAV1OznYd70Lg4bLn0nMqjW5m9-kH5eecPn8DYw,24964
@@ -32,7 +32,7 @@ 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=zkbtcIsz6tbu7rmamcut51DoG62vyYwam95urGw5Lis,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
@@ -86,13 +86,13 @@ lsst/pipe/base/tests/mocks/__init__.py,sha256=NrIJYDeYgR3HsOJXBEXi8EXDhhV7iw7dgw
86
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.2800.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
90
- lsst_pipe_base-29.2025.2800.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
91
- lsst_pipe_base-29.2025.2800.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
92
- lsst_pipe_base-29.2025.2800.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
93
- lsst_pipe_base-29.2025.2800.dist-info/METADATA,sha256=rpezbW4ETyiwGgw7ttMrlVru-eZA_KG-Xax1jGXA5lE,2195
94
- lsst_pipe_base-29.2025.2800.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
- lsst_pipe_base-29.2025.2800.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
96
- lsst_pipe_base-29.2025.2800.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
97
- lsst_pipe_base-29.2025.2800.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
98
- lsst_pipe_base-29.2025.2800.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,,