Skip to content

Commit

Permalink
Use np.reshape function instead of .reshape method.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 10, 2024
1 parent 7027768 commit 3a5609f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion colour_datasets/loaders/jiang2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def load(self) -> Dict[str, RGB_CameraSensitivities]:

for camera, values in self._content.items():
self._content[camera] = RGB_CameraSensitivities(
np.transpose(as_float_array(values).reshape([3, 33])),
np.transpose(np.reshape(as_float_array(values), (3, 33))),
shape.range(),
name=camera,
)
Expand Down
4 changes: 2 additions & 2 deletions colour_datasets/loaders/luo1999.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def load(self) -> Dict[str, CorrespondingColourDataset_Luo1999]:
20,
"D65",
"D65",
np.repeat([10, 50, 1000, 3000], 2, -1).reshape(-1, 2),
np.reshape(np.repeat([10, 50, 1000, 3000], 2, -1), (-1, 2)),
np.tile(20, [4, 2]),
"S",
"Refl.",
Expand All @@ -218,7 +218,7 @@ def load(self) -> Dict[str, CorrespondingColourDataset_Luo1999]:
19,
"D65",
"D65",
np.repeat([10, 50, 1000, 3000], 2, -1).reshape(-1, 2),
np.reshape(np.repeat([10, 50, 1000, 3000], 2, -1), (-1, 2)),
np.tile(20, [4, 2]),
"S",
"Refl.",
Expand Down
4 changes: 2 additions & 2 deletions colour_datasets/loaders/xrite2016.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def load(self) -> Dict[str, ColourChecker]:

i, j = (6, 4) if len(samples_data) == 24 else (14, 10)
samples = np.transpose(
np.array(samples_data, dtype=object).reshape([i, j, 2]),
np.reshape(np.array(samples_data, dtype=object), (i, j, 2)),
[1, 0, 2],
)
keys, values = zip(*samples.reshape([-1, 2]))
keys, values = zip(*np.reshape(samples, (-1, 2)))
values = XYZ_to_xyY(Lab_to_XYZ(values, illuminant))
self._content[key] = ColourChecker(
key, dict(zip(keys, values)), illuminant, j, i
Expand Down

0 comments on commit 3a5609f

Please sign in to comment.