Skip to content

Commit

Permalink
feat[DEI-141]: fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
IoannaMi committed Nov 17, 2023
1 parent 6b8152c commit 8b97275
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions decoimpact/business/entities/rules/axis_filter_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def execute(self, value_array: _xr.DataArray, logger: ILogger) -> _xr.DataArray:
[{value_array.dims}] layer_name [{self._dim_name}]"""
logger.log_error(message)
raise IndexError(message)



if not (
self._layer_number >= 0
and self._layer_number <= len(getattr(value_array, self._dim_name))
Expand Down
13 changes: 7 additions & 6 deletions decoimpact/data/parsers/parser_axis_filter_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def parse_dict(self, dictionary: Dict[str, Any], logger: ILogger) -> IRuleData:
input_variable_name = get_dict_element("input_variable", dictionary)
dim_name = get_dict_element("dim_name", dictionary)
if not isinstance(dim_name, str):
message = (
"Dimension name should be a string, "
f"received a {type(dim_name)}: {dim_name}"
)
raise ValueError(message)
message = (
"Dimension name should be a string, "
f"received a {type(dim_name)}: {dim_name}"
)
raise ValueError(message)

layer_number = get_dict_element("layer_number", dictionary)
if not isinstance(layer_number, int):
Expand All @@ -57,5 +57,6 @@ def parse_dict(self, dictionary: Dict[str, Any], logger: ILogger) -> IRuleData:
output_variable_name = get_dict_element("output_variable", dictionary)

return AxisFilterRuleData(
name, layer_number, dim_name, input_variable_name, output_variable_name, description
name, layer_number, dim_name, input_variable_name,
output_variable_name, description
)

0 comments on commit 8b97275

Please sign in to comment.