lsst-pipe-base 29.2025.2900__py3-none-any.whl → 29.2025.3000__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.
@@ -29,8 +29,7 @@ __all__ = ["transfer_from_graph"]
29
29
 
30
30
  import math
31
31
 
32
- from lsst.daf.butler import Butler, CollectionType, QuantumBackedButler, Registry
33
- from lsst.daf.butler.registry import MissingCollectionError
32
+ from lsst.daf.butler import Butler, CollectionType, MissingCollectionError, QuantumBackedButler
34
33
  from lsst.pipe.base import QuantumGraph
35
34
  from lsst.utils.iteration import chunk_iterable
36
35
  from lsst.utils.logging import getLogger
@@ -124,45 +123,55 @@ def transfer_from_graph(
124
123
  )
125
124
  count += len(transferred)
126
125
 
127
- # If anything was transferred then update output chain definition if asked.
128
- if count > 0 and update_output_chain and (metadata := qgraph.metadata) is not None:
126
+ # If asked to do so, update output chain definition.
127
+ if update_output_chain and (metadata := qgraph.metadata) is not None:
129
128
  # These are defined in CmdLineFwk.
130
129
  output_run = metadata.get("output_run")
131
130
  output = metadata.get("output")
132
131
  input = metadata.get("input")
133
132
  if output_run is not None and output is not None:
134
- _update_chain(dest_butler.registry, output, output_run, input)
133
+ _update_chain(dest_butler, output, output_run, input)
135
134
 
136
135
  return count
137
136
 
138
137
 
139
- def _update_chain(registry: Registry, output_chain: str, output_run: str, inputs: list[str] | None) -> None:
138
+ def _update_chain(butler: Butler, output_chain: str, output_run: str, inputs: list[str] | None) -> None:
140
139
  """Update chain definition if it exists to include run as the first item
141
140
  in a chain. If it does not exist then create it to include all inputs and
142
141
  output.
142
+
143
+ Parameters
144
+ ----------
145
+ butler : `lsst.daf.butler.Butler`
146
+ Butler where to update the collection chain.
147
+ output_chain : `str`
148
+ Name of the output CHAINED collection.
149
+ output_run : `str`
150
+ Name of the output RUN collection.
151
+ inputs : `list` [`str`] | None
152
+ All the input collections to be included in the chain if the
153
+ chain is created.
143
154
  """
155
+ # Do not need to update chain if output_run does not already exist.
144
156
  try:
145
- # If output_chain is not a chain the exception will be raised.
146
- chain_definition = list(registry.getCollectionChain(output_chain))
157
+ _ = butler.collections.get_info(output_run)
147
158
  except MissingCollectionError:
148
- # We have to create chained collection to include inputs and output run
149
- # (this reproduces logic in CmdLineFwk).
150
- registry.registerCollection(output_chain, type=CollectionType.CHAINED)
151
- chain_definition = list(registry.queryCollections(inputs, flattenChains=True)) if inputs else []
152
- chain_definition = [output_run] + [run for run in chain_definition if run != output_run]
153
- registry.setCollectionChain(output_chain, chain_definition)
154
- else:
155
- # If run is in the chain but not the first item then remove it, will
156
- # re-insert at front below.
157
- try:
158
- index = chain_definition.index(output_run)
159
- if index == 0:
160
- # It is already at the top.
161
- return
162
- else:
163
- del chain_definition[index]
164
- except ValueError:
165
- pass
166
-
167
- chain_definition.insert(0, output_run)
168
- registry.setCollectionChain(output_chain, chain_definition)
159
+ _LOG.verbose(
160
+ "Output RUN collection (%s) does not exist. Skipping updating the output chain.",
161
+ output_run,
162
+ )
163
+ return
164
+
165
+ # Make chain collection if doesn't exist before calling prepend_chain.
166
+ created_now = butler.collections.register(output_chain, CollectionType.CHAINED)
167
+ if created_now:
168
+ _LOG.verbose("Registered chain collection: %s", output_chain)
169
+ if inputs:
170
+ # Add input collections to chain collection just made. Using
171
+ # extend instead of prepend in case of race condition where another
172
+ # execution adds a run before this adds the inputs to the chain.
173
+ butler.collections.extend_chain(output_chain, inputs)
174
+ _LOG.verbose(
175
+ "Prepending output chain collection (%s) with output RUN collection (%s)", output_chain, output_run
176
+ )
177
+ butler.collections.prepend_chain(output_chain, output_run)
lsst/pipe/base/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.2900"
2
+ __version__ = "29.2025.3000"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-pipe-base
3
- Version: 29.2025.2900
3
+ Version: 29.2025.3000
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
@@ -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=BkpxVcOPL9P6Qn_EFUUQAdB03ij-q8vMFePg6-6B224,55
35
+ lsst/pipe/base/version.py,sha256=GKnpddvvmGJ8yPsnT--mhT32jeA31BaGZsJcw6cTK7k,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
@@ -74,7 +74,7 @@ lsst/pipe/base/pipeline_graph/visualization/_status_annotator.py,sha256=dp7PXl9C
74
74
  lsst/pipe/base/script/__init__.py,sha256=cLEXE7aq5UZ0juL_ScmRw0weFgp4tDgwEX_ts-NEYic,1522
75
75
  lsst/pipe/base/script/register_instrument.py,sha256=TRC2r2tSoYBNWNVQya01ELxAtGH8WVk9Ya-uNgCIL5U,2426
76
76
  lsst/pipe/base/script/retrieve_artifacts_for_quanta.py,sha256=pYI0wNl5PU8ImgzWfGEDrRz3PSKSg2szWLEIVKdm7Og,3939
77
- lsst/pipe/base/script/transfer_from_graph.py,sha256=WMpmzaN8hdW4FoZPNL6LRiPW9gvxf9mw20Z1i-KCkWI,6740
77
+ lsst/pipe/base/script/transfer_from_graph.py,sha256=_7zuKf6NdeIzXafkOAFwdkx2zM1H-2uXJSi676WaSdM,6954
78
78
  lsst/pipe/base/script/utils.py,sha256=zNqpHG3kXA8OaNXnwYIo0Hu_LCie1qoBAARAME3WEjs,3739
79
79
  lsst/pipe/base/script/zip_from_graph.py,sha256=rbH_5Jk7Yc-YFD3X4mbDE4Vzddtu5y90Z77wha94mdM,3228
80
80
  lsst/pipe/base/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.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,,
89
+ lsst_pipe_base-29.2025.3000.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
90
+ lsst_pipe_base-29.2025.3000.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
91
+ lsst_pipe_base-29.2025.3000.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
92
+ lsst_pipe_base-29.2025.3000.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
93
+ lsst_pipe_base-29.2025.3000.dist-info/METADATA,sha256=ErHeFechV8GyMQBh9Se8mLflvi9VDImXeOt5AAUhHt4,2195
94
+ lsst_pipe_base-29.2025.3000.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
+ lsst_pipe_base-29.2025.3000.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
96
+ lsst_pipe_base-29.2025.3000.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
97
+ lsst_pipe_base-29.2025.3000.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
98
+ lsst_pipe_base-29.2025.3000.dist-info/RECORD,,