Skip to content

Commit

Permalink
fix flatvalues for median cube measure
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Jul 4, 2024
1 parent f87b128 commit d8be5a1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cr/cube/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,10 @@ def _flat_values(self) -> Optional[np.ndarray]:
measure_payload = self._cube_dict["result"].get("measures", {}).get("median")
if measure_payload is None:
return None
return np.array(
tuple(
np.nan if isinstance(x, dict) else x for x in measure_payload["data"]
),
dtype=np.float64,
).flatten()
data = np.array(measure_payload["data"]).flatten()
return np.where([isinstance(x, dict) for x in data], np.nan, data).astype(
np.float64
)


class _OverlapMeasure(_BaseMeasure):
Expand Down

0 comments on commit d8be5a1

Please sign in to comment.