-
Notifications
You must be signed in to change notification settings - Fork 1
Minimise duplication of the CDDS default request items #349
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
base: main
Are you sure you want to change the base?
Conversation
NParsonsMO
left a comment
There was a problem hiding this comment.
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.
| [metadata] | ||
| branch_method = no parent | ||
| calendar = 360_day | ||
| base_date = 1850-01-01T00:00:00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this wasn't alphabetical (at the top)? Just slightly easier to find things in future if they are sorted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort the metadata list. but under [data], start_date and end_date should come together in my opinion. which makes sorting not always a case in such configuration files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully agree on the dates. And they were not alphabetical in that section, presumably for that reason.
But in the main branch's request_ref.cfg and request_eval.cfg, base_date was at the top (line 2), rather than line 4 (first review) or line 3 (re-review). It doesn't make a functional difference, I just wondered why it changed.
It was slightly harder to compare the two outputs (the date change seemed well worth that added few seconds).
| branch_method = no parent | ||
| calendar = 360_day | ||
| base_date = 1850-01-01T00:00:00 | ||
| experiment_id = amip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also configurable following PR #332.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am leaving this comment open, as PR #332 is further through the review process, so we will need to accept that change instead of this one when merging main into this branch.
| mode=mkdir | ||
|
|
||
| [file:$CYLC_WORKFLOW_SHARE_DIR/etc/request_defaults.cfg] | ||
| source=${CYLC_WORKFLOW_RUN_DIR}/app/configure_standardise/etc/request_defaults.cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hoped on seeing this that it might be a way round the unit test failures that I encountered in PR #324, but unfortunately it isn't, and it has a very similar error itself.
When I run pytest myself, all the tests pass fine. But when I do cylc vip -O metoffice -O unittest, I get a file not found error for the file above, ending as below:
cfg_path = base_dir / "etc" / "request_defaults.cfg"
if not cfg_path.exists():
> raise FileNotFoundError(f"Defaults file not found: {cfg_path}")
E FileNotFoundError: Defaults file not found: [MY_DIR]/CMEW/run3/share/etc/request_defaults.cfg
configure_standardise/bin/create_request_file.py:25: FileNotFoundError
However here, the unit test also does not pass with the command cylc vip -O metoffice -O test (as opposed to unittest) either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the unittests: 7bcab81
| # Running inside Cylc | ||
| base_dir = Path(os.environ["CYLC_WORKFLOW_SHARE_DIR"]) | ||
| else: | ||
| # Running under pytest / unittest / local execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to catch everything, see comment on rose-app.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it: 7bcab81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| branch_method = no parent | ||
| calendar = 360_day | ||
| base_date = 1850-01-01T00:00:00 | ||
| experiment_id = amip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am leaving this comment open, as PR #332 is further through the review process, so we will need to accept that change instead of this one when merging main into this branch.
| "package": "round-1", | ||
| "root_proc_dir": os.environ["ROOT_PROC_DIR"], | ||
| "root_data_dir": os.environ["ROOT_DATA_DIR"], | ||
| "workflow_basename": "CMEW", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,44 @@ | |||
| # (C) Crown Copyright 2022-2026, Met Office. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only 2026, not 2022-2026.
The year of first publication of the specific file:
https://github.com/MetOffice/CMEW/wiki/Detailed-Working-Practices#coding-requirements

Closes #209 .
PR creation checklist for the developer
<issue_number>above ☝️ been replaced with the issue number?mainbeen selected as the base branch?<issue_number>_<short_description_of_feature>?good first issuelabel) been added to the PR?Climate Model Evaluation Workflow (CMEW)project been added to the PR?Definition of Done for the developer
docdirectory) related to the change been updated appropriately, including the Quick Start section?PR creation checklist for the reviewer
<issue_number>above ☝️ been replaced with the issue number?mainbeen selected as the base branch?<issue_number>_<short_description_of_feature>?good first issuelabel) been added to the PR?Climate Model Evaluation Workflow (CMEW)project been added to the PR?Definition of Done for the reviewer
docdirectory) related to the change been updated appropriately, including the Quick Start section?