Skip to content

Commit

Permalink
[#158252633]: Fix typos, optimize list => tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
slobodan-ilic committed Jun 21, 2018
1 parent 66bb42d commit 52a2d01
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cr/cube/cube_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def _update_args(self, kwargs):
)
hs_dims = kwargs.get(hs_dims_key)
if isinstance(hs_dims, list):
# The point of this update is to keep the 2D illusion fot the user.
# If a user sees a 2D slice, he still needs to be able to address
# both dimensions (for which he wants the H&S included) as 0 and 1.
# Since these are offset by a 0 dimension in a 3D case, inside the
# cr.cube, we need to increase the indexes of the required dims.
# Keep the 2D illusion for the user. If a user sees a 2D slice, he
# still needs to be able to address both dimensions (for which he
# wants the H&S included) as 0 and 1. Since these are offset by a 0
# dimension in a 3D case, inside the cr.cube, we need to increase
# the indexes of the required dims.
kwargs[hs_dims_key] = [dim + 1 for dim in hs_dims]

return kwargs
Expand All @@ -100,7 +100,7 @@ def _update_result(self, result):
def _call_cube_method(self, method, *args, **kwargs):
kwargs = self._update_args(kwargs)
result = getattr(self._cube, method)(*args, **kwargs)
if method in ['labels', 'inserted_hs_indices']:
if method in ('labels', 'inserted_hs_indices'):
return result[-2:]
return self._update_result(result)

Expand Down

0 comments on commit 52a2d01

Please sign in to comment.