Skip to content

Commit

Permalink
[#186925787]: Don't touch irrelevant files
Browse files Browse the repository at this point in the history
  • Loading branch information
slobodan-ilic committed Feb 7, 2024
1 parent f6f1dee commit b11e20f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/cr/cube/matrix/cubemeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,19 +808,20 @@ def factory(cls, cube, dimensions, slice_idx):
"""
if cube.means is None:
raise ValueError("cube-result does not contain cube-means measure")

def get_cube_means_cls(dim_types):
if dim_types == (DT.MR, DT.MR):
return _MrXMrCubeMeans
if dim_types[0] == DT.MR:
return _MrXCatCubeMeans
if dim_types[1] == DT.MR:
return _CatXMrCubeMeans
return _CatXCatCubeMeans

dimension_types = cube.dimension_types[-2:]
CubeMeansCls = get_cube_means_cls(dimension_types)

CubeMeansCls = (
_MrXMrCubeMeans
if dimension_types == (DT.MR, DT.MR)
else (
_MrXCatCubeMeans
if dimension_types[0] == DT.MR
else (
_CatXMrCubeMeans
if dimension_types[1] == DT.MR
else _CatXCatCubeMeans
)
)
)
return CubeMeansCls(
dimensions, cube.means[cls._slice_idx_expr(cube, slice_idx)]
)
Expand Down

0 comments on commit b11e20f

Please sign in to comment.