lsst-daf-butler 29.2025.2800__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.
@@ -427,11 +427,13 @@ class DefaultCollectionManager(CollectionManager[K]):
427
427
  cache: CollectionRecordCache | None = None
428
428
  result: list[CollectionRecord[K]] = []
429
429
  done_keys: set[K] = set()
430
+ explicit_names = list(wildcard.strings)
430
431
  if wildcard.patterns:
431
- if wildcard.strings:
432
+ if explicit_names or flatten_chains:
432
433
  # To be efficient in case both patterns and strings are
433
434
  # specified we want to have caching enabled for at least the
434
- # duration of this call.
435
+ # duration of this call. Chains flattening can also produce
436
+ # additional names to look for.
435
437
  cache = self._caching_context.collection_records or CollectionRecordCache()
436
438
  all_records = self._fetch_all(cache)
437
439
  for record in filter_types(all_records):
@@ -439,11 +441,17 @@ class DefaultCollectionManager(CollectionManager[K]):
439
441
  if any(p.fullmatch(record.name) for p in wildcard.patterns):
440
442
  result.append(record)
441
443
  done_keys.add(record.key)
442
-
443
- if wildcard.strings:
444
+ if flatten_chains:
445
+ # If flattening include children names of all matching chains.
446
+ for record in all_records:
447
+ if isinstance(record, ChainedCollectionRecord):
448
+ if any(p.fullmatch(record.name) for p in wildcard.patterns):
449
+ explicit_names.extend(record.children)
450
+
451
+ if explicit_names:
444
452
  # _find_many() returns correctly ordered records, but there may be
445
453
  # duplicates.
446
- for record in filter_types(self._find_many(wildcard.strings, flatten_chains, cache)):
454
+ for record in filter_types(self._find_many(explicit_names, flatten_chains, cache)):
447
455
  if record.key not in done_keys:
448
456
  result.append(record)
449
457
  done_keys.add(record.key)
@@ -561,8 +561,6 @@ class Database(ABC):
561
561
  try:
562
562
  yield table
563
563
  finally:
564
- with self._transaction():
565
- table.drop(connection)
566
564
  self._temp_tables.remove(table.key)
567
565
  self._metadata.remove_table(table.name)
568
566
 
@@ -838,9 +838,13 @@ class RegistryTests(ABC):
838
838
  # Chained collection exists, but has no collections in it.
839
839
  self.assertFalse(registry.getCollectionChain(chain1))
840
840
  # If we query for all collections, we should get the chained collection
841
- # only if we don't ask to flatten it (i.e. yield only its children).
841
+ # if we don't ask to flatten it (i.e. yield only its children) or if we
842
+ # explicitly ask to include it too.
842
843
  self.assertEqual(set(registry.queryCollections(flattenChains=False)), {tag1, run1, run2, chain1})
843
844
  self.assertEqual(set(registry.queryCollections(flattenChains=True)), {tag1, run1, run2})
845
+ self.assertEqual(
846
+ set(registry.queryCollections(flattenChains=True, includeChains=True)), {tag1, run1, run2, chain1}
847
+ )
844
848
  # Attempt to set its child collections to something circular; that
845
849
  # should fail.
846
850
  with self.assertRaises(ValueError):
@@ -904,6 +908,26 @@ class RegistryTests(ABC):
904
908
  list(registry.queryCollections(["imported_*", "chain1"], flattenChains=False)),
905
909
  ["imported_r", "imported_g", "chain1"],
906
910
  )
911
+ # Query for collection matching chain names, by flattening it should
912
+ # only return non-chain names.
913
+ self.assertCountEqual(list(registry.queryCollections("chain?", flattenChains=True)), [tag1, run2])
914
+ # Query for collection matching chain name, by flattening and
915
+ # asking to include chains it should return everything.
916
+ self.assertCountEqual(
917
+ list(registry.queryCollections("chain*", flattenChains=True, includeChains=True)),
918
+ [tag1, run2, chain1, chain2],
919
+ )
920
+ # Order of children in chained collections is preserved.
921
+ self.assertEqual(list(registry.queryCollections("chain1", flattenChains=True)), [tag1, run2])
922
+ self.assertEqual(list(registry.queryCollections("cha*2", flattenChains=True)), [run2, tag1])
923
+ self.assertEqual(
924
+ list(registry.queryCollections("chain1", flattenChains=True, includeChains=True)),
925
+ [chain1, tag1, run2],
926
+ )
927
+ self.assertEqual(
928
+ list(registry.queryCollections("chain2", flattenChains=True, includeChains=True)),
929
+ [chain2, run2, chain1, tag1],
930
+ )
907
931
 
908
932
  # Search for bias with dataId1 should find it via tag1 in chain2,
909
933
  # recursing, because is not in run1.
@@ -1,2 +1,2 @@
1
1
  __all__ = ["__version__"]
2
- __version__ = "29.2025.2800"
2
+ __version__ = "29.2025.3000"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lsst-daf-butler
3
- Version: 29.2025.2800
3
+ Version: 29.2025.3000
4
4
  Summary: An abstraction layer for reading and writing astronomical data to datastores.
