Skip to content

Commit

Permalink
fix(metrics): cast to float to compute luv_approx
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Jun 24, 2024
1 parent 65d27dd commit 8ef1e80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions phomo/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@


class MetricCallable(Protocol): # type: ignore
def __call__(self, master_chunk: np.ndarray, tile_arrays: np.ndarray) -> np.ndarray:
...
def __call__(
self, master_chunk: np.ndarray, tile_arrays: np.ndarray
) -> np.ndarray: ...


def register_metric(func):
Expand Down Expand Up @@ -107,6 +108,7 @@ def luv_approx(
arrays.
"""
r = (master_chunk[:, :, 0] + tile_arrays[:, :, :, 0]) // 2
r = r.astype(float)
d = np.subtract(master_chunk, tile_arrays, dtype=float)
return np.linalg.norm(
(
Expand Down

0 comments on commit 8ef1e80

Please sign in to comment.