Skip to content

Minimise duplication of the CDDS default request items#349

Open
Zubair Maalick (zmaalick) wants to merge 34 commits intomainfrom
209_config_cdds_dafault_request_items
Open

Minimise duplication of the CDDS default request items#349
Zubair Maalick (zmaalick) wants to merge 34 commits intomainfrom
209_config_cdds_dafault_request_items

Conversation

@zmaalick
Copy link
Copy Markdown
Collaborator

@zmaalick Zubair Maalick (zmaalick) commented Jan 20, 2026

Closes #209 .

PR creation checklist for the developer

  • Has <issue_number> above ☝️ been replaced with the issue number?
  • Has main been selected as the base branch?
  • Does the feature branch name follow the format <issue_number>_<short_description_of_feature>?
  • Does the text of the PR title exactly match with the text (not including the issue number) of the issue title?
  • Have appropriate reviewers been added to the PR (once it is ready for review)?
  • Has the PR been assigned to the developer(s)?
  • Have the same labels as on the issue (except for the good first issue label) been added to the PR?
  • Has the Climate Model Evaluation Workflow (CMEW) project been added to the PR?
  • Has the appropriate milestone been added to the PR?

Definition of Done for the developer

  • Does the change in this PR address the above issue / have all acceptance criteria been met?
  • Does the change in this PR follow the requirements in the wiki: Developer Guide (including copyrights)?
  • Have new tests related to the change been added?
  • Do all the GitHub workflow checks pass?
  • Do all the tests run locally and pass? (Note: the tests are not run by the GitHub workflow, see wiki: Run the tests locally)
  • Has the API documentation (e.g. docstrings in Python modules) related to the change been updated appropriately?
  • Has the user documentation (i.e. everything in the doc directory) related to the change been updated appropriately, including the Quick Start section?
  • Do the HTML pages render correctly? (See wiki: Build the documentation locally)

PR creation checklist for the reviewer

  • Has <issue_number> above ☝️ been replaced with the issue number?
  • Has main been selected as the base branch?
  • Does the feature branch name follow the format <issue_number>_<short_description_of_feature>?
  • Does the text of the PR title exactly match with the text (not including the issue number) of the issue title?
  • Have appropriate reviewers been added to the PR (once it is ready for review)?
  • Has the PR been assigned to the developer(s)?
  • Have the same labels as on the issue (except for the good first issue label) been added to the PR?
  • Has the Climate Model Evaluation Workflow (CMEW) project been added to the PR?
  • Has the appropriate milestone been added to the PR?

Definition of Done for the reviewer

  • Does the change in this PR address the above issue / have all acceptance criteria been met?
  • Does the change in this PR follow the requirements in the wiki: Developer Guide (including copyrights)?
  • Have new tests related to the change been added?
  • Do all the GitHub workflow checks pass?
  • Do all the tests run locally and pass? (Note: the tests are not run by the GitHub workflow, see wiki: Run the tests locally)
  • Has the API documentation (e.g. docstrings in Python modules) related to the change been updated appropriately?
  • Has the user documentation (i.e. everything in the doc directory) related to the change been updated appropriately, including the Quick Start section?
  • Do the HTML pages render correctly? (See wiki: Build the documentation locally)

@zmaalick Zubair Maalick (zmaalick) changed the title add a cfg file for default values Minimise duplication of the CDDS default request items Jan 20, 2026
@zmaalick Zubair Maalick (zmaalick) added enhancement New feature or request good first issue Good for newcomers technical debt Technical debt in CMEW standardise Anything related to CDDS quality assurance Anything related to Quality Assurance (QA) labels Jan 20, 2026
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The unit test for configure_standardise/bin/test_create_request_file.py::test_create_request fails.

I also think that the defaults file is not supposed to contain user-configurable variables.

Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg
Comment thread CMEW/app/configure_standardise/rose-app.conf
Comment thread CMEW/app/configure_standardise/rose-app.conf Outdated
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Copy link
Copy Markdown
Collaborator

