Skip to content
Snippets Groups Projects
Commit 5d0c0fa5 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Apply suggestions from review

parent b4f97ba3
No related branches found
No related tags found
1 merge request!1055[Jungfrau][FF] Improve Fitting performance and stop using pydetlib + many refactors.
......@@ -68,8 +68,8 @@ def chunk_multi(data, block_size):
for j in range(0, cols, chunk_cols):
chunk = data[
...,
i:min(i+chunk_rows, rows),
j:min(j+chunk_cols, cols)
i: i+chunk_rows,
j: j+chunk_cols
]
chunks.append(chunk)
......@@ -96,7 +96,7 @@ def fill_histogram(image_data, histogram_bins):
if not isinstance(image_data, np.ndarray):
raise TypeError("Expected imgs numpy ndarray type.")
if image_data.ndim < 4:
if image_data.ndim != 4:
raise ValueError("Expected 4D imgs array.")
n_cells, n_rows, n_cols = image_data.shape[1:]
......@@ -218,7 +218,7 @@ def rebin_histo(hist, bin_centers, rebin_factor):
x_out = bin_centers[::rebin_factor]
h_out = np.sum(
hist[:len(hist) - (len(hist) % rebin_factor)].reshape(-1, rebin_factor), # noqa
hist.reshape(-1, rebin_factor),
axis=1,
)
x_out = bin_centers[::rebin_factor]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment