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

Davide/remove hres eccb #59

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

Davide/remove hres eccb #59

wants to merge 23 commits into from

Conversation

atteggiani
Copy link
Collaborator

@atteggiani atteggiani commented Feb 28, 2025

Important

This PR head branch was based off davide/integration_tests_pytest to provide a way to test the scripts after their modification.
This branch should be rebased to main after #58 is merged, before marking it as "ready to be reviewed".

Overview

Fixes #31.

This PR removes the hres_eccb.py script and entry point, and renames the hres_ic.py script to the more general replace_landsurface.py.
The entry point hres_ic was also renamed to replace_landsurface to match the name of the package (which is usually recommended).

Testing

The integration tests pass with minor modifications (mainly renaming of functions). Obviously, no input/output data were changed.
The old test_hres_eccb test is now included within the test_replace_landsurface function with the replace_landsurface_era5land_2 ID, as it tests the era5land type (same as test n. 1) with different input data.

Why is this important

This simplifies the codebase and removes redundancies.

Important

SUITE MODIFICATIONS NEEDED
These changes break back-compatibility with the current revision of the RNS suite.
An updated version of the suite is available in this branch.

atteggiani and others added 23 commits February 22, 2025 08:55
Added integration tests for hres_ic
Added development environment
Before the actual test run, there is a setup step that sets up the work directory and data paths
Currently the tests are not meant to be run in parallel yet, as the setup should be re-structured to be run only once (before the test run) and not for each parallel worker.
- Mock the shutil.move function so the outputs can be sent to a custom path and there is no need for copying the input data
- Use fixtures
- Use mark.parameterize
- Use built-in tmp_path_factory fixture
- Enable parallelized tests

Tests can now be run with 'pytest -n <num> | auto' to run in parallel.
…e' to make it general. Also changed the entry points to only include replace_landsurface (old 'hres_ic').
@atteggiani atteggiani self-assigned this Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

Successfully merging this pull request may close these issues.

Turn hres_eccb.py and hres_ic.py into one script
1 participant