# sanity check 5: all elements in period order are valid period indices (above n_p[i] is the number of times that period index i appears in period order -> sum(n_p) == len(period_order))
ifsum(n_pforn_pinself.n_p)!=len(period_order):
...
...
@@ -1075,6 +1079,12 @@ class AggregatedDynamic(Dynamic):
"All elements in period order have to be valid period indices!"
)
defnumber_of_periods(self)->int:
returnlen(self.period_dynamics)
defoffsets(self,period_index)->Tuple[int]:
returnself.offsets_[period_index]
defnumber_of_steps(self)->int:
returnself.dynamic.number_of_steps()
...
...
@@ -1129,7 +1139,7 @@ class PeriodDynamic(Dynamic):
defresample(
values,dynamic:Dynamic,target_dynamic:Dynamic
):# values: type hinting Union[np-array, dict[int, np-array]], type hinting Union[np-array, dict[int, np-array]]
):# values: type hinting a np-array, type hinting a np-array