From 498258d98d4e8af3626a951d155367cb79e24b7e Mon Sep 17 00:00:00 2001 From: Nate Lust Date: Tue, 27 Jun 2023 15:04:31 -0400 Subject: [PATCH] Black and isort changes --- python/lsst/daf/butler/core/datasets/ref.py | 8 +++++--- python/lsst/daf/butler/core/persistenceContext.py | 3 +-- python/lsst/daf/butler/core/quantum.py | 8 +++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/python/lsst/daf/butler/core/datasets/ref.py b/python/lsst/daf/butler/core/datasets/ref.py index 4bc0232f25..64796f0c21 100644 --- a/python/lsst/daf/butler/core/datasets/ref.py +++ b/python/lsst/daf/butler/core/datasets/ref.py @@ -285,9 +285,11 @@ def __init__( if id is not None: self._id = id.int else: - self._id = DatasetIdFactory().makeDatasetId( - self.run, self.datasetType, self.dataId, id_generation_mode - ).int + self._id = ( + DatasetIdFactory() + .makeDatasetId(self.run, self.datasetType, self.dataId, id_generation_mode) + .int + ) @property def id(self) -> DatasetId: diff --git a/python/lsst/daf/butler/core/persistenceContext.py b/python/lsst/daf/butler/core/persistenceContext.py index f6a4487bee..3001aae5bc 100644 --- a/python/lsst/daf/butler/core/persistenceContext.py +++ b/python/lsst/daf/butler/core/persistenceContext.py @@ -132,8 +132,7 @@ class PersistenceContextVars: @classmethod def _getContextVars(cls) -> dict[str, ContextVar]: - """Build a dictionary of names to caches declared at class scope. - """ + """Build a dictionary of names to caches declared at class scope.""" classAttributes: dict[str, ContextVar] = {} for k in vars(cls): v = getattr(cls, k) diff --git a/python/lsst/daf/butler/core/quantum.py b/python/lsst/daf/butler/core/quantum.py index 58954c63d2..25357c45f3 100644 --- a/python/lsst/daf/butler/core/quantum.py +++ b/python/lsst/daf/butler/core/quantum.py @@ -23,10 +23,10 @@ __all__ = ("Quantum", "SerializedQuantum", "DimensionRecordsAccumulator") -from collections.abc import Iterable, Mapping, MutableMapping -from typing import Any import sys import warnings +from collections.abc import Iterable, Mapping, MutableMapping +from typing import Any from lsst.utils import doImportType from pydantic import BaseModel @@ -57,9 +57,7 @@ def _reconstructDatasetRef( # if the dimension record has been loaded previously use that, # otherwise load it from the dict of Serialized DimensionRecords if dimensionRecords is None: - raise ValueError( - "Cannot construct from a SerializedQuantum with no dimension records. " - ) + raise ValueError("Cannot construct from a SerializedQuantum with no dimension records. ") tmpSerialized = dimensionRecords[dId] reconstructedDim = DimensionRecord.from_simple(tmpSerialized, universe=universe) records[sys.intern(reconstructedDim.definition.name)] = reconstructedDim