PyPSA / pypsa-eur

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System
https://pypsa-eur.readthedocs.io/
345 stars 242 forks source link

update sanitize carriers function #1400

Closed p-glaum closed 1 week ago

p-glaum commented 2 weeks ago

add_electrictiy: update sanitize_carriers _helpers: move rename_techs to helpers plot_summary: import rename_techs form helpers plot_power_network: import rename_techs from helpers

Closes #1396

Changes proposed in this Pull Request

In the current master, I have many techs that do not have a color defined. This is because we have techs like rural solar thermal, rural water tanks, and urban decentral heat that do not have a color defined in the default.config.yaml. With this PR, we take the rename_techs function and use it to find the colors of those technologies without having to define them specifically in the config.

Checklist

github-actions[bot] commented 2 weeks ago

Validator Report

I am the Validator. Download all artifacts here. I'll be back and edit this comment for each new commit.

General

Plots comparison
Main branch Feature branch
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Image not available Image not available
Files comparison
Status NRMSE MAE (norm)
weighted_prices.csv :warning:Changed 0.466 0.43
price_statistics.csv :warning:Changed 0.016 0.20
metrics.csv :warning:Changed 0.004 0.15
nodal_cfs.csv :warning: NaN mismatch
nodal_supply_energy.csv :warning: NaN mismatch
nodal_capacities.csv :warning: NaN mismatch
prices.csv :warning: NaN mismatch
supply.csv :warning: NaN mismatch
costs.csv :warning: NaN mismatch
nodal_costs.csv :warning: NaN mismatch
capacities.csv :warning: NaN mismatch
curtailment.csv :warning: NaN mismatch
supply_energy.csv :warning: NaN mismatch
cfs.csv :warning: NaN mismatch
energy.csv :warning: NaN mismatch
market_values.csv :white_check_mark: Almost equal 0.013 0.04
NRMSE: Normalized (combined-min-max) Root Mean Square Error MAE (norm): Mean Absolute Error on normalized data (min-max) Status Threshold: MAE (norm) > 0.05 and NRMSE > 0.3

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing feature/improve-sanitize_carrier (6ccf3d3) with master (92f0b2a). Branch is 8 commits ahead and 0 commits behind. Last updated on 2024-11-06 17:13:37 CET.

amos-schledorn commented 1 week ago

@p-glaum Looks good! Just suggested to add type hints and a docstring to the function you've touched. Could you provide a config.yaml for a minimal working example? I've ran this locally but the results graphs seem the same.

p-glaum commented 1 week ago

@amos-schledorn Thanks for reviewing! The results should not change. The only think what changed are the color entries in n.carriers.color which shouldn't be empty anymore for carriers like rural solar thermal

amos-schledorn commented 1 week ago

@amos-schledorn Thanks for reviewing! The results should not change. The only think what changed are the color entries in n.carriers.color which shouldn't be empty anymore for carriers like rural solar thermal

@p-glaum Gotcha. Checked the .nc outputs and there are no carriers without colours remaining. I can't make sense of the failing CI. If you know it's nothing critical, merge at will.