Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Apr 29, 2024
1 parent 1a31152 commit a7f4e11
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 44 deletions.
92 changes: 48 additions & 44 deletions examples/Example_7_data_clustering.ipynb

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Utils for tests."""
import numpy as np
from copy import deepcopy


def _to_list(_data):
"""Convert dict to list with floats for yaml encoding."""
data = deepcopy(_data)
data.pop("NVI", None) # NVI computation is unstable, we don't test it
data.pop("ttprime", None) # ttprime computation is unstable, we don't test it
for key, val in data.items():
if isinstance(val, dict):
data[key] = _to_list(data[key])
if isinstance(val, (np.ndarray, list)):
data[key] = np.array(val, dtype=float).tolist()
return data

0 comments on commit a7f4e11

Please sign in to comment.