Skip to content

Conversation

@finozzifa
Copy link
Contributor

@finozzifa finozzifa commented Feb 19, 2025

Closes # (if applicable).

Changes proposed in this Pull Request

This pull request proposes a set of unit tests for scripts/compile_cost_assumptions.py, together with some minimal code re-factoring.

This pull request does not contain any major change to the functionalities of the scripts.

Unit tests

The pull request significantly shortens the conftest.py (almost by half). Moreover, it introduces unit tests for the following functions:

  • add_carbon_capture
  • add_gas_storage
  • geometric_series
  • prepare_inflation_rate

For introducing unit tests, I have introduce some minor changes to the functions. For example, I now pass as function arguments all snakemake.params/.config previously used in functions (but not passed as function arguments).

logger

The pull request proposes to add a configure_logging method to the _helpers.py from pypsa-eur. Moreover, the Snakefile is modified to add log files for the rules compile_cost_assumptions and compile_cost_assumptions_usa.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Data source for new technologies is clearly stated.
  • Newly introduced dependencies are added to environment.yaml (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the GPLv3 license.

@finozzifa finozzifa marked this pull request as ready for review March 3, 2025 13:30
@lkstrp lkstrp merged commit d695540 into PyPSA:master Mar 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants