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

Write settings.yml parameters in original order #2352

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

enekomartinmartinez
Copy link
Contributor

@enekomartinmartinez enekomartinmartinez commented Feb 27, 2024

Description

Small fix to write settings.yml without sorting the keys. This preserves the original order of the parameters as they were given in the recipe, keeps the order given by the user. It also will add all the ESMValTool written parameters at the end so the block can be easily identified, see the settings from an example I ran:

c_my_argument1: whatever
a_my_argument2: null
z_my_argument3:
  c: 1
  b: 2
  a: 3
b_my_argument3: null
recipe: recipe_test_settings.yml
version: 2.10.0
script: test_settings_1
run_dir: /esarchive/scratch/emarti1/my-esmvaltool/testing/recipe_test_settings_20240227_140542/run/test_settings_diag/test_settings_1
plot_dir: /esarchive/scratch/emarti1/my-esmvaltool/testing/recipe_test_settings_20240227_140542/plots/test_settings_diag/test_settings_1
work_dir: /esarchive/scratch/emarti1/my-esmvaltool/testing/recipe_test_settings_20240227_140542/work/test_settings_diag/test_settings_1
output_file_type: png
log_level: debug
auxiliary_data_dir: /esarchive/scratch/emarti1/my-esmvaltool/auxiliary_data
input_files:
- /esarchive/scratch/emarti1/my-esmvaltool/testing/recipe_test_settings_20240227_140542/preproc/test_settings_diag/psl/metadata.yml

Closes #2339

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:

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.69%. Comparing base (5cdc3c2) to head (3cf5578).
Report is 49 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2352      +/-   ##
==========================================
+ Coverage   94.62%   94.69%   +0.07%     
==========================================
  Files         247      247              
  Lines       14065    14065              
==========================================
+ Hits        13309    13319      +10     
+ Misses        756      746      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bouweandela
Copy link
Member

Thanks for taking the time to contribute this feature! Could you please have a look at the checklist and do the things on it when you have the time? Then we can merge this.

@enekomartinmartinez
Copy link
Contributor Author

Hi @bouweandela

Sorry for the delay; I have been on a research visit since April and have not worked on priority topics related to my research.

The test failed because the method I modified was not covered by the original tests. I have added a small test to ensure the data is saved in order in the settings.yml. It is a really simple case, but I guess it is enough.

Let me know if you require a more specific example/test.

@enekomartinmartinez
Copy link
Contributor Author

Something failed with the Codacy Upload

@bouweandela bouweandela added the enhancement New feature or request label Jul 17, 2024
@bouweandela
Copy link
Member

Something failed with the Codacy Upload

Yes, it's a known issue with the Codacy Coverage uploader: codacy/codacy-coverage-reporter#500.

Copy link
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

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

Thanks, looking fine!

@bouweandela bouweandela merged commit 1716cb8 into ESMValGroup:main Jul 17, 2024
3 of 4 checks passed
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.

Write settings.yml in original order
2 participants