Skip to content

Commit

Permalink
silencing mypy errors with type: ignore, to pass PR automatic checks
Browse files Browse the repository at this point in the history
  • Loading branch information
shachafl committed Mar 21, 2024
1 parent b115d8e commit 5fc78d2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion starfish/core/_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _max_intensity_table_maintain_dims(
initial_dimensions = OrderedDict(intensity_table.sizes)
projected_intensities = intensity_table.max(str_dimensions)
expanded_intensities = projected_intensities.expand_dims(str_dimensions)
return expanded_intensities.transpose(*tuple(initial_dimensions.keys()))
return expanded_intensities.transpose(*tuple(initial_dimensions.keys())) # type: ignore


def _mask_low_intensity_spots(
Expand Down
2 changes: 1 addition & 1 deletion starfish/core/codebook/codebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Codebook(xr.DataArray):
@property
def code_length(self) -> int:
"""return the length of codes in this codebook"""
return int(np.dot(*self.shape[1:]))
return int(np.dot(*self.shape[1:])) # type: ignore[call-overload]

@classmethod
def zeros(cls, code_names: Sequence[str], n_round: int, n_channel: int):
Expand Down
2 changes: 1 addition & 1 deletion starfish/core/image/Filter/match_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _compute_reference_distribution(self, data: ImageStack) -> xr.DataArray:
stacked = data.xarray.stack(chunk_key=chunk_key)
stacked = stacked.stack(sort_key=sort_key)

sorted_stacked = stacked.groupby("sort_key").map(np.sort)
sorted_stacked = stacked.groupby("sort_key").map(np.sort) # type: ignore[arg-type]
reference = sorted_stacked.mean("sort_key")
reference = reference.unstack("chunk_key")
return reference
Expand Down
2 changes: 1 addition & 1 deletion starfish/core/morphology/binary_mask/binary_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def _apply_single_mask(
selection_range: Sequence[slice] = BinaryMaskCollection._crop_mask(output_mask)

return MaskData(
output_mask[selection_range],
output_mask[selection_range], # type: ignore[index]
tuple(selection.start for selection in selection_range),
None
)
Expand Down
2 changes: 1 addition & 1 deletion starfish/core/test/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def select_uint_dtype(array):

image = image * camera_detection_efficiency

image += np.random.normal(scale=background_electrons, size=image.shape)
image += np.random.normal(scale=background_electrons, size=image.shape) # type: ignore

# mimic analog to digital conversion
image = (image / graylevel).astype(int).clip(0, 2 ** ad_conversion_bits)
Expand Down

0 comments on commit 5fc78d2

Please sign in to comment.