From 34a308c69840271a38547728bac0fe643272b7d1 Mon Sep 17 00:00:00 2001 From: Nathan Stender Date: Wed, 25 Mar 2026 16:02:50 -0400 Subject: [PATCH 1/2] 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 --- src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py b/src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py index da2fc6e04..01f6dbfc9 100644 --- a/src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py +++ b/src/allotropy/parsers/thermo_skanit/thermo_skanit_structure.py @@ -321,6 +321,7 @@ def create( plate_well_counts: dict[str, int] = {} for plate in plates: + plate_well_count = 0 # Initialize to 0 in case no valid data is found for wavelength, data_df in plate.wavelength_data.items(): if data_df.empty: continue From bf5bfc57a12a5e087166b535e7f737af7c5eda9f Mon Sep 17 00:00:00 2001 From: Nathan Stender Date: Wed, 25 Mar 2026 17:09:09 -0400 Subject: [PATCH 2/2] fix: GitHub Actions - Fix detect-changes job failing on single parser 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 --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f6862151..ded678001 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,14 +57,14 @@ jobs: FILES=$(echo '${{ steps.filter.outputs.parsers_files }}' | jq -r '.[]') # Extract unique parser directories from both src and tests - SRC_PARSERS=$(echo "$FILES" | grep '^src/allotropy/parsers/' | cut -d'/' -f4 | grep -v '^utils$' | grep -v '^__pycache__$') - TEST_PARSERS=$(echo "$FILES" | grep '^tests/parsers/' | cut -d'/' -f3 | grep -v '^__pycache__$') + SRC_PARSERS=$(echo "$FILES" | grep '^src/allotropy/parsers/' | cut -d'/' -f4 | grep -v '^utils$' | grep -v '^__pycache__$' || true) + TEST_PARSERS=$(echo "$FILES" | grep '^tests/parsers/' | cut -d'/' -f3 | grep -v '^__pycache__$' || true) # Combine and get unique parsers - ALL_PARSERS=$(echo -e "$SRC_PARSERS\n$TEST_PARSERS" | sort -u | grep -v '^$') + ALL_PARSERS=$(echo -e "$SRC_PARSERS\n$TEST_PARSERS" | sort -u | grep -v '^$' || true) # Count unique parsers - PARSER_COUNT=$(echo "$ALL_PARSERS" | grep -v '^$' | wc -l) + PARSER_COUNT=$(echo "$ALL_PARSERS" | grep -v '^$' | wc -l || echo "0") if [[ $PARSER_COUNT -eq 1 ]]; then PARSER=$(echo "$ALL_PARSERS" | head -n1)