Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-14191: Merge butler configuration files with defaults #39

Merged
merged 26 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e929ce8
Butler config can now merge with defaults
timj May 7, 2018
611cf94
Fix typo in docstring
timj May 7, 2018
f365908
Provide config defaults
timj May 7, 2018
120a0c9
Rewrite doImport to use importlib rather than __import__
timj May 8, 2018
fee316f
Move ButlerConfig to its own file
timj May 9, 2018
39dc7ef
Registry configuration needs schema and registry config entries
timj May 9, 2018
5b170a0
Remove StorageClassFactory.fromConfig
timj May 9, 2018
d9b94b4
Add config subclass that can extract a sub component
timj May 9, 2018
c88286f
Use ConfigSubset
timj May 9, 2018
48ac511
Simplify registry constructor
timj May 9, 2018
aa1472a
Rename registry defaults file
timj May 14, 2018
21dad01
Use self-describing config classes
timj May 14, 2018
2612595
Update tests to use ButlerConfig and butler config directory
timj May 14, 2018
2fc0e3d
Prefer to throw ImportError rather than AttributeError
timj May 16, 2018
3bcf273
Rewrite config merging to use subset configs
timj May 16, 2018
fdc02e9
Use defaulting to read schema
timj May 16, 2018
76b6020
Move some test configuration information to defaults
timj May 16, 2018
86d9613
Allow default butler config
timj May 16, 2018
76e603e
Add parens around pdb example
timj May 16, 2018
6f65bbc
Add lots of tests for configuration merging
timj May 17, 2018
f022d5b
Move merging discussion to Config class
timj May 17, 2018
4e4620d
Disable C++ check
timj May 17, 2018
e0fc9cf
If YAML file is empty create empty dict
timj May 17, 2018
0507933
Overhaul merging code to pass tests
timj May 17, 2018
29cb101
Rename registry_schema to schema config file
timj May 17, 2018
bd82bd6
Fix dangling sentence
timj May 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- python -*-
from lsst.sconsUtils import scripts

scripts.BasicSConstruct("daf_butler")
scripts.BasicSConstruct("daf_butler", disableCc=True)
3 changes: 3 additions & 0 deletions config/datastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
datastore:
# Use the PosixDatastore as a default for a default butler
cls: lsst.daf.butler.datastores.posixDatastore.PosixDatastore
22 changes: 22 additions & 0 deletions config/datastores/posixDatastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
datastore:
cls: lsst.daf.butler.datastores.posixDatastore.PosixDatastore
root: default_butler_repository
records:
table: PosixDatastoreRecords
create: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised to not see the default mapping from StorageClass to Formatter here. Those are specific for PosixDatastore, right?

I don't actually care if they go here or elsewhere, but we need an easy way to construct a Butler that knows about those defaults.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't entirely sure what defaults would mean since the formatters really do lock in the file format, but you are right that FITS is where we are so our default for "how to write an Exposure" should be in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of those defaults currently live in the gen3 module of ci_hsc (on the gen3-middleware branch). I'd love to get those moved out of Python code into YAML. I'd also be happy to take care of making a ci_hsc branch compatible with this ticket once you're done with the daf_butler changes.

templates:
default: "{datasetType}/{tract:?}/{patch:?}/{filter:?}/{camera:?}_{visit:?}"
formatters:
TablePersistable: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistableWcs: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistablePsf: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistableCoaddInputs: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistableVisitInfo: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistableApCorr: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
TablePersistableCalib: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
ImageF: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
MaskX: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
SourceCatalog: lsst.daf.butler.formatters.fitsCatalogFormatter.FitsCatalogFormatter
Exposure: lsst.daf.butler.formatters.fitsExposureFormatter.FitsExposureFormatter
ExposureF: lsst.daf.butler.formatters.fitsExposureFormatter.FitsExposureFormatter
ExposureI: lsst.daf.butler.formatters.fitsExposureFormatter.FitsExposureFormatter
4 changes: 4 additions & 0 deletions config/registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default with a sqlLite registry
registry:
cls: lsst.daf.butler.registries.sqliteRegistry.SqliteRegistry
db: 'sqlite:///:memory:'