lsst-pipe-base 29.2025.4300__py3-none-any.whl → 29.2025.4500__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,7 +45,7 @@ import warnings
45
45
  from collections import Counter
46
46
  from collections.abc import Generator, Hashable, Iterable, MutableMapping
47
47
  from dataclasses import dataclass, field
48
- from typing import Any, Literal
48
+ from typing import Any, Literal, cast
49
49
 
50
50
  import yaml
51
51
 
@@ -461,6 +461,8 @@ class ImportIR:
461
461
  """list of tasks that should be excluded when inheriting this pipeline.
462
462
  Either the include or exclude attributes may be specified, but not both.
463
463
  """
464
+ rename: dict[str, str] = field(default_factory=dict)
465
+ """dict of tasks to rename, keyed by old name with new name value."""
464
466
  importContracts: bool = True
465
467
  """Boolean attribute to dictate if contracts should be inherited with the
466
468
  pipeline or not.
@@ -497,18 +499,49 @@ class ImportIR:
497
499
  "An include list and an exclude list cannot both be specified"
498
500
  " when declaring a pipeline import."
499
501
  )
502
+ if rename_keys := self.rename.keys():
503
+ rename_values_set = set(self.rename.values())
504
+ if len(rename_values_set) != len(rename_keys):
505
+ raise ValueError(f"rename {rename_keys=} must not have duplicates")
506
+ if rename_values_set.intersection(rename_keys):
507
+ raise ValueError(
508
+ f"rename keys={rename_keys} must not intersect with values={self.rename.values()}"
509
+ )
510
+
500
511
  tmp_pipeline = PipelineIR.from_uri(os.path.expandvars(self.location))
501
512
  if self.instrument is not _Tags.KeepInstrument:
502
513
  tmp_pipeline.instrument = self.instrument
503
514
 
504
515
  included_labels = set()
516
+ renamed_tasks = {}
505
517
  for label in tmp_pipeline.tasks:
518
+ is_included = self.include and label in self.include
506
519
  if (
507
- (self.include and label in self.include)
520
+ is_included
508
521
  or (self.exclude and label not in self.exclude)
509
522
  or (self.include is None and self.exclude is None)
510
523
  ):
511
- included_labels.add(label)
524
+ if (label_new := self.rename.get(label)) is not None:
525
+ renamed_tasks[label] = label_new
526
+ if is_included:
527
+ self.include = [
528
+ label_new if (x == label) else label for x in cast(list[str], self.include)
529
+ ]
530
+ else:
531
+ label_new = label
532
+ included_labels.add(label_new)
533
+
534
+ rename_errors = []
535
+ for label, label_new in renamed_tasks.items():
536
+ if label_new in tmp_pipeline.tasks:
537
+ rename_errors.append(f"Can't rename {label=} to existing {label_new=}")
538
+ else:
539
+ task = tmp_pipeline.tasks.pop(label)
540
+ task.label = label_new
541
+ tmp_pipeline.tasks[label_new] = task
542
+
543
+ if rename_errors:
544
+ raise ValueError("; ".join(rename_errors))
512
545
 
513
546
  # Handle labeled subsets being specified in the include or exclude
514
547
  # list, adding or removing labels.
lsst/pipe/base/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.4300"
2
+ __version__ = "29.2025.4500"
@@ -1,18 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-pipe-base
3
- Version: 29.2025.4300
3
+ Version: 29.2025.4500
4
4
  Summary: Pipeline infrastructure for the Rubin Science Pipelines.
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
- License: BSD 3-Clause License
6
+ License-Expression: BSD-3-Clause OR GPL-3.0-or-later
7
7
  Project-URL: Homepage, https://github.com/lsst/pipe_base
8
8
  Keywords: lsst
9
9
  Classifier: Intended Audience :: Science/Research
10
- Classifier: License :: OSI Approved :: BSD License
11
10
  Classifier: Operating System :: OS Independent
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  Classifier: Programming Language :: Python :: 3.11
14
13
  Classifier: Programming Language :: Python :: 3.12
15
14
  Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
16
  Classifier: Topic :: Scientific/Engineering :: Astronomy
17
17
  Requires-Python: >=3.11.0
18
18
  Description-Content-Type: text/markdown
@@ -24,7 +24,7 @@ lsst/pipe/base/log_capture.py,sha256=LylLrxPJyMxU90uSQ15PqFhObDSLWQWGKX6NuXOuwXA
24
24
  lsst/pipe/base/mermaid_tools.py,sha256=cdlDJQ1x8k7-VvCLEUqvSC3GR1zCsB-aUTxOjYejNWc,5216
25
25
  lsst/pipe/base/mp_graph_executor.py,sha256=FKlFxjtU2-6SFzX_wsdtMMAj5P09ZE8V65-Sg585g2Y,35501
26
26
  lsst/pipe/base/pipeline.py,sha256=FVaiLhgw9Pzo-nzXKS0dLNafegP0AMZKLtPlSvOSkRU,37563
27
- lsst/pipe/base/pipelineIR.py,sha256=DDOAYHnMP-iw021RDMYsZnvb21tWumLjYqO5d38q_Zk,44300
27
+ lsst/pipe/base/pipelineIR.py,sha256=UuZ02NLhVmzzekbuWlyar7cPLCf_4yfzD5qFEmGHs_A,45821
28
28
  lsst/pipe/base/pipelineTask.py,sha256=K3GdjJLvy8A7I-jzQiERQZaYF7mC1LM3iB5TmUtbOCI,8394
29
29
  lsst/pipe/base/prerequisite_helpers.py,sha256=bmiebQ4veSrypZgAXjmCBFfj8fUtPW9eRQaVShhxdBQ,28446
30
30
  lsst/pipe/base/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -42,7 +42,7 @@ lsst/pipe/base/task.py,sha256=XHBd-7m1a4-6LgobBYA1DgY4H7EV-_RWKfxbhZbMmD4,15145
42
42
  lsst/pipe/base/taskFactory.py,sha256=MsDGECJqZLSZk8SGhpuVhNaP32UWuNvxZiDcZExPFG8,3412
43
43
  lsst/pipe/base/testUtils.py,sha256=lSBKMhoKflbi8JkMNYfEqqHNl-rtFI8UYT3QneDYpLo,18477
44
44
  lsst/pipe/base/utils.py,sha256=JmEt3l0xrh9uayKrSXuQEq12aXOhDr2YXmbYduaxCko,1940
45
- lsst/pipe/base/version.py,sha256=pmH-QwBOGm7hpNEwNmgwgFuJ9J8NNZQ81N3RGqBJ3YU,55
45
+ lsst/pipe/base/version.py,sha256=ec8d6sw9aRuINU5Qs4LjOV9LhqSISytoOfEoRYO2XzU,55
46
46
  lsst/pipe/base/cli/__init__.py,sha256=861tXIAW7SqtqNUYkjbeEdfg8lDswXsjJQca0gVCFz4,54
47
47
  lsst/pipe/base/cli/_get_cli_subcommands.py,sha256=g_af64klRybBGKAg7fmBSZBdw2LYBAsFON_yQIMZON0,1289
48
48
  lsst/pipe/base/cli/cmd/__init__.py,sha256=3UF2IQEEBor4YMGRNPdcZAVCAI5yFyeHp5nGul4IoyM,1557
@@ -113,13 +113,13 @@ lsst/pipe/base/tests/mocks/_data_id_match.py,sha256=v33QZhZm-srXZAXZ8NbNKGN-_ql4
113
113
  lsst/pipe/base/tests/mocks/_pipeline_task.py,sha256=_n16lDsk3ItWi2J28Qheuqphr4aaCK6CN9acmJ1hAqI,30692
114
114
  lsst/pipe/base/tests/mocks/_repo.py,sha256=OTJw_fi37w7bkZbbLa7z51W-45zxySAnLbV7Qv_aSB4,27423
115
115
  lsst/pipe/base/tests/mocks/_storage_class.py,sha256=12IFfJMbZ5GkYlMX6ZMWiG8pMZc2Jlxke3qQW-bljdU,27434
116
- lsst_pipe_base-29.2025.4300.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
117
- lsst_pipe_base-29.2025.4300.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
118
- lsst_pipe_base-29.2025.4300.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
119
- lsst_pipe_base-29.2025.4300.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
120
- lsst_pipe_base-29.2025.4300.dist-info/METADATA,sha256=XdNNWTqV2W6-kCxqRwWfvKkrCbmaO-qFlavCmaRUJwM,2234
121
- lsst_pipe_base-29.2025.4300.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
122
- lsst_pipe_base-29.2025.4300.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
123
- lsst_pipe_base-29.2025.4300.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
124
- lsst_pipe_base-29.2025.4300.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
125
- lsst_pipe_base-29.2025.4300.dist-info/RECORD,,
116
+ lsst_pipe_base-29.2025.4500.dist-info/licenses/COPYRIGHT,sha256=kB3Z9_f6a6uFLGpEmNJT_n186CE65H6wHu4F6BNt_zA,368
117
+ lsst_pipe_base-29.2025.4500.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
118
+ lsst_pipe_base-29.2025.4500.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
119
+ lsst_pipe_base-29.2025.4500.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
120
+ lsst_pipe_base-29.2025.4500.dist-info/METADATA,sha256=BHl-Qpb1hJmoF9KL7Hio_E2xmHzaSwKbl6RI5lolrA4,2257
121
+ lsst_pipe_base-29.2025.4500.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
122
+ lsst_pipe_base-29.2025.4500.dist-info/entry_points.txt,sha256=bnmUhJBsChxMdqST9VmFBYYKxLQoToOfqW1wjW7khjk,64
123
+ lsst_pipe_base-29.2025.4500.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
124
+ lsst_pipe_base-29.2025.4500.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
125
+ lsst_pipe_base-29.2025.4500.dist-info/RECORD,,