Skip to content

Commit 34a308c

Browse files
fix: Thermo Skanit - Initialize plate_well_count to prevent UnboundLocalError
When processing plates with empty wavelength data, the plate_well_count variable was never assigned, causing an UnboundLocalError when trying to access it later. This fix initializes plate_well_count to 0 at the start of each plate iteration, ensuring the variable is always defined even when no valid data is found. This follows the established pattern in other parsers (e.g., QIAcuity dPCR) where 0 is used as a fallback value when plate well count cannot be determined, since the field is required in the ASM schema. Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
1 parent a89c1f7 commit 34a308c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ def create(
321321
plate_well_counts: dict[str, int] = {}
322322

323323
for plate in plates:
324+
plate_well_count = 0 # Initialize to 0 in case no valid data is found
324325
for wavelength, data_df in plate.wavelength_data.items():
325326
if data_df.empty:
326327
continue

0 commit comments

Comments
 (0)