Skip to content

Commit

Permalink
improved linespace
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHiDLR authored and henhuy committed Nov 30, 2023
1 parent d30fbc3 commit 83f8605
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/oemof/solph/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,26 @@ def _add_parent_block_sets(self):
# If segmentation is used, timesteps_per_period is set to number of
# segmentations per period.
# Otherwise, default timesteps_per_period is used.
if any(
"segments" in params for params in self.es.tsa_parameters
):
if any("segments" in params for params in self.es.tsa_parameters):
for params in self.es.tsa_parameters:
params["timesteps_per_period"] = int(len(params["segments"]) / len(params["occurrences"]))
params["timesteps_per_period"] = int(
len(params["segments"]) / len(params["occurrences"])
)

# Construct occurrences of typical periods
for p in self.PERIODS:
self.es.tsa_parameters[p]["occurrences"] = {}
for typ_period in range(max(self.es.tsa_parameters[p]['order'])+1):
np.count_nonzero(self.es.tsa_parameters[0]['order'] == typ_period)
self.es.tsa_parameters[p]["occurrences"][typ_period] = np.count_nonzero(
self.es.tsa_parameters[p]['order'] == typ_period)
for typ_period in range(
max(self.es.tsa_parameters[p]["order"]) + 1
):
np.count_nonzero(
self.es.tsa_parameters[0]["order"] == typ_period
)
self.es.tsa_parameters[p]["occurrences"][
typ_period
] = np.count_nonzero(
self.es.tsa_parameters[p]["order"] == typ_period
)

# Construct weighting from occurrences and order
self.tsam_weighting = list(
Expand Down

0 comments on commit 83f8605

Please sign in to comment.