Skip to content

Commit

Permalink
Add special handling for investment parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nailend committed Sep 29, 2023
1 parent 96f3ee0 commit 875e770
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions src/oemof/tabular/datapackage/reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,20 +459,35 @@ def create_periodic_values(values, periods_index):
if period_data and isinstance(v, list):
# check if length of list equals number of periods
if len(v) == len(period_data["periods"]):
# create timeseries with periodic values
facade[f] = create_periodic_values(
v, period_data["periods"]
)
msg = (
"\n"
f"The parameter '{f}' of a '{facade['type']}' "
"facade is converted into a periodic time "
"series.\nThis might not be possible for every"
" parameter and lead to ambiguous error "
"messages.\nPlease be aware, when using this "
"feature!"
)
warnings.warn(msg, UserWarning)
if f in ["fixed_costs", "capacity_costs"]:
# special period parameters don't need to be
# converted into timeseries
facade[f] = v
msg = (
"\n"
f"The parameter '{f}' of a '{facade['type']}' "
"facade is converted into a periodic list. "
"This might not be possible for every"
" parameter and lead to ambiguous error "
"messages.\nPlease be aware, when using this "
"feature!"
)
warnings.warn(msg, UserWarning)
else:
# create timeseries with periodic values
facade[f] = create_periodic_values(
v, period_data["periods"]
)
msg = (
"\n"
f"The parameter '{f}' of a '{facade['type']}' "
"facade is converted into a periodic time "
"series.\nThis might not be possible for every"
" parameter and lead to ambiguous error "
"messages.\nPlease be aware, when using this "
"feature!"
)
warnings.warn(msg, UserWarning)
read_facade(
facade,
facades,
Expand Down

0 comments on commit 875e770

Please sign in to comment.