fix: Thermo Skanit - Initialize plate_well_count to prevent UnboundLocalError#1156
Merged
Merged
Conversation
…calError 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>
nathan-stender
force-pushed
the
fix/thermo-skanit-plate-well-count
branch
from
March 25, 2026 20:44
37456fb to
34a308c
Compare
… changes The detect-changes workflow was failing when only source files (no test files) were modified because grep returns exit code 1 when no matches are found. With GitHub Actions' default 'set -e' behavior, this caused the script to exit immediately. Added '|| true' to grep commands that might not find matches to ensure the script continues even when there are no test file changes or empty results. This fixes the issue preventing CI from running on single-parser PRs. Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
ajcariaga16
approved these changes
Mar 25, 2026
This was referenced Mar 26, 2026
nathan-stender
added a commit
that referenced
this pull request
Mar 27, 2026
### Added - MSD Workbench - Update support for CSV format and Calc Conc CV handling (#1157) - Add XLSX support to MSD Workbench parser (#1154) ### Fixed - Thermo Skanit - Initialize plate_well_count to prevent UnboundLocalError (#1156) - AppBio QuantStudio Design & Analysis - Check for valid rq values before setting r_sample and r_target (#1138)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plate_well_countto 0 at the start of each plate iteration to ensure the variable is always definedProblem
When the Thermo Skanit parser processes a plate where all wavelength DataFrames are empty (no valid data), the
plate_well_countvariable was never assigned a value. This caused an UnboundLocalError at line 379 when trying to accessplate_well_counts[plate_id].Solution
Initialize
plate_well_count = 0at the beginning of each plate iteration. This ensures the variable is always defined even when no valid wavelength data is found.This approach 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. The field is required in the ASM schema and will be made optional in a future version.
Test plan
🤖 Generated with Claude Code