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

Unit test compile cost assumptions - Part 2 #182

Draft
wants to merge 76 commits into
base: master
Choose a base branch
from

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.

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.

1 participant