From 0df50ffc5e6f6da0d7771405f479e6ae7d5ad379 Mon Sep 17 00:00:00 2001 From: Zisis Eleftherios Date: Mon, 25 Mar 2024 11:40:02 +0100 Subject: [PATCH] Make lint happy --- atlas_densities/densities/fitting.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/atlas_densities/densities/fitting.py b/atlas_densities/densities/fitting.py index 51ae690..0097b7d 100644 --- a/atlas_densities/densities/fitting.py +++ b/atlas_densities/densities/fitting.py @@ -26,7 +26,6 @@ import numpy as np import pandas as pd from atlas_commons.typing import AnnotationT, BoolArray, FloatArray -from joblib import Parallel, delayed from scipy.optimize import curve_fit from tqdm import tqdm @@ -283,9 +282,7 @@ def _compute_average_intensities_helper(index, gene_marker_volumes, id_): if count <= 0: continue - mean_density = ( - index.ravel(intensity["intensity"])[voxel_ids][mask_voxels].sum() / count - ) + mean_density = index.ravel(intensity["intensity"])[voxel_ids][mask_voxels].sum() / count if mean_density == 0.0: L.warning("Mean density for id=%s and marker=%s", id_, marker) @@ -316,9 +313,7 @@ def __init__(self, values): self._order = "C" if values.flags["C_CONTIGUOUS"] else "F" values = values.ravel(order=self._order) - uniques, codes, counts = np.unique( - values, return_inverse=True, return_counts=True - ) + uniques, codes, counts = np.unique(values, return_inverse=True, return_counts=True) offsets = np.empty(len(counts) + 1, dtype=np.uint64) offsets[0] = 0 @@ -349,9 +344,7 @@ def value_to_1d_indices(self, value): return np.array([], dtype=np.uint64) group_index = self._mapping[value] - return self._indices[ - self._offsets[group_index] : self._offsets[group_index + 1] - ] + return self._indices[self._offsets[group_index] : self._offsets[group_index + 1]] def compute_average_intensities(