From 4fa276c97fa9ae2d434ec51406c2a03ed78f8f90 Mon Sep 17 00:00:00 2001 From: Neil Shephard Date: Thu, 12 Sep 2024 08:57:02 +0100 Subject: [PATCH] chore: fix linting errors Fixes a bunch of linting errors, some notes left in place for tasks to be completed (e.g. see #899). --- topostats/io.py | 2 +- topostats/processing.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/topostats/io.py b/topostats/io.py index db1766ede2..816cc1be70 100644 --- a/topostats/io.py +++ b/topostats/io.py @@ -1079,7 +1079,7 @@ def dict_to_hdf5(open_hdf5_file: h5py.File, group_path: str, dictionary: dict) - try: open_hdf5_file[group_path + key] = item except Exception as e: - LOGGER.info(f"Cannot save key '{key}' to HDF5. Item type: {type(item)}. Skipping. {e}") + LOGGER.warning(f"Cannot save key '{key}' to HDF5. Item type: {type(item)}. Skipping. {e}") def hdf5_to_dict(open_hdf5_file: h5py.File, group_path: str) -> dict: diff --git a/topostats/processing.py b/topostats/processing.py index 1c23b6a959..34d9b028b1 100644 --- a/topostats/processing.py +++ b/topostats/processing.py @@ -236,7 +236,7 @@ def run_grains( # noqa: C901 return grain_masks # Otherwise, return None and warn grainstats is disabled - LOGGER.info(f"[{filename}] Detection of grains disabled, returning empty data frame.") + LOGGER.info(f"[{filename}] Detection of grains disabled, GrainStats will not be run.") return None @@ -612,7 +612,6 @@ def run_ordered_tracing( image: npt.NDArray, disordered_tracing_data: dict, nodestats_data: dict, - pixel_to_nm_scaling: float, filename: str, core_out_path: Path, tracing_out_path: Path, @@ -631,8 +630,6 @@ def run_ordered_tracing( Dictionary of skeletonised and pruned grain masks. Result from "run_disordered_tracing". nodestats_data : dict Dictionary of images and statistics from the NodeStats analysis. Result from "run_nodestats". - pixel_to_nm_scaling : float - Scaling factor for converting pixel length scales to nanometers, i.e. the number of pixels per nanometres (nm). filename : str Name of the image. core_out_path : Path @@ -677,7 +674,6 @@ def run_ordered_tracing( disordered_tracing_direction_data=disordered_tracing_direction_data, nodestats_direction_data=nodestats_data[direction], filename=filename, - pixel_to_nm_scaling=pixel_to_nm_scaling, **ordered_tracing_config, ) @@ -1012,7 +1008,6 @@ def process_scan( image=topostats_object["image_flattened"], disordered_tracing_data=topostats_object["disordered_traces"], nodestats_data=nodestats, - pixel_to_nm_scaling=topostats_object["pixel_to_nm_scaling"], filename=topostats_object["filename"], core_out_path=core_out_path, tracing_out_path=tracing_out_path,