Skip to content

Commit

Permalink
Bugfix: Comparison of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
andreArtelt committed Jun 17, 2024
1 parent 386365b commit fda6083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion epyt_flow/simulation/events/leakages.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __eq__(self, other) -> bool:
raise TypeError(f"Can not compare 'Leakage' instance with '{type(other)}' instance")

return super().__eq__(other) and self.__link_id == other.link_id \
and self.__diameter == other.diameter and self.__profile == other.profile \
and self.__diameter == other.diameter and np.all(self.__profile == other.profile) \
and self.__node_id == other.node_id and self.area == other.area

def __str__(self) -> str:
Expand Down
8 changes: 5 additions & 3 deletions epyt_flow/simulation/scenario_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any
from copy import deepcopy
import json
import numpy as np

from ..uncertainty import AbsoluteGaussianUncertainty, RelativeGaussianUncertainty, \
AbsoluteUniformUncertainty, RelativeUniformUncertainty, ModelUncertainty, \
Expand Down Expand Up @@ -350,10 +351,11 @@ def __eq__(self, other) -> bool:
return self.__f_inp_in == other.f_inp_in and self.__f_msx_in == other.f_msx_in \
and self.__general_params == other.general_params \
and self.__memory_consumption_estimate == other.memory_consumption_estimate \
and self.__sensor_config == other.sensor_config and self.__controls == other.controls \
and self.__sensor_config == other.sensor_config \
and np.all(self.__controls == other.controls) \
and self.__model_uncertainty == other.model_uncertainty \
and self.__system_events == other.system_events \
and self.__sensor_reading_events == other.sensor_reading_events
and np.all(self.__system_events == other.system_events) \
and np.all(self.__sensor_reading_events == other.sensor_reading_events)

def __str__(self) -> str:
return f"f_inp_in: {self.f_inp_in} f_msx_in: {self.f_msx_in} " + \
Expand Down

0 comments on commit fda6083

Please sign in to comment.