5
5
  Author-email: Rubin Observatory Data Management <dm-admin@lists.lsst.org>
6
6
  License: BSD 3-Clause License
@@ -52,7 +52,7 @@ lsst/daf/butler/repo_relocation.py,sha256=Ivhx2xU4slc53Z6RExhNnquMr2Hx-S8h62emml
52
52
  lsst/daf/butler/time_utils.py,sha256=MVTfOFI2xt3IeA46pa-fWY2kJRwSzaQyq1uzeUABcTM,11805
53
53
  lsst/daf/butler/timespan_database_representation.py,sha256=MWDusjIQIL2RH1CDpWSW5sYvdHCJKzAfpg1rm1DfgEU,24302
54
54
  lsst/daf/butler/utils.py,sha256=5u50COK5z4u31grOhmQF7mFz55biNLOvSMRdQjEdsjo,5140
55
- lsst/daf/butler/version.py,sha256=zkbtcIsz6tbu7rmamcut51DoG62vyYwam95urGw5Lis,55
55
+ lsst/daf/butler/version.py,sha256=GKnpddvvmGJ8yPsnT--mhT32jeA31BaGZsJcw6cTK7k,55
56
56
  lsst/daf/butler/_utilities/__init__.py,sha256=vLzPZYAJ-9r1cnqsP64MVpFgSw2166yOpq0iPMSdAvw,1298
57
57
  lsst/daf/butler/_utilities/locked_object.py,sha256=3RQf0Ish55mfQAfBy3V4Tfnfq5Q7-cxrwTlQMUhrIno,1931
58
58
  lsst/daf/butler/_utilities/named_locks.py,sha256=Zj_u1rZELaiWec3wJfkgmGD_YiZMLVxbMQmdbbVgk5E,2286
@@ -193,7 +193,7 @@ lsst/daf/butler/registry/bridge/__init__.py,sha256=vLzPZYAJ-9r1cnqsP64MVpFgSw216
193
193
  lsst/daf/butler/registry/bridge/ephemeral.py,sha256=QSKMRwQTAHnMOwdigH5tSNrQaM2dK-IXymb7x87bY-w,5845
194
194
  lsst/daf/butler/registry/bridge/monolithic.py,sha256=JvVhMH0K9lfzOTaVe9k34JaTAXAHKLP8e2XvRANWEZg,18148
195
195
  lsst/daf/butler/registry/collections/__init__.py,sha256=vLzPZYAJ-9r1cnqsP64MVpFgSw2166yOpq0iPMSdAvw,1298
196
- lsst/daf/butler/registry/collections/_base.py,sha256=ZDDwHNjlyuQ5jKHSWr8KxqpcgCOCex7I8imhfz_1HPg,36964
196
+ lsst/daf/butler/registry/collections/_base.py,sha256=MxrvTh81aHUULXtf5hHzK6iAjwkes5NckouHMhTFdPM,37480
197
197
  lsst/daf/butler/registry/collections/nameKey.py,sha256=7knssy-9kmynprNdN9309jc7bFn4deAFaXIZsvVACf8,12411
198
198
  lsst/daf/butler/registry/collections/synthIntKey.py,sha256=N27SkPcXIDfo6Qy-xS-M5nSFscNpuBKpThHTKn-aVAg,13179
199
199
  lsst/daf/butler/registry/databases/__init__.py,sha256=vLzPZYAJ-9r1cnqsP64MVpFgSw2166yOpq0iPMSdAvw,1298
@@ -211,7 +211,7 @@ lsst/daf/butler/registry/interfaces/__init__.py,sha256=IBMBBb1gyAx3o9uTufhQHtMrh
211
211
  lsst/daf/butler/registry/interfaces/_attributes.py,sha256=z-njEpWLhmKU4S0KOCplrY4QeBGoKUhlPRtSdNS_4uw,7258
212
212
  lsst/daf/butler/registry/interfaces/_bridge.py,sha256=pds0AhEXZVO3YguU-tkZ8J_NZrBj55HCGkHpBTXbBFQ,15924
213
213
  lsst/daf/butler/registry/interfaces/_collections.py,sha256=7I0e0Pi4UylET5Nr3keRFve7NToafHxJafiwn81lt6U,27008
214
- lsst/daf/butler/registry/interfaces/_database.py,sha256=grDIlySMfgq3K6egTx3qixsI7EmL-4Y7UqB5euopVXM,84478
214
+ lsst/daf/butler/registry/interfaces/_database.py,sha256=7RrBHGhryLrRhEYXInEZHeIz93JGdi6Ru48hXEE7foc,84393
215
215
  lsst/daf/butler/registry/interfaces/_database_explain.py,sha256=CkALWwNeyrjRvKizWrxvcGDunIhB77kLtEuXscrXVOY,3052
216
216
  lsst/daf/butler/registry/interfaces/_datasets.py,sha256=7vv_gZHc-JNrEtKc1dVZhh45OtJVSbw6SN8AH0vgBEw,25595
217
217
  lsst/daf/butler/registry/interfaces/_dimensions.py,sha256=VIVFfMGnBeUxSruvy9vU72Csk7hTE7HsnzLvCbevR10,18028
