Skip to content

Improve variable alias managament#595

Merged
bouweandela merged 13 commits into
masterfrom
variable_alias_management
Oct 2, 2020
Merged

Improve variable alias managament#595
bouweandela merged 13 commits into
masterfrom
variable_alias_management

Conversation

@jvegreg

@jvegreg jvegreg commented Mar 30, 2020

Copy link
Copy Markdown
Contributor

Porting the changes from ESMValGroup/ESMValTool#950 and fixing the issue with the data finder described in ESMValGroup/ESMValTool#1593 and ESMValGroup/ESMValTool#1605

Tasks

  • Create an issue to discuss what you are going to do, if you haven't done so already (and add the link at the bottom)
  • This pull request has a descriptive title that can be used in a changelog
  • Add unit tests
  • Public functions should have a numpy-style docstring so they appear properly in the API documentation. For all other functions a one line docstring is sufficient.
  • If writing a new/modified preprocessor function, please update the documentation
  • Circle/CI tests pass. Status can be seen below your pull request. If the tests are failing, click the link to find out why.
  • Codacy code quality checks pass. Status can be seen below your pull request. If there is an error, click the link to find out why. If you suspect Codacy may be wrong, please ask by commenting.
  • Please use yamllint to check that your YAML files do not contain mistakes
  • If you make backward incompatible changes to the recipe format, make a new pull request in the ESMValTool repository and add the link below

If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.


Closes ESMValGroup/ESMValTool#1605

@jvegreg jvegreg added bug Something isn't working cmor Related to the CMOR standard labels Mar 30, 2020
@jvegreg jvegreg self-assigned this Mar 30, 2020
@jvegreg jvegreg changed the title Improve alias managament Improve variable alias managament Mar 31, 2020
@jvegreg jvegreg marked this pull request as ready for review April 1, 2020 08:53
Comment thread esmvalcore/cmor/table.py Outdated
Comment thread esmvalcore/cmor/table.py Outdated
Comment thread esmvalcore/cmor/table.py Outdated
Comment thread esmvalcore/_recipe.py
Comment thread esmvalcore/_recipe.py

@valeriupredoi valeriupredoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cheers muchly @jvegasbsc 🍺 in principle am OK with this and I trust there is no other viable way going around these types of variables; but as @bouweandela points out - another layer of complexity for the user to figure out and set? BTW I don't see the documentation entry for it?

Comment thread esmvalcore/_recipe.py
@valeriupredoi

Copy link
Copy Markdown
Contributor

if you resolve los conflictos then it's good from my side, amigo! cool stuff 🍺

@bouweandela bouweandela left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be great if you could add documentation for the new feature

@jvegreg jvegreg force-pushed the variable_alias_management branch from 6c78dde to 6d582fa Compare October 1, 2020 09:02
@jvegreg

jvegreg commented Oct 1, 2020

Copy link
Copy Markdown
Contributor Author

Doc added, I also rebased it

Comment thread doc/recipe/overview.rst Outdated
Comment thread doc/recipe/overview.rst Outdated
Javier Vegas-Regidor and others added 2 commits October 1, 2020 11:18
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
Comment thread doc/recipe/overview.rst Outdated
Comment thread doc/recipe/overview.rst Outdated
Comment thread doc/recipe/overview.rst Outdated

@bouweandela bouweandela left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, but someone would need to test this. @sloosvel or @schlunma would one of you have time to run one or more recipes to test the new and old functionality?

@schlunma

schlunma commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

I can run a recipe in the background. What changes are to be expected?

@bouweandela

Copy link
Copy Markdown
Member

Great! The following variables have changed names between cmip5 and cmip6:

- ['sic', 'siconc']
- ['sit', 'sithick']
- ['tro3', 'o3']
- ['usi', 'siu']
- ['vsi', 'siv'] 

The expected outcome from this pull request is that it works if you use one of these variables with

  1. the cmip5 name and cmip5 datasets (as currently already works)
  2. the cmip6 name and cmip6 datasets (as currently already works)
  3. the cmip5 name and a mix of cmip5 and cmip6 datasets (currently broken)
  4. the cmip6 name and a mix of cmip5 and cmip6 datasets (currently broken)

@schlunma schlunma self-requested a review October 2, 2020 16:14

@schlunma schlunma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested successfully with this recipe:

documentation:
  description: |
    Recipe that demonstrates various uses of the preprocessor derive functionality.

  authors:
    - andela_bouwe

  maintainer:
    - righi_mattia

  projects:
    - c3s-magic

TEST: &alb_cmip5
  mip: Amon
  exp: historical
  start_year: 2004
  end_year: 2005
  additional_datasets:
    - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1}
    - {dataset: IPSL-CM6A-LR, project: CMIP6, ensemble: r1i1p1f1, grid: gr}


diagnostics:

  cmip5:
    description: Test variable derivation for CMIP5 models.
    variables:
      usi:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      vsi:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      siu:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      siv:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      sic:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      sit:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      siconc:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      sithick:
        <<: *alb_cmip5
        start_year: 1979
        end_year: 1979
        additional_datasets:
          - {dataset: GFDL-CM3,     project: CMIP5, ensemble: r1i1p1, mip: day}
          - {dataset: MPI-ESM1-2-HR,project: CMIP6, ensemble: r1i1p1f1, grid: gn, mip: SImon}
      tro3:
        <<: *alb_cmip5
      o3:
        <<: *alb_cmip5
    scripts: null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cmor Related to the CMOR standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SMPI not working on CMIP6 data

4 participants