Skip to content

Commit

Permalink
last min change
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Holt committed Aug 13, 2024
1 parent 03a15c3 commit 5d5d888
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mumax3c/scripts/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,20 @@ def unique_with_accuracy(array, accuracy=14):
if len(array.flat) <= 1:
return np.array(array.flat)
array_max = np.max(array)
return np.unique(np.round(array / array_max, decimals=accuracy)) * array_max
return (
np.unique(
np.round(
np.divide(
array,
array_max,
out=np.zeros_like(array),
where=not np.isclose(array_max, 0.0),
),
decimals=accuracy,
)
)
* array_max
)


def set_parameter(parameter, name, system, ovf_format="bin4", abspath=True):
Expand Down

0 comments on commit 5d5d888

Please sign in to comment.