MetOffice / MetOffice/CMEW

Add contents of non-Python modules into Python modules

Open
#515 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5
Forks
3
Avg merge
5d 6h
Merged PRs (30d)
8

Description

To simplify the creation of the `cmewpy` package (#511), accessing content via non-Python modules from Python modules should be minimised.

While it is possible to access content via non-Python modules from Python modules (as CMEW is doing already by determining the relative path to the non-Python module from `Path(__file__)`), adding non-Python modules to a Python package requires extra configuration. These both increase complexity.

Adding content to Python modules means the content can be imported, which will simplify the code and the creation of the `cmewpy` package.

`etc` files:

- ./app/configure_for/etc/recipe_paths.yml (although this may be removed following #514)
- ./app/configure_standardise/etc/request_defaults.yml
- ./app/configure_standardise/etc/streams.yml

Mock data:

- ~./app/unittest/mock_data/cmip6_datasets.yml~ #559
- ./app/unittest/mock_data/initial_config.ini
- ./app/unittest/mock_data/model_runs.nl
- ./app/unittest/mock_data/model_runs.yml
- ./app/unittest/mock_data/model_runs_as_list.yml
- ./app/unittest/mock_data/original_recipe_radiation_budget.yml
- ./app/unittest/mock_data/original_recipe_zec.yml
- ./app/unittest/mock_data/radiation_budget_variables.txt
- ./app/unittest/mock_data/recipe_paths.yml
- ~./app/unittest/mock_data/recipe_with_additional_datasets.yml~ #559
- ./app/unittest/mock_data/seaice_variables.txt
- ~./app/unittest/mock_data/updated_recipe_radiation_budget.yml~ #559

KGOs (these are more likely to need to be files on disk, but still worth reviewing):

- ./app/unittest/kgo/basic_dict.yml
- ~./app/unittest/kgo/blank_recipe_radiation_budget.yml~ #559
- ~./app/unittest/kgo/extended_radiation_budget_recipe.yml~ #559
- ./app/unittest/kgo/model_runs_as_dict.yml
- ./app/unittest/kgo/radiation_budget_variables.txt
- ~./app/unittest/kgo/recipe_additional_datasets_removed.yml~ #559
- ./app/unittest/kgo/request_u-cw673.cfg
- ./app/unittest/kgo/variables.txt

Contributor guide

Open the contributing guide

Research direction

Review the listed files under app/configure_for/etc, app/configure_standardise/etc, app/unittest/mock_data, and app/unittest/kgo, then trace how their contents are accessed by the Python modules. Identify which contents can be embedded in Python modules and which KGOs must remain on disk; done means the relevant content is importable and cmewpy packaging no longer needs extra non-Python module configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, developer-experience
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.