Skip to content

Commit

Permalink
Update for lint rule D413 (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jan 30, 2024
1 parent 1cfae70 commit 4842be8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions histomicstk/cli/NucleiClassification/NucleiClassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def set_reference_values(args):
Returns:
-------
dict: Updated configuration parameters with reference values set.
"""
args.reference_mu_lab = [8.63234435, -0.11501964, 0.03868433]
args.reference_std_lab = [0.57506023, 0.10403329, 0.01364062]
Expand Down Expand Up @@ -118,6 +119,7 @@ def process_feature_and_annotation(args):
Returns:
-------
tuple: A tuple containing nuclei annotations (list) and feature data (Dask DataFrame).
"""
print('>> Generating features and annotation')

Expand Down Expand Up @@ -197,6 +199,7 @@ def read_feature_file(args):
Returns:
-------
dask.dataframe.DataFrame: A Dask DataFrame containing the nuclei feature data.
"""
fname, feature_file_format = os.path.splitext(args.inputNucleiFeatureFile)

Expand Down
2 changes: 2 additions & 0 deletions histomicstk/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def get_region_polygons(region):
-------
polygons: list
A list of lists of x, y tuples.
"""
if len(region) % 2 or len(region) < 4:
msg = 'region must be 4, 6, or a list of 2n values.'
Expand Down Expand Up @@ -338,6 +339,7 @@ def polygons_to_binary_mask(polygons, x=0, y=0, width=None, height=None):
mask: numpy.array
A 1-bit numpy array where 1 is inside an odd number of polygons. This
can return None if polygons was None.
"""
import PIL.Image
import PIL.ImageChops
Expand Down
3 changes: 3 additions & 0 deletions histomicstk/segmentation/label/remove_overlap_nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def create_polygon(coordinates):
Returns:
-------
shapely.geometry.Polygon: The polygon created from the points.
"""
return shapely.geometry.Polygon(coordinates).buffer(0)

Expand All @@ -28,6 +29,7 @@ def convert_polygons_tobbox(nuclei_list):
-------
list: The modified 'nuclei_list', where each nuclei object has been transformed
to a bounding box representation.
"""
for nuclei in nuclei_list:
# Set 'type' property of the nuclei to 'rectangle'
Expand Down Expand Up @@ -68,6 +70,7 @@ def remove_overlap_nuclei(nuclei_list, nuclei_format, return_selected_nuclei=Fal
-------
output_list (list): New list with overlapping nuclei removed.
selected_nuclei (list, optional): Indices of selected nuclei.
"""
polygons = [create_polygon(nuclei['points']) for nuclei in nuclei_list]

Expand Down
1 change: 1 addition & 0 deletions histomicstk/segmentation/nuclear/detect_tile_nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def detect_tile_nuclei(tile_info, args, src_mu_lab=None,
-------
nuclei_annot_list (list): List of nuclei annotations.
fdata: Computed nuclei features.
"""
# Flags
single_channel = False
Expand Down

0 comments on commit 4842be8

Please sign in to comment.