Remove environment variables from create_request_file.py - #529
Remove environment variables from create_request_file.py#529Naomi Parsons (NParsonsMO) wants to merge 17 commits into
create_request_file.py#529Conversation
|
This changes a lot of the same files as so it will be much easier (fewer conflicts) to add in the |
…_request_filepy # Conflicts: # CMEW/app/configure_standardise/bin/configure_standardise.sh # CMEW/app/configure_standardise/bin/create_request_file.py # CMEW/app/configure_standardise/bin/test_create_request_file.py
| Path(__file__).parent.parent / "etc" / "request_defaults.yml" | ||
| ) | ||
| stream_config_path = Path(__file__).parent.parent / "etc" / "streams.yml" | ||
| monkeypatch.setattr(create_request_file, "list_streams", fake_list_streams) |
There was a problem hiding this comment.
Can / should we avoid monkeypatch here?
There was a problem hiding this comment.
Given what was done in #559, I expect to not have a test for the driver function (i.e. create_request). So happy to leave this for now 👍
|
The request file needs to be made after the variables file so I'm waiting until PR #530 is reviewed. |
|
|
||
| [command] | ||
| default=configure_standardise.sh | ||
| default=cmew-esmvaltool-env create_variables_file.py |
There was a problem hiding this comment.
The variables file needs to have been created first, but this single line is probably already lots of lines by now (if PR #530 has been merged).
…_request_filepy # Conflicts: # CMEW/app/configure_standardise/bin/command_line.py # CMEW/app/configure_standardise/bin/configure_standardise.sh # CMEW/app/configure_standardise/bin/configure_standardise_conftest.py # CMEW/app/configure_standardise/rose-app.conf
Emma Hogan (ehogan)
left a comment
There was a problem hiding this comment.
Thanks Naomi Parsons (@NParsonsMO)! 🥳
| with open(model_runs_yml_fp, "r") as f: | ||
| dataset_dict = yaml.safe_load(f)[dataset] |
There was a problem hiding this comment.
| with open(model_runs_yml_fp, "r") as f: | |
| dataset_dict = yaml.safe_load(f)[dataset] | |
| with open(model_runs_yml_fp, "r") as file_handle: | |
| dataset_dict = yaml.safe_load(file_handle)[dataset] |
| "--output_filepath", | ||
| help=( | ||
| "The full path to the file where the " | ||
| "variables from the ESMValTool recipe will be written." |
There was a problem hiding this comment.
| "variables from the ESMValTool recipe will be written." | |
| "request file will be written." |
?
| ) | ||
| parser.add_argument( | ||
| "--mip_table_dir", | ||
| help="The MIP table to use from CDDS.", |
There was a problem hiding this comment.
| help="The MIP table to use from CDDS.", | |
| help=( | |
| "The full path to the directory containing the " | |
| "MIP tables for CDDS to use.", |
| The names and values of the command line arguments. | ||
| """ | ||
| parser = argparse.ArgumentParser( | ||
| description="Create a request to standardise model data with CDDS.", |
There was a problem hiding this comment.
| description="Create a request to standardise model data with CDDS.", | |
| description="Create a request file to standardise model data with CDDS.", |
|
|
||
| def main_for_create_request_file(arguments=None): | ||
| """ | ||
| Generate and write the request file for the current task environment. |
There was a problem hiding this comment.
| Generate and write the request file for the current task environment. | |
| Create a request file to standardise model data with CDDS. |
| raw_data_dir_mode, | ||
| ): | ||
| """ | ||
| Generate and write the request file for the current task environment. |
There was a problem hiding this comment.
| Generate and write the request file for the current task environment. | |
| Create a request file to standardise model data with CDDS. |
| Path(__file__).parent.parent / "etc" / "request_defaults.yml" | ||
| ) | ||
| stream_config_path = Path(__file__).parent.parent / "etc" / "streams.yml" | ||
| monkeypatch.setattr(create_request_file, "list_streams", fake_list_streams) |
There was a problem hiding this comment.
Given what was done in #559, I expect to not have a test for the driver function (i.e. create_request). So happy to leave this for now 👍
Closes #523
PR creation checklist for the developer
<issue_number>above ☝️ has been replaced with the issue number.mainhas been selected as the base branch.<issue_number>_<short_description_of_feature>.good first issuelabel) have been added to the PR.Climate Model Evaluation Workflow (CMEW)project has been added to the PR.Definition of Done for the developer
docdirectory, including the Quick Start section; select one of the following):Copyright and IPR:
PR creation checklist for the reviewer
<issue_number>above ☝️ has been replaced with the issue number.mainhas been selected as the base branch.<issue_number>_<short_description_of_feature>.good first issuelabel) have been added to the PR.Climate Model Evaluation Workflow (CMEW)project has been added to the PR.Definition of Done for the reviewer
docdirectory, including the Quick Start section; select one of the following):Important
#<pull_request_number>: <pull_request_title>when writing the merge commit message for the pull request, so the pull request number is immediately visible on GitHub, regardless of the length of the pull request title.