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

on-the-fly cmoriser for ACCESS native data #2430

Open
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

rhaegar325
Copy link

@rhaegar325 rhaegar325 commented May 21, 2024

Description

This pull request is to add the first version of on-the-fly cmoriser for ACCESS native data.
in this version we support only two variables(tas, pr), and will try to develop a more general version in next version.

Closes ESMValGroup/ESMValTool#3431

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the πŸ›  Technical or πŸ§ͺ Scientific review.


To help with the number pull requests:

@rhaegar325
Copy link
Author

@rbeucher our on-the-fly cmoriser pr is there, fixing issues to pass those tests

environment.yml Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
@rbeucher
Copy link
Contributor

Thanks Rhaegar. I think we need to update the documentation too. I will have a go.

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 36.53846% with 33 lines in your changes are missing coverage. Please review.

Project coverage is 93.85%. Comparing base (f72a873) to head (0e864b6).
Report is 39 commits behind head on main.

Files Patch % Lines
esmvalcore/cmor/_fixes/access/access_esm.py 36.53% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2430      +/-   ##
==========================================
- Coverage   94.07%   93.85%   -0.23%     
==========================================
  Files         241      242       +1     
  Lines       13422    13474      +52     
==========================================
+ Hits        12627    12646      +19     
- Misses        795      828      +33     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 8 lines in your changes missing coverage. Please review.

Project coverage is 94.57%. Comparing base (1da5bbc) to head (e160394).
Report is 3 commits behind head on main.

❗ Current head e160394 differs from pull request most recent head f7081ba

Please upload reports for the commit f7081ba to get more accurate results.

Files Patch % Lines
esmvalcore/cmor/_fixes/access/access_esm.py 76.47% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2430      +/-   ##
==========================================
- Coverage   94.61%   94.57%   -0.05%     
==========================================
  Files         246      247       +1     
  Lines       14048    14082      +34     
==========================================
+ Hits        13292    13318      +26     
- Misses        756      764       +8     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Yousong Zeng and others added 4 commits May 24, 2024 14:23
@rbeucher
Copy link
Contributor

Hi @rhaegar325 ,

See the PR here #1678 for CESM2
I think you need to add some tests and also make sure that the general structure, including the mapping information, is in the correct location.

@rhaegar325
Copy link
Author

Hi, @schlunma and @rbeucher,
I have made some change based on @schlunma 's suggestion, and I think it's ready now. Please review it at you convenience, much appreciate.

@rhaegar325 rhaegar325 requested a review from schlunma June 14, 2024 02:02
@rbeucher
Copy link
Contributor

@flicj191 @schlunma , would you have time to have a look again?

@rbeucher rbeucher requested a review from flicj191 June 16, 2024 23:18
Copy link

@flicj191 flicj191 left a comment

Choose a reason for hiding this comment

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

It's working for me. Added another suggestion, sorry I didn't see in my previous review.

- '{institute}/{sub_dataset}/{exp}/{modeling_realm}/netCDF'
input_file:
default: '{sub_dataset}.{special_attr}-*.nc'
output_file: '{sub_dataset}.{special_attr}'

Choose a reason for hiding this comment

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

Suggested change
output_file: '{sub_dataset}.{special_attr}'
output_file: '{institute}_{sub_dataset}_{special_attr}_{short_name}'

Could edit in the config-developer file so that the output preprocessed files can have more info like other output files, including short_name and institute and separated by underscores.

@rhaegar325
Copy link
Author

Hi, @schlunma @valeriupredoi:
I add some function in this pr to make it can cmoriser more variables, however, due to some variables need to be calculate by other variables in the raw data, I need to use eval() to calculate it because the way to calculate for a specific variable is stored in extra_facets, but it can't pass the Codacy Static Code Analysis. Can we accept that by any chance?

- fld_s03i332
- fld_s02i205
modeling_realm: atm
calculate: var[0]-var[1]+var[2]-var[3]
Copy link
Member

Choose a reason for hiding this comment

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

I recommend using a more readable format here, e.g.
fld_s02i207 - fld_s02i201 + fld_s03i332 - fld_s02i205. Instead of using eval (which leaves a lot of room for user mistakes and potential security issues), you could just write a regular expression to parse the string to get out the variables and operators, which you then apply.

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

Successfully merging this pull request may close these issues.

Build a new live-CMORiser for ACCESS-ESM raw data in ESMValTool
8 participants