Skip to content

Commit

Permalink
[pre-commit.ci] Fixing issues with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2024
1 parent 9f59678 commit 6547c59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions topostats/grains.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,7 @@ def vet_class_sizes_single_grain(
continue

lower_threshold, upper_threshold = [
vetting_criteria[1:]
for vetting_criteria in class_size_thresholds
if vetting_criteria[0] == class_index
vetting_criteria[1:] for vetting_criteria in class_size_thresholds if vetting_criteria[0] == class_index
][0]

if lower_threshold is not None:
Expand Down Expand Up @@ -1669,9 +1667,7 @@ def extract_grains_from_full_image_tensor(

# Crop the tensor
# Get the bounding box for the region
flat_bounding_box: tuple[int, int, int, int] = tuple(
flat_region.bbox
) # min_row, min_col, max_row, max_col
flat_bounding_box: tuple[int, int, int, int] = tuple(flat_region.bbox) # min_row, min_col, max_row, max_col

# Pad the mask
padded_flat_bounding_box = pad_bounding_box(
Expand Down
8 changes: 2 additions & 6 deletions topostats/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,7 @@ def run_splining(
f"[{filename}] : No grains exist for the {direction} direction. Skipping disordered_tracing for {direction}."
)
splining_grainstats = create_empty_dataframe(column_set="grainstats", index_col="grain_number")
splining_molstats = create_empty_dataframe(
column_set="mol_statistics", index_col="molecule_number"
)
splining_molstats = create_empty_dataframe(column_set="mol_statistics", index_col="molecule_number")
raise ValueError(f"No grains exist for the {direction} direction")
# if grains are found
(
Expand Down Expand Up @@ -1195,9 +1193,7 @@ def process_scan(
else:
grainstats_df = create_empty_dataframe(column_set="grainstats", index_col="grain_number")
molstats_df = create_empty_dataframe(column_set="mol_statistics", index_col="molecule_number")
disordered_tracing_stats = create_empty_dataframe(
column_set="disordered_tracing_statistics", index_col="index"
)
disordered_tracing_stats = create_empty_dataframe(column_set="disordered_tracing_statistics", index_col="index")
height_profiles = {}

# Get image statistics
Expand Down

0 comments on commit 6547c59

Please sign in to comment.