Skip to content

Commit

Permalink
PEP8 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRyanIrish committed Jun 15, 2018
1 parent f9863f5 commit 50200a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions ndcube/mixins/sequence_plotting.py
Expand Up @@ -1024,7 +1024,7 @@ def __init__(self, seq, plot_axis_index=None, axis_ranges=None, unit_x_axis=None
# If extra coord is same for each cube, storing
# values as single 1D axis range will suffice.
if ((np.array(x_axis_coords) == x_axis_coords[0]).all() and
(len(extra_coord_axes) == 1)):
(len(extra_coord_axes) == 1)):
x_axis_coords = x_axis_coords[0]
else:
# Else if all axes are not dependent, create an array of x-axis
Expand Down Expand Up @@ -1172,7 +1172,8 @@ def __init__(self, seq, plot_axis_index=None, axis_ranges=None, unit_x_axis=None
cubes_with_mask = np.array([False if cube.mask is None else True for cube in seq.data])
if cubes_with_mask.any():
if cubes_with_mask.all():
mask_concat = np.concatenate([cube.mask for cube in seq.data], axis=seq._common_axis)
mask_concat = np.concatenate(
[cube.mask for cube in seq.data], axis=seq._common_axis)
else:
masks = []
for i, cube in enumerate(seq.data):
Expand Down
9 changes: 5 additions & 4 deletions ndcube/tests/test_sequence_plotting.py
Expand Up @@ -181,7 +181,7 @@
common_axis=common_axis)

seq_with_some_masks = NDCubeSequence(data_list=[cube1_with_mask, cube3, cube1, cube3_with_mask],
common_axis=common_axis)
common_axis=common_axis)

seqm = NDCubeSequence(data_list=[cubem1, cubem3, cubem1, cubem3], common_axis=common_axis)

Expand Down Expand Up @@ -225,7 +225,7 @@

userrangequantity_none_axis_ranges_axis0_1e7 = [
(np.arange(int(seq.dimensions[0].value)) * u.J).to(u.erg).value, np.array([0., 1., 2.]),
np.arange(0, 4), np.arange(0, int(seq.dimensions[-1].value)+1)]
np.arange(0, 4), np.arange(0, int(seq.dimensions[-1].value)+1)]

hi2_none_axis_ranges_axis2 = [
np.arange(0, len(seq.data)+1), np.array([0., 1., 2.]),
Expand All @@ -238,7 +238,7 @@
x_axis_coords1[2, 1] = 1.
x_axis_coords1[3, 0] = 2.
x_axis_coords1[3, 1] = 3.
pix1_none_axis_ranges_axis1 = [
pix1_none_axis_ranges_axis1 = [
np.arange(0, len(seq.data)+1), x_axis_coords1, np.arange(0, 4),
np.arange(0, int(seq.dimensions[-1].value)+1)]

Expand All @@ -249,7 +249,8 @@
seq[:, :, :, 0].data[0].axis_world_coords()[-1][-1].value]

# Derive expected axis_ranges for cube-like cases.
cube_like_new_x_axis_coords2_shape = u.Quantity(seq.cube_like_dimensions, unit=u.pix).value.astype(int)
cube_like_new_x_axis_coords2_shape = u.Quantity(
seq.cube_like_dimensions, unit=u.pix).value.astype(int)
cube_like_new_x_axis_coords2_shape[-1] = 1
cubelike_none_axis_ranges_axis2 = [
np.arange(0, int(seq.cube_like_dimensions[0].value)+1), np.arange(0, 4),
Expand Down

0 comments on commit 50200a4

Please sign in to comment.