Skip to content

Commit

Permalink
changed occurrences calc to counter
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHiDLR authored and henhuy committed Nov 30, 2023
1 parent 83f8605 commit 2471522
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/oemof/solph/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import itertools
import logging
import warnings
import numpy as np
import collections
from logging import getLogger

from oemof.tools import debugging
Expand Down Expand Up @@ -487,14 +487,10 @@ def _add_parent_block_sets(self):
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
)
] = collections.Counter(
self.es.tsa_parameters[p]["order"])[typ_period]

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

0 comments on commit 2471522

Please sign in to comment.