@NParsonsMO Naomi Parsons (NParsonsMO) left a comment

Choose a reason for hiding this comment

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

There are merge conflicts that need to be sorted,

image

and I assume that this needs to be pre-review (although I'm not sure it's come up yet)?

I've left two comments open to check those lines on merging with main.

All unit tests now passing in all methods.

One copyright change requested.

Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One unit test is failing.

Two prior review comments have not been responded to.

Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg Outdated
Comment thread CMEW/app/configure_standardise/etc/request_defaults.cfg
@zmaalick
Copy link
Copy Markdown
Collaborator Author

One unit test is failing.

Two prior review comments have not been responded to.

Fix the unittest: ca8d9a0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

@ehogan Emma Hogan (ehogan) left a comment

Choose a reason for hiding this comment

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

Comment thread CMEW/app/configure_standardise/rose-app.conf Outdated
Comment thread CMEW/app/configure_standardise/bin/test_create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py Outdated
@NParsonsMO
Copy link
Copy Markdown
Collaborator

Sorry, I did not mean to close this, I dropped my mouse!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I really like the style of the function CMEW.app.configure_standardise.bin.create_request_file.create_request now, it's very readable.

I like it much more than all the nested information in CMEW/app/configure_recipe/bin/configure_recipe.py, but I know we did more away from using a reference file here... Is that a bit inconsistent?

I will approve if the workflow runs successfully but it seems to be stuck on the MASS step at the minute.

Comment thread CMEW/app/configure_standardise/rose-app.conf Outdated
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/bin/create_request_file.py
Comment thread CMEW/app/configure_standardise/bin/test_create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/bin/test_create_request_file.py Outdated
Comment thread CMEW/app/configure_standardise/bin/test_create_request_file.py
@NParsonsMO
Copy link
Copy Markdown
Collaborator

I will approve if the workflow runs successfully but it seems to be stuck on the MASS step at the minute.

It has now passed fine and my last approval is still showing.

Copy link
Copy Markdown
Member

@ehogan Emma Hogan (ehogan) left a comment

Choose a reason for hiding this comment

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

Thanks Alistair Sellar (@alistairsellar)! 🥳

I agree with all Naomi Parsons (@NParsonsMO)'s comments on the request_defaults.cfg file; this file, as described in the issue, is for default values only, not those configurable by the user (hence the name). Would it be possible for the request_defaults.cfg file to contain only the default values, please?

monkeypatch.setenv("EXPERIMENT_ID", "amip")
monkeypatch.setenv("INSTITUTION_ID", "MOHC")
monkeypatch.setenv("MODEL_ID", "UKESM1-0-LL")
monkeypatch.setenv("MODEL_ID", "HadGEM2-GC31-HH")
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.

There's a tiny bit of consolidation that can be done here to minimise duplication; set:

model_id = "HadGEM2-GC31-HH"

then use model_id here and for model_id below (when creating the expected dictionary) 👍

Copy link
Copy Markdown
Collaborator

@alistairsellar Alistair Sellar (alistairsellar) Apr 16, 2026

Choose a reason for hiding this comment

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

I'm not sure I understand this one. There is (before and after this PR) a duplicate specification of most of the items, e.g. INSTITUTION_ID, ROOT_PROC_DIR. Is MODEL_ID used differently in a way that I haven't spotted?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the explanation (offline). Python vars now added to remove duplicate values: 4435d33

@alistairsellar
Copy link
Copy Markdown
Collaborator

Thanks for the review Emma Hogan (@ehogan)

Would it be possible for the request_defaults.cfg file to contain only the default values, please?

Yes, that would be cleaner. Implemented in b6ff2a4.

Ready for your re-review.

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

Labels

enhancement New feature or request quality assurance Anything related to Quality Assurance (QA) standardise Anything related to CDDS technical debt Technical debt in CMEW

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimise duplication of the CDDS default request items

4 participants