pypsa-eur icon indicating copy to clipboard operation
pypsa-eur copied to clipboard

fix load weighted prices

Open lisazeyen opened this issue 1 year ago • 6 comments

Changes proposed in this Pull Request

Fix bug when calculating load weighted prices in the make_summary script

Checklist

  • [x] I tested my contribution locally and it works as intended.
  • [x] Code and workflow changes are sufficiently documented.
  • [x] Changed dependencies are added to envs/environment.yaml.
  • [x] Changes in configuration options are added in config/config.default.yaml.
  • [x] Changes in configuration options are documented in doc/configtables/*.csv.
  • [x] Sources of newly added data are documented in doc/data_sources.rst.
  • [ ] A release note doc/release_notes.rst is added.

lisazeyen avatar Sep 12 '24 13:09 lisazeyen

@millingermarkus can you check if it is working with this branch?

lisazeyen avatar Sep 12 '24 14:09 lisazeyen

@p-glaum I am not dropping the prices if the load is zero at a bus. price = price.reindex(columns=load.columns) One could also reindex the other way around, but then the mariginal price would not be really load weighted, e.g. with load.reindex(columns=price.columns, fill_value=1)

lisazeyen avatar Sep 12 '24 16:09 lisazeyen

@p-glaum I am not dropping the prices if the load is zero at a bus. price = price.reindex(columns=load.columns) One could also reindex the other way around, but then the mariginal price would not be really load weighted, e.g. with load.reindex(columns=price.columns, fill_value=1)

okay, if the prices have a meaning for buses without flows going in or out, then we should definitely keep them and weight every timestep equally, i.e. with load.reindex(columns=price.columns, fill_value=1) However, if they do not have a realistic interpretation, should we drop them?

p-glaum avatar Sep 13 '24 06:09 p-glaum

@p-glaum I am not dropping the prices if the load is zero at a bus. price = price.reindex(columns=load.columns) One could also reindex the other way around, but then the mariginal price would not be really load weighted, e.g. with load.reindex(columns=price.columns, fill_value=1)

okay, if the prices have a meaning for buses flows going in or out, then we should definitely keep them and weight every timestep equally, i.e. wit load.reindex(columns=price.columns, fill_value=1) However, if they do not have a realistic interpretation, should we drop them?

I think if it is load weighted and the load is zero we should drop them.

lisazeyen avatar Sep 13 '24 06:09 lisazeyen

I think if it is load weighted and the load is zero we should drop them.

I think equal weight would be slightly better, but dropping also ok.

fneum avatar Sep 13 '24 08:09 fneum

Validator Report

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

:exclamation: Run failed!

Download 'logs' artifact to see more details.

  • master failed in: prepare_sector_network, prepare_sector_network, prepare_sector_network
  • fix-load-weighted-prices failed in: prepare_sector_network, prepare_sector_network, prepare_sector_network

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing fix-load-weighted-prices (f6f1e15) with master (834ea7f). Branch is 8 commits ahead and 0 commits behind. Last updated on 2024-11-10 14:50:38 CET.

github-actions[bot] avatar Sep 13 '24 14:09 github-actions[bot]