Skip to content

Commit

Permalink
Improve np.reshape call consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Nov 3, 2023
1 parent bcbe33a commit 42bcdca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion colour/io/luts/cinespace_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _parse_table_section(lines):
)
):
LUT = LUT3x1D(
domain=pre_LUT.reshape(3, 4).transpose()[0:2],
domain=pre_LUT.reshape([3, 4]).transpose()[0:2],
name=title,
comments=comments,
table=table,
Expand Down
6 changes: 3 additions & 3 deletions colour/plotting/diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ def lines_spectral_locus(
normal_l.append([normal, normal])
colour_l.append([ij_l, ij_l])

ij_w = as_float_array(ij_n).reshape(-1, 2)
normal_w = as_float_array(normal_l).reshape(-1, 2)
colours_w = as_float_array(colour_l).reshape(-1, 2)
ij_w = as_float_array(ij_n).reshape([-1, 2])
normal_w = as_float_array(normal_l).reshape([-1, 2])
colours_w = as_float_array(colour_l).reshape([-1, 2])

colour_w = normalise_maximum(
XYZ_to_plotting_colourspace(
Expand Down
6 changes: 3 additions & 3 deletions colour/plotting/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ def CCT_D_uv_to_plotting_colourspace(CCT_D_uv):
)
colour_itl.append(CCT_D_uv_to_plotting_colourspace(CCT_D_uv))

ij_l = as_float_array(ij_itl).reshape(-1, 2)
normal_l = as_float_array(normal_itl).reshape(-1, 2)
colour_l = as_float_array(colour_itl).reshape(-1, 3)
ij_l = as_float_array(ij_itl).reshape([-1, 2])
normal_l = as_float_array(normal_itl).reshape([-1, 2])
colour_l = as_float_array(colour_itl).reshape([-1, 3])

lines_l = zeros(
ij_l.shape[0],
Expand Down
4 changes: 2 additions & 2 deletions colour/quality/tm3018.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def colour_fidelity_index_ANSIIESTM3018(
np.floor(specification.colorimetry_data[1].JMh[:, 2] / 22.5)
)

bin_mask = bins == np.arange(16).reshape(-1, 1)
bin_mask = bins == np.arange(16).reshape([-1, 1])

# "bin_mask" is used later with Numpy broadcasting and "np.nanmean"
# to skip a list comprehension and keep all the mean calculation vectorised
Expand Down Expand Up @@ -186,7 +186,7 @@ def colour_fidelity_index_ANSIIESTM3018(

# Local colour fidelity indexes, i.e. 16 CFIs for each bin.
bin_delta_E_s = np.nanmean(
specification.delta_E_s.reshape(1, -1) * bin_mask, axis=1
specification.delta_E_s.reshape([1, -1]) * bin_mask, axis=1
)
R_fs = as_float_array(delta_E_to_R_f(bin_delta_E_s))

Expand Down

0 comments on commit 42bcdca

Please sign in to comment.