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

Add progressbar argument to_dataset_dict() #204

Merged
merged 1 commit into from
Mar 8, 2020
Merged

Add progressbar argument to_dataset_dict() #204

merged 1 commit into from
Mar 8, 2020

Conversation

andersy005
Copy link
Member

This PR addresses #203 by adding progressbar argument to to_dataset_dict() method. This allows the user to override the default progressbar=True used during the class instantiation.

E.g.:

cat.to_dataset_dict(progressbar=False)
In [1]: import intake                                                                                              

In [2]: col_url = "https://raw.githubusercontent.com/NCAR/intake-esm-datastore/master/catalogs/pangeo-cmip6.json"  

In [3]: col = intake.open_esm_datastore(col_url)                                                                   

In [4]: cat = col.search(experiment_id=['historical', 'ssp585'], table_id='Oyr', variable_id='o2', grid_label='gn')                                                                          

In [5]:dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True, 'decode_times': False})                 


--> The keys in the returned dictionary of datasets are constructed as follows:
        'activity_id.institution_id.source_id.experiment_id.table_id.grid_label'
             
--> There are 17 group(s)
Progress: |███████████████████████████████████████████████████████████████████████████████| 100.0% 

With progress bar disabled:

                                                                                                         
In [6]: dset_dict = cat.to_dataset_dict(zarr_kwargs={'consolidated': True, 'decode_times': False}, progressbar=False)

Cc @jbusecke

@andersy005 andersy005 requested a review from a team as a code owner March 8, 2020 19:04
@andersy005 andersy005 merged commit f77d3da into intake:master Mar 8, 2020
@andersy005 andersy005 deleted the improve-progress-bar branch March 8, 2020 20:30
@jbusecke
Copy link
Contributor

jbusecke commented Mar 9, 2020

Fantastic! Thanks a lot @andersy005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants