Skip to content

Commit

Permalink
chore: fix linting errors
Browse files Browse the repository at this point in the history
Fixes a bunch of linting errors, some notes left in place for tasks to be completed (e.g. see #899).
  • Loading branch information
ns-rse committed Sep 17, 2024
1 parent 7259eef commit 4fa276c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion topostats/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions topostats/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4fa276c

Please sign in to comment.