@@ -254,7 +254,7 @@ lsst/daf/butler/registry/queries/expressions/parser/ply/lex.py,sha256=Y9SoJv-_0X
254
254
  lsst/daf/butler/registry/queries/expressions/parser/ply/yacc.py,sha256=aGhbTj66OEYILEApQtwyfDunWoAPJ3QWZu6mD8uEB3s,137077
255
255
  lsst/daf/butler/registry/tests/__init__.py,sha256=uWJM-8Yv52Ox6e9rKGTaTVRdJc3fIfAyI5WnZQp81EA,1349
256
256
  lsst/daf/butler/registry/tests/_database.py,sha256=0lbzjDUj3n2UPvAktiKcc3G1TE0TK867cASezUISN6I,65218
257
- lsst/daf/butler/registry/tests/_registry.py,sha256=33is9gEiP2K4J3C26qFCD8KF32xnHdlib6c0vuN0zVk,204125
257
+ lsst/daf/butler/registry/tests/_registry.py,sha256=b1Gela-oTvd7inzKJyqZJLQzsQ4jGTf61BtEM5d515w,205460
258
258
  lsst/daf/butler/remote_butler/__init__.py,sha256=9fCJ-DmQGuktoGnmBBM_BygjIkgFWsROlbJ870uc9ak,1401
259
259
  lsst/daf/butler/remote_butler/_authentication.py,sha256=dnc4UGIGIdkkH6RLbq33CLZ2IWwPCEUmDxGHPauxSao,3932
260
260
  lsst/daf/butler/remote_butler/_collection_args.py,sha256=_ToE6jplUCzmmqwWvkl1cwrXRJkNU8Qrl2hqwIqHibw,4969
@@ -343,13 +343,13 @@ lsst/daf/butler/transfers/__init__.py,sha256=M1YcFszSkNB5hB2pZwwGXqbJE2dKt4YXDin
343
343
  lsst/daf/butler/transfers/_context.py,sha256=1oOlKWj53bjcVioOIzRNPZSC_Q0dLDI_R4syI9gMOkg,16938
344
344
  lsst/daf/butler/transfers/_interfaces.py,sha256=Ia1NqcFR5E-Ik4zsXEe2fuMtNCJj5Yfe_gVHLTBtJDw,7490
345
345
  lsst/daf/butler/transfers/_yaml.py,sha256=w_0GmrueuHVLfOfAXGHFBbWAl18tX6eSElbTC-2jRoc,32632
346
- lsst_daf_butler-29.2025.2800.dist-info/licenses/COPYRIGHT,sha256=k1Vq0-Be_K-puaeW4UZnckPjksEL-MJh4XKiWcjMxJE,312
347
- lsst_daf_butler-29.2025.2800.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
348
- lsst_daf_butler-29.2025.2800.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
349
- lsst_daf_butler-29.2025.2800.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
350
- lsst_daf_butler-29.2025.2800.dist-info/METADATA,sha256=01X3w9hpkZw2iP91ERRkJB2aPTQRJw6sBCnDxeht4aM,3265
351
- lsst_daf_butler-29.2025.2800.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
352
- lsst_daf_butler-29.2025.2800.dist-info/entry_points.txt,sha256=XsRxyTK3c-jGlKVuVnbpch3gtaO0lAA_fS3i2NGS5rw,59
353
- lsst_daf_butler-29.2025.2800.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
354
- lsst_daf_butler-29.2025.2800.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
355
- lsst_daf_butler-29.2025.2800.dist-info/RECORD,,
346
+ lsst_daf_butler-29.2025.3000.dist-info/licenses/COPYRIGHT,sha256=k1Vq0-Be_K-puaeW4UZnckPjksEL-MJh4XKiWcjMxJE,312
347
+ lsst_daf_butler-29.2025.3000.dist-info/licenses/LICENSE,sha256=pRExkS03v0MQW-neNfIcaSL6aiAnoLxYgtZoFzQ6zkM,232
348
+ lsst_daf_butler-29.2025.3000.dist-info/licenses/bsd_license.txt,sha256=7MIcv8QRX9guUtqPSBDMPz2SnZ5swI-xZMqm_VDSfxY,1606
349
+ lsst_daf_butler-29.2025.3000.dist-info/licenses/gpl-v3.0.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
350
+ lsst_daf_butler-29.2025.3000.dist-info/METADATA,sha256=7o8k9jyQHnAy8yhvbtSjE5cxGn14rlMtHVFwZFqX7Xk,3265
351
+ lsst_daf_butler-29.2025.3000.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
352
+ lsst_daf_butler-29.2025.3000.dist-info/entry_points.txt,sha256=XsRxyTK3c-jGlKVuVnbpch3gtaO0lAA_fS3i2NGS5rw,59
353
+ lsst_daf_butler-29.2025.3000.dist-info/top_level.txt,sha256=eUWiOuVVm9wwTrnAgiJT6tp6HQHXxIhj2QSZ7NYZH80,5
354
+ lsst_daf_butler-29.2025.3000.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
355
+ lsst_daf_butler-29.2025.3000.dist-info/RECORD,,