Skip to content

Commit

Permalink
Replaces np.float by np.float64 since it was removed in numpy 1.24
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Jeandet <[email protected]>
  • Loading branch information
jeandet committed Dec 21, 2022
1 parent f11b4c9 commit d52febc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions speasy/core/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def to_dictionary(self, array_to_list=False) -> Dict[str, object]:
}

@staticmethod
def from_dictionary(dictionary: Dict[str, str or Dict[str, str] or List], dtype=np.float) -> "DataContainer":
def from_dictionary(dictionary: Dict[str, str or Dict[str, str] or List], dtype=np.float64) -> "DataContainer":
try:
return DataContainer(values=np.array(dictionary["values"], dtype=dtype), meta=dictionary["meta"],
name=dictionary["name"],
Expand Down Expand Up @@ -109,8 +109,8 @@ def __eq__(self, other: 'DataContainer') -> bool:
np.array_equal(self.__values, other.__values, equal_nan=True)

def replace_val_by_nan(self, val):
if self.__values.dtype != np.float:
self.__values = self.__values.astype(np.float)
if self.__values.dtype != np.float64:
self.__values = self.__values.astype(np.float64)
self.__values[self.__values == val] = np.nan

@property
Expand Down

0 comments on commit d52febc

Please sign in to comment.