Skip to content

Commit 3d88874

Browse files
committed
small cleanup (removing commented code and fixing typos)
1 parent 6438cde commit 3d88874

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

decoimpact/business/entities/rules/time_aggregation_rule.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def count_groups(self, elem):
163163
elem (Array): the data array in N-dimensions
164164
165165
Returns:
166-
List: list with the counted periods*
166+
List: list with the counted periods
167167
"""
168168
# in case of an example array with 5 values [1,1,0,1,0]:
169169
# subtract last 4 values from the first 4 values: [1,0,1,0] - [1,1,0,1]:
@@ -231,8 +231,6 @@ def analyze_groups(self, elem, axis):
231231
# remove NaN values from the array (these are to be ignored)
232232
elem = elem[~_np.isnan(elem)]
233233
if len(elem) == 0:
234-
# return _np.zeros_like(elem)
235-
# elem = _np.zeros_like(elem)
236234
return 0
237235
if self.settings.operation_type is TimeOperationType.COUNT_PERIODS:
238236
group_result = self.count_groups(elem)

docs/manual/rules/time_aggregation_rule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The rule needs to be applied to an existing 2D/3D variable with time axis. A new
3333

3434
Period statistics: Time aggregation rule with COUNT_PERIODS, AVG_DURATION_PERIODS, MIN_DURATION_PERIODS and MAX_DURATION_PERIODS
3535

36-
When the operation type period statistics is used, the user needs to make sure that the input data is always consisting of only 1 and 0. If there is no such layer, the user can make a combination of for example the classification rule together with the time aggregation rule. For example, water depth can be used to check whether the cells are dry or not (this can be done with a classification rule) and with the COUNT_PERIODS operation type in the time aggregation rule the number of consecutive periods within a year or month can be calculated (nr). AVG_DURATION_PERIODS, MIN_DURATION_PERIODS and MAX_DURATION_PERIODS take the respective statistic of the duration for those consecutive periods (duration). Empty values (NaN) are allowed and will be ignores. In case for a specific dimension only empty values occur, the result of the aggregation will be 0.
36+
When the operation type period statistics is used, the user needs to make sure that the input data is always consisting of only 1 and 0. If there is no such layer, the user can make a combination of for example the classification rule together with the time aggregation rule. For example, water depth can be used to check whether the cells are dry or not (this can be done with a classification rule) and with the COUNT_PERIODS operation type in the time aggregation rule the number of consecutive periods within a year or month can be calculated (nr). AVG_DURATION_PERIODS, MIN_DURATION_PERIODS and MAX_DURATION_PERIODS take the respective statistic of the duration for those consecutive periods (duration). Empty values (NaN) are allowed and will be ignored. In case for a specific dimension only empty values occur, the result of the aggregation will be 0.
3737

3838

3939

0 commit comments

Comments
 (0)