Skip to content

Commit

Permalink
Rename skip_datastore to without_datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jul 21, 2023
1 parent a926967 commit 9751249
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions python/lsst/daf/butler/_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Butler(LimitedButler):
the default for that dimension. Nonexistent collections are ignored.
If a default value is provided explicitly for a governor dimension via
``**kwargs``, no default will be inferred for that dimension.
skip_datastore : `bool`, optional
without_datastore : `bool`, optional
If `True` do not attach a datastore to this butler. Any attempts
to use a datastore will fail.
**kwargs : `str`
Expand Down Expand Up @@ -207,7 +207,7 @@ def __init__(
searchPaths: Sequence[ResourcePathExpression] | None = None,
writeable: bool | None = None,
inferDefaults: bool = True,
skip_datastore: bool = False,
without_datastore: bool = False,
**kwargs: str,
):
defaults = RegistryDefaults(collections=collections, run=run, infer=inferDefaults, **kwargs)
Expand All @@ -222,7 +222,7 @@ def __init__(
self.storageClasses = butler.storageClasses
self._config: ButlerConfig = butler._config
else:
self._config = ButlerConfig(config, searchPaths=searchPaths, skip_datastore=skip_datastore)
self._config = ButlerConfig(config, searchPaths=searchPaths, without_datastore=without_datastore)
try:
if "root" in self._config:
butlerRoot = self._config["root"]
Expand All @@ -233,7 +233,7 @@ def __init__(
self._registry = _RegistryFactory(self._config).from_config(
butlerRoot=butlerRoot, writeable=writeable, defaults=defaults
)
if skip_datastore:
if without_datastore:
self._datastore = NullDatastore(None, None)
else:
self._datastore = Datastore.fromConfig(
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/daf/butler/_butlerConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class ButlerConfig(Config):
than those read from the environment in
`ConfigSubset.defaultSearchPaths()`. They are only read if ``other``
refers to a configuration file or directory.
skip_datastore : `bool`, optional
without_datastore : `bool`, optional
If `True` remove the datastore configuration.
"""

def __init__(
self,
other: ResourcePathExpression | Config | None = None,
searchPaths: Sequence[ResourcePathExpression] | None = None,
skip_datastore: bool = False,
without_datastore: bool = False,
):
self.configDir: ResourcePath | None = None

Expand Down Expand Up @@ -160,7 +160,7 @@ def __init__(
for configClass in CONFIG_COMPONENT_CLASSES:
assert configClass.component is not None, "Config class component cannot be None"

if skip_datastore and configClass is DatastoreConfig:
if without_datastore and configClass is DatastoreConfig:
if configClass.component in butlerConfig:
del butlerConfig[configClass.component]
continue
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/certifyCalibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def certifyCalibrations(
Search all children of the inputCollection if it is a CHAINED
collection, instead of just the most recent one.
"""
butler = Butler(repo, writeable=True, skip_datastore=True)
butler = Butler(repo, writeable=True, without_datastore=True)
registry = butler.registry
timespan = Timespan(
begin=astropy.time.Time(begin_date, scale="tai") if begin_date is not None else None,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/collectionChain.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def collectionChain(
chain : `tuple` of `str`
The collections in the chain following this command.
"""
butler = Butler(repo, writeable=True, skip_datastore=True)
butler = Butler(repo, writeable=True, without_datastore=True)

# Every mode needs children except pop.
if not children and mode != "pop":
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _getTree(
names=("Name", "Type"),
dtype=(str, str),
)
butler = Butler(repo, skip_datastore=True)
butler = Butler(repo, without_datastore=True)

def addCollection(name: str, level: int = 0) -> None:
collectionType = butler.registry.getCollectionType(name)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryDataIds.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def queryDataIds(
Docstring for supported parameters is the same as
`~lsst.daf.butler.Registry.queryDataIds`.
"""
butler = Butler(repo, skip_datastore=True)
butler = Butler(repo, without_datastore=True)

if datasets and collections and not dimensions:
# Determine the dimensions relevant to all given dataset types.
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def queryDatasetTypes(repo: str, verbose: bool, glob: Iterable[str], components:
A dict whose key is "datasetTypes" and whose value is a list of
collection names.
"""
butler = Butler(repo, skip_datastore=True)
butler = Butler(repo, without_datastore=True)
expression = glob if glob else ...
datasetTypes = butler.registry.queryDatasetTypes(components=components, expression=expression)
if verbose:
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/script/queryDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def __init__(
if (repo and butler) or (not repo and not butler):
raise RuntimeError("One of repo and butler must be provided and the other must be None.")
# show_uri requires a datastore.
skip_datastore = False if show_uri else True
self.butler = butler or Butler(repo, skip_datastore=skip_datastore)
without_datastore = False if show_uri else True
self.butler = butler or Butler(repo, without_datastore=without_datastore)
self._getDatasets(glob, collections, where, find_first)
self.showUri = show_uri

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryDimensionRecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def queryDimensionRecords(
`~lsst.daf.butler.Registry.queryDimensionRecords` except for ``no_check``,
which is the inverse of ``check``.
"""
butler = Butler(repo, skip_datastore=True)
butler = Butler(repo, without_datastore=True)

query_collections: Iterable[str] | EllipsisType | None = None
if datasets:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/register_dataset_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def register_dataset_type(
be created by this command. They are always derived from the composite
dataset type.
"""
butler = Butler(repo, writeable=True, skip_datastore=True)
butler = Butler(repo, writeable=True, without_datastore=True)

composite, component = DatasetType.splitDatasetTypeName(dataset_type)
if component:
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/removeDatasetType.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ def removeDatasetType(repo: str, dataset_type_name: tuple[str, ...]) -> None:
datasetTypeName : `str`
The name of the dataset type to be removed.
"""
butler = Butler(repo, writeable=True, skip_datastore=True)
butler = Butler(repo, writeable=True, without_datastore=True)
butler.registry.removeDatasetType(dataset_type_name)
2 changes: 1 addition & 1 deletion tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ def test_fallback(self) -> None:
with self.assertRaises(RuntimeError):
Butler(bad_config)

butler = Butler(bad_config, writeable=True, skip_datastore=True)
butler = Butler(bad_config, writeable=True, without_datastore=True)
self.assertIsInstance(butler._datastore, NullDatastore)

# Check that registry is working.
Expand Down

0 comments on commit 9751249

Please sign in to comment.