diff --git a/decoimpact/business/entities/rules/rolling_statistics_rule.py b/decoimpact/business/entities/rules/rolling_statistics_rule.py index dc9b2ae6..0b175d64 100644 --- a/decoimpact/business/entities/rules/rolling_statistics_rule.py +++ b/decoimpact/business/entities/rules/rolling_statistics_rule.py @@ -137,9 +137,6 @@ def _perform_operation( DataArray: Values of operation type """ - # derived from this stackoverflow answer: - # https://stackoverflow.com/questions/76556088/rolling-timedelta-temporal-window-with-xarray - result_array = _cp.deepcopy(values) result_array = result_array.where(False, _np.nan) @@ -147,11 +144,6 @@ def _perform_operation( operation_time_delta = _dt.timedelta(hours=period) elif time_scale == "D": operation_time_delta = _dt.timedelta(days=period) - # elif time_scale == "M": - # operation_time_delta = _dt.timedelta(months=period) - # elif time_scale == "Y": - # operation_time_delta = _dt.timedelta(years=period) - # NB 'months' and 'years' are not supported this way else: logger.log_error(f"Invalid time scale provided : '{time_scale}'.") diff --git a/decoimpact/business/utils/dataset_utils.py b/decoimpact/business/utils/dataset_utils.py index 554e8312..0042acb3 100644 --- a/decoimpact/business/utils/dataset_utils.py +++ b/decoimpact/business/utils/dataset_utils.py @@ -283,7 +283,6 @@ def get_time_dimension_name(variable: _xr.DataArray, logger: ILogger) -> str: str: time dimension name """ - for dim in variable.dims: dim_values = variable[dim] if dim_values.dtype.name == "datetime64[ns]": @@ -291,4 +290,4 @@ def get_time_dimension_name(variable: _xr.DataArray, logger: ILogger) -> str: message = f"No time dimension found for {variable.name}" logger.log_error(message) - raise ValueError(message) + raise ValueError(message) \ No newline at end of file