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

Dots and dashes in model names #82

Closed
DamienIrving opened this issue Aug 6, 2019 · 7 comments · Fixed by #86
Closed

Dots and dashes in model names #82

DamienIrving opened this issue Aug 6, 2019 · 7 comments · Fixed by #86

Comments

@DamienIrving
Copy link

This is a very minor comment, but I've noticed that at the command line clef works fine with either dashes or dots between the numbers in model names, e.g.
CSIRO-Mk3.6.0
CSIRO-Mk3-6-0

whereas when using import clef.code within a script it only accepts dots.

It probably wouldn't really matter except that the official model ids use dashes, so your first instinct as a user is to use CSIRO-Mk3-6-0.

@paolap
Copy link
Member

paolap commented Aug 6, 2019

Hi Damien,

did you use the latest clef?
We've released a new version last week (0.5.0) which is analysis3 and we're going to release probably a new one this week.

@DamienIrving
Copy link
Author

@paolap Yep, I used version 0.5.0.

@paolap
Copy link
Member

paolap commented Aug 6, 2019

Hi Damien I can't reproduce your issue, what occurs to me is that maybe you're using directly the 'local_query' function rather than 'search' which calls other functions before to check the arguments and values you're passing and fixes them if they need to.

We've also updated the read the docs now so there shouldn't be confusion anymore.
Could you confirm with me if that's the case, otherwise could you post the exact code you're using?
Thanks

@DamienIrving
Copy link
Author

No problem. Following this example I did the following:

>>> import clef.code
>>> db = clef.code.connect()
>>> session = clef.code.Session()

>>> constraints_dash = {'variable': 'masso', 'model': 'ACCESS1-3', 'table': 'Omon', 'experiment': 'piControl', 'ensemble': 'r1i1p1'}
>>> clef.code.search(session, project='cmip5', **constraints_dash)
[]

>>> constraints_dot = {'variable': 'masso', 'model': 'ACCESS1.3', 'table': 'Omon', 'experiment': 'piControl', 'ensemble': 'r1i1p1'}
>>> clef.code.search(session, project='cmip5', **constraints_dot)
[{'filenames': ['masso_Omon_ACCESS1-3_piControl_r1i1p1_050001-074912.nc',
   'masso_Omon_ACCESS1-3_piControl_r1i1p1_025001-049912.nc'],
  'project': 'CMIP5',
  'institute': 'CSIRO-BOM',
  'model': 'ACCESS1.3',
  'experiment': 'piControl',
  'frequency': 'mon',
  'realm': 'ocean',
  'r': '1',
  'i': '1',
  'p': '1',
  'ensemble': 'r1i1p1',
  'cmor_table': 'Omon',
  'version': None,
  'variable': 'masso',
  'pdir': '/g/data1/rr3/publications/CMIP5/output1/CSIRO-BOM/ACCESS1-3/piControl/mon/ocean/Omon/r1i1p1/latest/masso',
  'periods': [('50001', '74912'), ('25001', '49912')],
  'fdate': '25001',
  'tdate': '74912',
  'time_complete': None}]

@paolap
Copy link
Member

paolap commented Aug 6, 2019

It's weird for some reason the master branch we used had a faulty version you can see here:

if 'model' in args.keys():
fix_model(project, args['model'])

should be

if 'model' in args.keys():
args['model'] = fix_model(project, args['model'])

we're calling the function but we don't update the value. This have been deleted accidentally at some stage in one of the branches we merged, because my version still has the right syntax and no change has been done on this for a while. Thanks for getting back to me, somehow we were already using a fixed version.
Also is covered by a new test Scott just added so we shouldn't miss that again

@DamienIrving
Copy link
Author

Thanks, @paolap

@paolap
Copy link
Member

paolap commented Aug 9, 2019

This is now solved in localfix, I also noticed alternative model names weren't working for --remote option, they now work for everything.

@paolap paolap mentioned this issue Aug 9, 2019
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 a pull request may close this issue.

2 participants