From cda62e2149336282cfa559a314372910bc4977e1 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Tue, 13 Aug 2024 16:39:48 -0700 Subject: [PATCH] Relocate CollectionType out of registry to the root level --- python/lsst/daf/butler/__init__.py | 9 ++------- .../lsst/daf/butler/{registry => }/_collection_type.py | 0 python/lsst/daf/butler/_registry_shim.py | 2 +- python/lsst/daf/butler/cli/opt/options.py | 2 +- python/lsst/daf/butler/direct_butler/_direct_butler.py | 2 +- python/lsst/daf/butler/direct_query_driver/_driver.py | 3 ++- python/lsst/daf/butler/registry/__init__.py | 3 ++- python/lsst/daf/butler/registry/_registry.py | 2 +- python/lsst/daf/butler/registry/collections/_base.py | 2 +- python/lsst/daf/butler/registry/collections/nameKey.py | 2 +- .../lsst/daf/butler/registry/collections/synthIntKey.py | 2 +- .../butler/registry/datasets/byDimensions/_storage.py | 2 +- .../butler/registry/datasets/byDimensions/summaries.py | 2 +- .../lsst/daf/butler/registry/interfaces/_collections.py | 2 +- python/lsst/daf/butler/registry/queries/_query.py | 2 +- .../lsst/daf/butler/registry/queries/_query_backend.py | 2 +- .../daf/butler/registry/queries/_sql_query_backend.py | 2 +- python/lsst/daf/butler/registry/sql_registry.py | 2 +- python/lsst/daf/butler/registry/tests/_registry.py | 2 +- python/lsst/daf/butler/remote_butler/_registry.py | 2 +- python/lsst/daf/butler/script/_associate.py | 2 +- python/lsst/daf/butler/script/_pruneDatasets.py | 2 +- python/lsst/daf/butler/script/certifyCalibrations.py | 2 +- python/lsst/daf/butler/script/collectionChain.py | 3 ++- python/lsst/daf/butler/script/exportCalibs.py | 2 +- python/lsst/daf/butler/script/queryCollections.py | 2 +- python/lsst/daf/butler/script/removeCollections.py | 3 ++- python/lsst/daf/butler/script/removeRuns.py | 3 ++- python/lsst/daf/butler/tests/butler_queries.py | 3 ++- python/lsst/daf/butler/tests/hybrid_butler_registry.py | 3 ++- python/lsst/daf/butler/tests/utils.py | 2 +- python/lsst/daf/butler/transfers/_context.py | 2 +- python/lsst/daf/butler/transfers/_interfaces.py | 2 +- python/lsst/daf/butler/transfers/_yaml.py | 2 +- tests/test_cliCmdPruneDatasets.py | 2 +- 35 files changed, 42 insertions(+), 40 deletions(-) rename python/lsst/daf/butler/{registry => }/_collection_type.py (100%) diff --git a/python/lsst/daf/butler/__init__.py b/python/lsst/daf/butler/__init__.py index 2c0a0df118..acbfd4e929 100644 --- a/python/lsst/daf/butler/__init__.py +++ b/python/lsst/daf/butler/__init__.py @@ -39,6 +39,7 @@ from ._butler_collections import * from ._butler_config import * from ._butler_repo_index import * +from ._collection_type import CollectionType from ._column_categorization import * from ._column_tags import * from ._column_type_info import * @@ -81,13 +82,7 @@ # Do not import or lift symbols from 'server' or 'server_models'. # Import the registry subpackage directly for other symbols. -from .registry import ( - CollectionType, - MissingCollectionError, - NoDefaultCollectionError, - Registry, - RegistryConfig, -) +from .registry import MissingCollectionError, NoDefaultCollectionError, Registry, RegistryConfig from .transfers import RepoExportContext, YamlRepoExportBackend, YamlRepoImportBackend from .version import * diff --git a/python/lsst/daf/butler/registry/_collection_type.py b/python/lsst/daf/butler/_collection_type.py similarity index 100% rename from python/lsst/daf/butler/registry/_collection_type.py rename to python/lsst/daf/butler/_collection_type.py diff --git a/python/lsst/daf/butler/_registry_shim.py b/python/lsst/daf/butler/_registry_shim.py index bec40b2024..9e6694ed0e 100644 --- a/python/lsst/daf/butler/_registry_shim.py +++ b/python/lsst/daf/butler/_registry_shim.py @@ -33,6 +33,7 @@ from collections.abc import Iterable, Iterator, Mapping, Sequence from typing import TYPE_CHECKING, Any +from ._collection_type import CollectionType from ._dataset_association import DatasetAssociation from ._dataset_ref import DatasetId, DatasetIdGenEnum, DatasetRef from ._dataset_type import DatasetType @@ -47,7 +48,6 @@ ) from .registry import Registry from .registry._collection_summary import CollectionSummary -from .registry._collection_type import CollectionType from .registry._defaults import RegistryDefaults from .registry.queries import DataCoordinateQueryResults, DatasetQueryResults, DimensionRecordQueryResults diff --git a/python/lsst/daf/butler/cli/opt/options.py b/python/lsst/daf/butler/cli/opt/options.py index a4178e2ff5..bddb437d10 100644 --- a/python/lsst/daf/butler/cli/opt/options.py +++ b/python/lsst/daf/butler/cli/opt/options.py @@ -60,7 +60,7 @@ from typing import Any import click -from lsst.daf.butler.registry import CollectionType +from lsst.daf.butler import CollectionType from ..cliLog import CliLog from ..utils import MWOptionDecorator, MWPath, split_commas, split_kv, unwrap, yaml_presets diff --git a/python/lsst/daf/butler/direct_butler/_direct_butler.py b/python/lsst/daf/butler/direct_butler/_direct_butler.py index 54d7620853..e1a3a73fd6 100644 --- a/python/lsst/daf/butler/direct_butler/_direct_butler.py +++ b/python/lsst/daf/butler/direct_butler/_direct_butler.py @@ -54,6 +54,7 @@ from .._butler import Butler from .._butler_config import ButlerConfig from .._butler_instance_options import ButlerInstanceOptions +from .._collection_type import CollectionType from .._dataset_existence import DatasetExistence from .._dataset_ref import DatasetRef from .._dataset_type import DatasetType @@ -69,7 +70,6 @@ from ..progress import Progress from ..queries import Query from ..registry import ( - CollectionType, ConflictingDefinitionError, DataIdError, MissingDatasetTypeError, diff --git a/python/lsst/daf/butler/direct_query_driver/_driver.py b/python/lsst/daf/butler/direct_query_driver/_driver.py index 0aaa848b2c..fbb19b7a0f 100644 --- a/python/lsst/daf/butler/direct_query_driver/_driver.py +++ b/python/lsst/daf/butler/direct_query_driver/_driver.py @@ -42,6 +42,7 @@ import sqlalchemy from .. import ddl +from .._collection_type import CollectionType from .._dataset_type import DatasetType from .._exceptions import InvalidQueryError from ..dimensions import DataCoordinate, DataIdValue, DimensionGroup, DimensionUniverse @@ -62,7 +63,7 @@ GeneralResultSpec, ResultSpec, ) -from ..registry import CollectionSummary, CollectionType, NoDefaultCollectionError +from ..registry import CollectionSummary, NoDefaultCollectionError from ..registry.interfaces import ChainedCollectionRecord, CollectionRecord from ..registry.managers import RegistryManagerInstances from ..registry.wildcards import CollectionWildcard diff --git a/python/lsst/daf/butler/registry/__init__.py b/python/lsst/daf/butler/registry/__init__.py index 5bb516ebce..b72b7074af 100644 --- a/python/lsst/daf/butler/registry/__init__.py +++ b/python/lsst/daf/butler/registry/__init__.py @@ -25,6 +25,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from .._collection_type import CollectionType + # Re-export some top-level exception types for backwards compatibility -- these # used to be part of registry. from .._exceptions import ( @@ -40,7 +42,6 @@ # Registry imports. from . import interfaces, managers, queries, wildcards from ._collection_summary import * -from ._collection_type import * from ._config import * from ._defaults import * from ._exceptions import * diff --git a/python/lsst/daf/butler/registry/_registry.py b/python/lsst/daf/butler/registry/_registry.py index 30bd1a99fc..590eea03bb 100644 --- a/python/lsst/daf/butler/registry/_registry.py +++ b/python/lsst/daf/butler/registry/_registry.py @@ -37,6 +37,7 @@ from types import EllipsisType from typing import TYPE_CHECKING, Any, TypeAlias +from .._collection_type import CollectionType from .._dataset_association import DatasetAssociation from .._dataset_ref import DatasetId, DatasetIdGenEnum, DatasetRef from .._dataset_type import DatasetType @@ -51,7 +52,6 @@ DimensionUniverse, ) from ._collection_summary import CollectionSummary -from ._collection_type import CollectionType from ._defaults import RegistryDefaults from .queries import DataCoordinateQueryResults, DatasetQueryResults, DimensionRecordQueryResults from .wildcards import CollectionWildcard diff --git a/python/lsst/daf/butler/registry/collections/_base.py b/python/lsst/daf/butler/registry/collections/_base.py index 9c266bba45..cc6eaa5452 100644 --- a/python/lsst/daf/butler/registry/collections/_base.py +++ b/python/lsst/daf/butler/registry/collections/_base.py @@ -37,10 +37,10 @@ import sqlalchemy +from ..._collection_type import CollectionType from ..._exceptions import CollectionCycleError, CollectionTypeError, MissingCollectionError from ...timespan_database_representation import TimespanDatabaseRepresentation from .._collection_record_cache import CollectionRecordCache -from .._collection_type import CollectionType from ..interfaces import ChainedCollectionRecord, CollectionManager, CollectionRecord, RunRecord, VersionTuple from ..wildcards import CollectionWildcard diff --git a/python/lsst/daf/butler/registry/collections/nameKey.py b/python/lsst/daf/butler/registry/collections/nameKey.py index 6826d014d7..2ddd175afd 100644 --- a/python/lsst/daf/butler/registry/collections/nameKey.py +++ b/python/lsst/daf/butler/registry/collections/nameKey.py @@ -35,9 +35,9 @@ import sqlalchemy from ... import ddl +from ..._collection_type import CollectionType from ...column_spec import COLLECTION_NAME_MAX_LENGTH from ...timespan_database_representation import TimespanDatabaseRepresentation -from .._collection_type import CollectionType from ..interfaces import ChainedCollectionRecord, CollectionRecord, RunRecord, VersionTuple from ._base import ( CollectionTablesTuple, diff --git a/python/lsst/daf/butler/registry/collections/synthIntKey.py b/python/lsst/daf/butler/registry/collections/synthIntKey.py index 8e530e1250..e67541fce5 100644 --- a/python/lsst/daf/butler/registry/collections/synthIntKey.py +++ b/python/lsst/daf/butler/registry/collections/synthIntKey.py @@ -36,9 +36,9 @@ import sqlalchemy +from ..._collection_type import CollectionType from ...column_spec import COLLECTION_NAME_MAX_LENGTH from ...timespan_database_representation import TimespanDatabaseRepresentation -from .._collection_type import CollectionType from ..interfaces import ChainedCollectionRecord, CollectionRecord, RunRecord, VersionTuple from ._base import ( CollectionTablesTuple, diff --git a/python/lsst/daf/butler/registry/datasets/byDimensions/_storage.py b/python/lsst/daf/butler/registry/datasets/byDimensions/_storage.py index 9c518f1026..3d3d4586ac 100644 --- a/python/lsst/daf/butler/registry/datasets/byDimensions/_storage.py +++ b/python/lsst/daf/butler/registry/datasets/byDimensions/_storage.py @@ -40,6 +40,7 @@ import sqlalchemy from lsst.daf.relation import Relation, sql +from ...._collection_type import CollectionType from ...._column_tags import DatasetColumnTag, DimensionKeyColumnTag from ...._column_type_info import LogicalColumn from ...._dataset_ref import DatasetId, DatasetIdFactory, DatasetIdGenEnum, DatasetRef @@ -50,7 +51,6 @@ from ....direct_query_driver import QueryBuilder, QueryJoiner # new query system, server+direct only from ....queries import tree as qt # new query system, both clients + server from ..._collection_summary import CollectionSummary -from ..._collection_type import CollectionType from ..._exceptions import ConflictingDefinitionError from ...interfaces import DatasetRecordStorage from ...queries import SqlQueryContext # old registry query system diff --git a/python/lsst/daf/butler/registry/datasets/byDimensions/summaries.py b/python/lsst/daf/butler/registry/datasets/byDimensions/summaries.py index be43304e5f..d57636899e 100644 --- a/python/lsst/daf/butler/registry/datasets/byDimensions/summaries.py +++ b/python/lsst/daf/butler/registry/datasets/byDimensions/summaries.py @@ -38,12 +38,12 @@ import sqlalchemy from lsst.utils.iteration import chunk_iterable +from ...._collection_type import CollectionType from ...._dataset_type import DatasetType from ...._named import NamedKeyDict, NamedKeyMapping from ....dimensions import GovernorDimension, addDimensionForeignKey from ..._caching_context import CachingContext from ..._collection_summary import CollectionSummary -from ..._collection_type import CollectionType from ...interfaces import ( CollectionManager, CollectionRecord, diff --git a/python/lsst/daf/butler/registry/interfaces/_collections.py b/python/lsst/daf/butler/registry/interfaces/_collections.py index bd1b83f271..9cc510e0ae 100644 --- a/python/lsst/daf/butler/registry/interfaces/_collections.py +++ b/python/lsst/daf/butler/registry/interfaces/_collections.py @@ -41,8 +41,8 @@ import sqlalchemy +from ..._collection_type import CollectionType from ..._timespan import Timespan -from .._collection_type import CollectionType from ..wildcards import CollectionWildcard from ._versioning import VersionedExtension, VersionTuple diff --git a/python/lsst/daf/butler/registry/queries/_query.py b/python/lsst/daf/butler/registry/queries/_query.py index 6bd5474472..e44af5a391 100644 --- a/python/lsst/daf/butler/registry/queries/_query.py +++ b/python/lsst/daf/butler/registry/queries/_query.py @@ -35,6 +35,7 @@ from lsst.daf.relation import ColumnError, ColumnTag, Diagnostics, Relation, Sort, SortTerm +from ..._collection_type import CollectionType from ..._column_tags import DatasetColumnTag, DimensionKeyColumnTag, DimensionRecordColumnTag from ..._dataset_ref import DatasetRef from ..._dataset_type import DatasetType @@ -45,7 +46,6 @@ DimensionRecord, DimensionRecordSet, ) -from .._collection_type import CollectionType from ..wildcards import CollectionWildcard from ._query_backend import QueryBackend from ._query_context import QueryContext diff --git a/python/lsst/daf/butler/registry/queries/_query_backend.py b/python/lsst/daf/butler/registry/queries/_query_backend.py index bac06c3c3c..768314ae5a 100644 --- a/python/lsst/daf/butler/registry/queries/_query_backend.py +++ b/python/lsst/daf/butler/registry/queries/_query_backend.py @@ -46,12 +46,12 @@ UnaryOperationRelation, ) +from ..._collection_type import CollectionType from ..._column_tags import DatasetColumnTag, DimensionKeyColumnTag from ..._dataset_type import DatasetType from ..._exceptions import MissingDatasetTypeError from ..._exceptions_legacy import DatasetTypeError from ...dimensions import DimensionGroup, DimensionRecordSet, DimensionUniverse -from .._collection_type import CollectionType from ..wildcards import CollectionWildcard from ._query_context import QueryContext from .find_first_dataset import FindFirstDataset diff --git a/python/lsst/daf/butler/registry/queries/_sql_query_backend.py b/python/lsst/daf/butler/registry/queries/_sql_query_backend.py index 07d0c35432..da132831f9 100644 --- a/python/lsst/daf/butler/registry/queries/_sql_query_backend.py +++ b/python/lsst/daf/butler/registry/queries/_sql_query_backend.py @@ -34,13 +34,13 @@ from lsst.daf.relation import ColumnError, ColumnExpression, ColumnTag, Join, Predicate, Relation +from ..._collection_type import CollectionType from ..._column_categorization import ColumnCategorization from ..._column_tags import DimensionKeyColumnTag, DimensionRecordColumnTag from ..._dataset_type import DatasetType from ..._exceptions import DataIdValueError from ...dimensions import DimensionGroup, DimensionRecordSet, DimensionUniverse from ...dimensions.record_cache import DimensionRecordCache -from .._collection_type import CollectionType from ..interfaces import CollectionRecord, Database from ._query_backend import QueryBackend from ._sql_query_context import SqlQueryContext diff --git a/python/lsst/daf/butler/registry/sql_registry.py b/python/lsst/daf/butler/registry/sql_registry.py index fb6f51503c..97b4f83fa7 100644 --- a/python/lsst/daf/butler/registry/sql_registry.py +++ b/python/lsst/daf/butler/registry/sql_registry.py @@ -42,6 +42,7 @@ from lsst.resources import ResourcePathExpression from lsst.utils.iteration import ensure_iterable +from .._collection_type import CollectionType from .._column_tags import DatasetColumnTag from .._config import Config from .._dataset_association import DatasetAssociation @@ -72,7 +73,6 @@ ArgumentError, CollectionExpressionError, CollectionSummary, - CollectionType, CollectionTypeError, ConflictingDefinitionError, DatasetTypeError, diff --git a/python/lsst/daf/butler/registry/tests/_registry.py b/python/lsst/daf/butler/registry/tests/_registry.py index f60e4fc151..0732e03556 100644 --- a/python/lsst/daf/butler/registry/tests/_registry.py +++ b/python/lsst/daf/butler/registry/tests/_registry.py @@ -57,6 +57,7 @@ import lsst.sphgeom from lsst.daf.relation import Relation, RelationalAlgebraError, Transfer, iteration, sql +from ..._collection_type import CollectionType from ..._dataset_association import DatasetAssociation from ..._dataset_ref import DatasetIdFactory, DatasetIdGenEnum, DatasetRef from ..._dataset_type import DatasetType @@ -74,7 +75,6 @@ from ..._timespan import Timespan from ...dimensions import DataCoordinate, DataCoordinateSet, SkyPixDimension from .._collection_summary import CollectionSummary -from .._collection_type import CollectionType from .._config import RegistryConfig from .._exceptions import ( ArgumentError, diff --git a/python/lsst/daf/butler/remote_butler/_registry.py b/python/lsst/daf/butler/remote_butler/_registry.py index bc7515a4c4..53f267c829 100644 --- a/python/lsst/daf/butler/remote_butler/_registry.py +++ b/python/lsst/daf/butler/remote_butler/_registry.py @@ -33,6 +33,7 @@ from lsst.utils.iteration import ensure_iterable +from .._collection_type import CollectionType from .._dataset_association import DatasetAssociation from .._dataset_ref import DatasetId, DatasetIdGenEnum, DatasetRef from .._dataset_type import DatasetType @@ -49,7 +50,6 @@ from ..registry import ( CollectionArgType, CollectionSummary, - CollectionType, CollectionTypeError, DatasetTypeError, DatasetTypeExpressionError, diff --git a/python/lsst/daf/butler/script/_associate.py b/python/lsst/daf/butler/script/_associate.py index a1316cd3ad..74a4bb5baa 100644 --- a/python/lsst/daf/butler/script/_associate.py +++ b/python/lsst/daf/butler/script/_associate.py @@ -29,7 +29,7 @@ from collections.abc import Iterable from .._butler import Butler -from ..registry import CollectionType +from .._collection_type import CollectionType from .queryDatasets import QueryDatasets diff --git a/python/lsst/daf/butler/script/_pruneDatasets.py b/python/lsst/daf/butler/script/_pruneDatasets.py index 79b3ff527f..1c8caf2fd5 100644 --- a/python/lsst/daf/butler/script/_pruneDatasets.py +++ b/python/lsst/daf/butler/script/_pruneDatasets.py @@ -31,7 +31,7 @@ from typing import TYPE_CHECKING, Any from .._butler import Butler -from ..registry import CollectionType +from .._collection_type import CollectionType from .queryDatasets import QueryDatasets if TYPE_CHECKING: diff --git a/python/lsst/daf/butler/script/certifyCalibrations.py b/python/lsst/daf/butler/script/certifyCalibrations.py index bc4b8c1935..cec8142aed 100644 --- a/python/lsst/daf/butler/script/certifyCalibrations.py +++ b/python/lsst/daf/butler/script/certifyCalibrations.py @@ -29,8 +29,8 @@ import astropy.time from .._butler import Butler +from .._collection_type import CollectionType from .._timespan import Timespan -from ..registry import CollectionType def certifyCalibrations( diff --git a/python/lsst/daf/butler/script/collectionChain.py b/python/lsst/daf/butler/script/collectionChain.py index 8083a1e77f..36a7b2b138 100644 --- a/python/lsst/daf/butler/script/collectionChain.py +++ b/python/lsst/daf/butler/script/collectionChain.py @@ -30,7 +30,8 @@ from collections.abc import Iterable from .._butler import Butler -from ..registry import CollectionType, MissingCollectionError +from .._collection_type import CollectionType +from ..registry import MissingCollectionError from ..registry.wildcards import CollectionWildcard diff --git a/python/lsst/daf/butler/script/exportCalibs.py b/python/lsst/daf/butler/script/exportCalibs.py index 2302ad8064..25573f0c7b 100644 --- a/python/lsst/daf/butler/script/exportCalibs.py +++ b/python/lsst/daf/butler/script/exportCalibs.py @@ -35,7 +35,7 @@ from astropy.table import Table from .._butler import Butler -from ..registry import CollectionType +from .._collection_type import CollectionType if TYPE_CHECKING: from lsst.daf.butler import DatasetRef, DatasetType diff --git a/python/lsst/daf/butler/script/queryCollections.py b/python/lsst/daf/butler/script/queryCollections.py index a6aa1d1faa..2951080c98 100644 --- a/python/lsst/daf/butler/script/queryCollections.py +++ b/python/lsst/daf/butler/script/queryCollections.py @@ -32,7 +32,7 @@ from astropy.table import Table from .._butler import Butler -from ..registry import CollectionType +from .._collection_type import CollectionType def _getTable( diff --git a/python/lsst/daf/butler/script/removeCollections.py b/python/lsst/daf/butler/script/removeCollections.py index 1938799405..0b8a1ec87e 100644 --- a/python/lsst/daf/butler/script/removeCollections.py +++ b/python/lsst/daf/butler/script/removeCollections.py @@ -33,7 +33,8 @@ from astropy.table import Table from .._butler import Butler -from ..registry import CollectionType, MissingCollectionError +from .._collection_type import CollectionType +from ..registry import MissingCollectionError @dataclass diff --git a/python/lsst/daf/butler/script/removeRuns.py b/python/lsst/daf/butler/script/removeRuns.py index c62f0868f2..efd93e4a9d 100644 --- a/python/lsst/daf/butler/script/removeRuns.py +++ b/python/lsst/daf/butler/script/removeRuns.py @@ -32,7 +32,8 @@ from functools import partial from .._butler import Butler -from ..registry import CollectionType, MissingCollectionError +from .._collection_type import CollectionType +from ..registry import MissingCollectionError @dataclass diff --git a/python/lsst/daf/butler/tests/butler_queries.py b/python/lsst/daf/butler/tests/butler_queries.py index 1d598c0a27..dd72a468ab 100644 --- a/python/lsst/daf/butler/tests/butler_queries.py +++ b/python/lsst/daf/butler/tests/butler_queries.py @@ -41,6 +41,7 @@ from lsst.sphgeom import Region from .._butler import Butler +from .._collection_type import CollectionType from .._dataset_type import DatasetType from .._exceptions import InvalidQueryError from .._timespan import Timespan @@ -48,7 +49,7 @@ from ..direct_query_driver import DirectQueryDriver from ..queries import DimensionRecordQueryResults from ..queries.tree import Predicate -from ..registry import CollectionType, NoDefaultCollectionError, RegistryDefaults +from ..registry import NoDefaultCollectionError, RegistryDefaults from ..registry.sql_registry import SqlRegistry from ..transfers import YamlRepoImportBackend from .utils import TestCaseMixin diff --git a/python/lsst/daf/butler/tests/hybrid_butler_registry.py b/python/lsst/daf/butler/tests/hybrid_butler_registry.py index 167c78bc73..290a2bf340 100644 --- a/python/lsst/daf/butler/tests/hybrid_butler_registry.py +++ b/python/lsst/daf/butler/tests/hybrid_butler_registry.py @@ -31,6 +31,7 @@ from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from typing import Any, cast +from .._collection_type import CollectionType from .._dataset_association import DatasetAssociation from .._dataset_ref import DatasetId, DatasetIdGenEnum, DatasetRef from .._dataset_type import DatasetType @@ -44,7 +45,7 @@ DimensionRecord, DimensionUniverse, ) -from ..registry import CollectionArgType, CollectionSummary, CollectionType, Registry, RegistryDefaults +from ..registry import CollectionArgType, CollectionSummary, Registry, RegistryDefaults from ..registry.queries import ( DataCoordinateQueryResults, DatasetQueryResults, diff --git a/python/lsst/daf/butler/tests/utils.py b/python/lsst/daf/butler/tests/utils.py index 662921a953..8efbe446e5 100644 --- a/python/lsst/daf/butler/tests/utils.py +++ b/python/lsst/daf/butler/tests/utils.py @@ -42,7 +42,7 @@ from astropy.table import Table as AstropyTable from .. import Butler, Config, DatasetRef, StorageClassFactory, Timespan -from ..registry import CollectionType +from .._collection_type import CollectionType from ..tests import MetricsExample, addDatasetType if TYPE_CHECKING: diff --git a/python/lsst/daf/butler/transfers/_context.py b/python/lsst/daf/butler/transfers/_context.py index b880cec6e7..37af23a58d 100644 --- a/python/lsst/daf/butler/transfers/_context.py +++ b/python/lsst/daf/butler/transfers/_context.py @@ -33,12 +33,12 @@ from collections.abc import Callable, Iterable, Set from typing import TYPE_CHECKING +from .._collection_type import CollectionType from .._dataset_association import DatasetAssociation from .._dataset_ref import DatasetId, DatasetRef from .._dataset_type import DatasetType from .._file_dataset import FileDataset from ..dimensions import DataCoordinate, DimensionElement, DimensionRecord -from ..registry import CollectionType from ..registry.interfaces import ChainedCollectionRecord, CollectionRecord if TYPE_CHECKING: diff --git a/python/lsst/daf/butler/transfers/_interfaces.py b/python/lsst/daf/butler/transfers/_interfaces.py index 4e825da754..e12dbf66e8 100644 --- a/python/lsst/daf/butler/transfers/_interfaces.py +++ b/python/lsst/daf/butler/transfers/_interfaces.py @@ -33,13 +33,13 @@ from collections.abc import Iterable from typing import TYPE_CHECKING +from .._collection_type import CollectionType from .._config import ConfigSubset from .._dataset_association import DatasetAssociation from .._dataset_type import DatasetType from .._file_dataset import FileDataset from ..datastore import Datastore from ..dimensions import DimensionElement, DimensionRecord -from ..registry import CollectionType from ..registry.interfaces import CollectionRecord if TYPE_CHECKING: diff --git a/python/lsst/daf/butler/transfers/_yaml.py b/python/lsst/daf/butler/transfers/_yaml.py index f6c05e90ee..dc9741bc6c 100644 --- a/python/lsst/daf/butler/transfers/_yaml.py +++ b/python/lsst/daf/butler/transfers/_yaml.py @@ -44,6 +44,7 @@ from lsst.utils.introspection import find_outside_stacklevel from lsst.utils.iteration import ensure_iterable +from .._collection_type import CollectionType from .._dataset_association import DatasetAssociation from .._dataset_ref import DatasetId, DatasetRef from .._dataset_type import DatasetType @@ -52,7 +53,6 @@ from .._timespan import Timespan from ..datastore import Datastore from ..dimensions import DimensionElement, DimensionRecord, DimensionUniverse -from ..registry import CollectionType from ..registry.interfaces import ChainedCollectionRecord, CollectionRecord, RunRecord, VersionTuple from ..registry.sql_registry import SqlRegistry from ..registry.versions import IncompatibleVersionError diff --git a/tests/test_cliCmdPruneDatasets.py b/tests/test_cliCmdPruneDatasets.py index 8f66b73a57..e816deedee 100644 --- a/tests/test_cliCmdPruneDatasets.py +++ b/tests/test_cliCmdPruneDatasets.py @@ -35,6 +35,7 @@ import lsst.daf.butler.registry.sql_registry import lsst.daf.butler.script from astropy.table import Table +from lsst.daf.butler import CollectionType from lsst.daf.butler.cli.butler import cli as butlerCli from lsst.daf.butler.cli.cmd.commands import ( pruneDatasets_askContinueMsg, @@ -54,7 +55,6 @@ ) from lsst.daf.butler.cli.utils import LogCliRunner, astropyTablesToStr, clickResultMsg from lsst.daf.butler.direct_butler import DirectButler -from lsst.daf.butler.registry import CollectionType from lsst.daf.butler.script import QueryDatasets doFindTables = True