-
Notifications
You must be signed in to change notification settings - Fork 14
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-48975: Add show_dataset_types option to queryCollections #1157
base: main
Are you sure you want to change the base?
Conversation
e1eea3c
to
0fd0de4
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #1157 +/- ##
==========================================
- Coverage 89.35% 89.33% -0.02%
==========================================
Files 367 367
Lines 49528 49584 +56
Branches 6013 6025 +12
==========================================
+ Hits 44254 44296 +42
- Misses 3853 3865 +12
- Partials 1421 1423 +2 ☔ View full report in Codecov by Sentry. |
22c9f86
to
efe52a1
Compare
type=click.STRING, | ||
multiple=True, | ||
default=["*_config,*_log,*_metadata,packages"], | ||
callback=lambda ctx, param, value: sum((v.split(",") for v in value), []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use split_commas
(see other examples in this file).
6575583
to
e9b3c5f
Compare
e9b3c5f
to
816a1f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A couple of general comments:
- Listing all the dataset types in the chain and then listing all the dataset types in the collections that are in the chain separately seems like we are presenting the same information twice.
- In TABLE mode I'm a bit confused by the output.
butler query-collections -t ../pipelines_check/DATA_REPO/ --chains TABLE "*c*"
Name Type Children Dataset Types
------------------------------------- ----------- ---------------------------- -------------------------------------
HSC/calib CALIBRATION
HSC/calib/curated/2013-01-31T00:00:00 RUN
HSC/calib/gen2/2013-06-17 RUN
HSC/calib/gen2/2013-11-03 RUN
HSC/calib/unbounded RUN
demo_collection RUN
but in TREE mode these collections do have dataset types:
butler query-collections -t ../pipelines_check/DATA_REPO/ --chains TREE "*c*"
Name Type Dataset Types
------------------------------------- ----------- -------------------------------------
HSC/calib CALIBRATION bfKernel
bias
camera
dark
defects
flat
transmission_atmosphere
transmission_filter
transmission_optics
transmission_sensor
HSC/calib/curated/2013-01-31T00:00:00 RUN defects
HSC/calib/gen2/2013-06-17 RUN flat
HSC/calib/gen2/2013-11-03 RUN bias
dark
HSC/calib/unbounded RUN bfKernel
show_dataset_types : `bool` | ||
If True, also show the dataset types present within each collection. | ||
exclude_dataset_types : `~collections.abc.Iterable` [ `str` ] | ||
A glob-style comma-separated list of dataset types to exclude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By this point it isn't comma-separated any more.
show_dataset_types : `bool` | ||
If True, also show the dataset types present within each collection. | ||
exclude_dataset_types : `~collections.abc.Iterable` [ `str` ] | ||
A glob-style comma-separated list of dataset types to exclude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not comma-separated?
def addCollection(info: CollectionInfo) -> None: | ||
collection_table = Table([[info.name], [info.type.name]], names=["Name", "Type"]) | ||
if show_dataset_types: | ||
dataset_types = [""] if not info.dataset_types else info.dataset_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this identical code is used in three places (the filtering of dataset_types) please put it in a helper function.
for info_relative in info_relatives: | ||
relative_table = Table([[info_relative]], names=(descriptionCol,)) | ||
if show_dataset_types: | ||
cinfo = butler.collections.get_info(info_relative, include_summary=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this code is completely untested.
show_dataset_types : `bool` | ||
If True, also show the dataset types present within each collection. | ||
exclude_dataset_types : `~collections.abc.Iterable` [ `str` ] | ||
A glob-style comma-separated list of dataset types to exclude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not comma-separated?
collection_type | ||
Same as `queryCollections` | ||
flatten_chains : `bool` | ||
If True, flatten the tree of CHAINED datasets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If True, flatten the tree of CHAINED datasets. | |
If `True`, flatten the tree of CHAINED datasets. |
and elsewhere.
def addCollection(info: CollectionInfo) -> None: | ||
collection_table = Table([[info.name], [info.type.name]], names=["Name", "Type"]) | ||
if show_dataset_types: | ||
dataset_types = [""] if not info.dataset_types else info.dataset_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch also untested.
show_dataset_types : `bool`, optional | ||
If True, include the dataset types present within each collection. | ||
exclude_dataset_types : `~collections.abc.Iterable` [ `str` ], optional | ||
A glob-style comma-separated list of dataset types to exclude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma-separated?
Checklist
doc/changes
configs/old_dimensions