-
Notifications
You must be signed in to change notification settings - Fork 52
Add optional esmvalcore dependency & to_esmvalcore method
#717
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
base: main
Are you sure you want to change the base?
Conversation
…plified) & tests for the changes to the __init__.py
|
@rbeucher, this now works with the following script - loads an example dataset from the enso-recipes: >>> import intake
>>> catalog = intake.cat.access_nri
# cat = cat.search(name='(?i)cmip.*', model = 'ACCESS-ESM1-5')
# yields cmip6_fs38
>>> esm_ds = catalog['cmip6_fs38']
"""
This creates the same dataset as
model_datasets = {
"ACCESS-ESM1-5":
IntakeDataset(
short_name='tos',
project='CMIP6',
mip="Omon",
exp="historical",
ensemble="r1i1p1f1",
timerange="19790101/20190101",
dataset="ACCESS-ESM1-5",
grid="gn"
)}
when I was trying to add an IntakeDataset to esmvalcore.
"""
>>> search = dict(
variable_id='tos',
table_id='Omon',
experiment_id='historical',
member_id='r1i1p1f1',
source_id='ACCESS-ESM1-5',
grid_label='gn',
version='v.*'
)
>>> esm_ds = esm_ds.search(
**search
)
>>> esmvalcore_dataset = esm_ds.to_esmvalcore()
>>> print(esmvalcore_dataset)
Dataset:
{'dataset': 'ACCESS-ESM1-5',
'project': 'CMIP6',
'mip': 'Omon',
'short_name': 'tos',
'activity': 'CMIP',
'ensemble': 'r1i1p1f1',
'exp': 'historical',
'frequency': 'mon',
'grid': 'gn',
'institute': ['CSIRO'],
'long_name': 'Sea Surface Temperature',
'modeling_realm': ['ocean'],
'original_short_name': 'tos',
'standard_name': 'sea_surface_temperature',
'units': 'degC'}
session: 'session-f404cbc9-21b8-40b8-958c-b6e082d05979_20250513_013009'Is this the sort of functionality you had in mind/ we talked about? Also cc'ing @bouweandela - this would go some way towards the esmvalcore/intake-esm integration by letting users dump an esmvalcore dataset out from an intake-esm search. Todo:
I've added a I have no idea if there is anything resembling a standard CMORizer API - if not, we might need to create something resembling one so that there's a plug & play way of cmorizing stuff in this functionality. |
test_to_iris_unvailable needed updating)
…passed to `to_iris` call by user.
…uations where `require_all_on` has been used
ad82c60 to
ee0dbec
Compare
|
Thanks for cc'ing me! I'm not sure if integrating ESMValCore into intake-esm this is the right way around (I would personally integrate support for intake-esm into the You may want to call the method There may be no need for a
Not yet, but there are plans to develop something like that as part of the upcoming Horizon Europe proposals. It will probably look something like |
I'm OK with that, but I agree it should be a |
I'm planning on adding that too - the intake-esm branch/draft PR on the esmvalcore repo should have some code starting with that process already. Most of the functionality in this PR is implemented in the ESMValCore repo anyway. This PR is mostly just low hanging fruit for our users, who are already going to be used to accessing data through intake catalogues.
Cool, that's really handy to know - thanks! |
to_esmvalcore method
Changes
to_esmvalcoremethod toesm_datastoreclassto_esmvalcoremethod (will require some heavy mocking)Related issue number
ESMValGroup/ESMValCore#2690
Closes #715
Checklist