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

Add warning when negative bev availability profile values #858

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Upcoming Release

* New configuration option ``everywhere_powerplants`` to build conventional powerplants everywhere, irrespective of existing powerplants locations, in the network (https://github.com/PyPSA/pypsa-eur/pull/850).

* Remove option for wave energy as technology data is not maintained.
* Remove option for wave energy as technology data is not maintained.
* Add warning when BEV availability weekly profile has negative values in `build_transport_demand`.


PyPSA-Eur 0.9.0 (5th January 2024)
Expand Down
11 changes: 11 additions & 0 deletions scripts/build_transport_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
availability and demand-side management constraints.
"""

import logging

import numpy as np
import pandas as pd
import xarray as xr

from _helpers import configure_logging
from _helpers import generate_periodic_profiles

logger = logging.getLogger(__name__)


def build_nodal_transport_data(fn, pop_layout):
transport_data = pd.read_csv(fn, index_col=0)
Expand Down Expand Up @@ -130,6 +136,10 @@ def bev_availability_profile(fn, snapshots, nodes, options):
traffic.mean() - traffic.min()
)

if not avail[avail < 0].empty:
logger.warning("The BEV availability weekly profile has negative values which can "
"lead to infeasibility.")

return generate_periodic_profiles(
dt_index=snapshots,
nodes=nodes,
Expand Down Expand Up @@ -160,6 +170,7 @@ def bev_dsm_profile(snapshots, nodes, options):
simpl="",
clusters=48,
)
configure_logging(snakemake)

pop_layout = pd.read_csv(snakemake.input.clustered_pop_layout, index_col=0)

Expand Down