Skip to content

Dev - #67

Merged
llegregam merged 4 commits into
masterfrom
dev
Oct 9, 2026
Merged

Dev#67
llegregam merged 4 commits into
masterfrom
dev

Conversation

@llegregam

Copy link
Copy Markdown
Collaborator

Fix AIC fallback and report unknown model names (3.4.1)

Why

Two small bugs found while preparing the Galaxy wrapper update for Workflow4Metabolomics:

  • When there are too few measurements for the AIC small-sample correction, the CLI and GUI set the fallback with fitter.aic, fitter.aic_c = "NA". That unpacks the string, so aic becomes "N" and aic_c becomes "A". The reports print no AIC in that case, so nothing visible was wrong, but the values on the fitter were.
  • IoHandler.select_model() returned None for an unknown model name (for example a typo in the YAML config). The failure then showed up later as an unrelated AttributeError.

What

  • aic_test() now checks the sample size first and, if there are too few measurements, sets both aic and aic_c to "NA" before raising its usual ValueError. The broken assignments in ui/cli.py and ui/gui.py are removed.
  • select_model() raises a ValueError that names the unknown model and lists the available ones.
  • Two new tests in tests/test_base.py cover both cases. I also imported physiofit.base.io there so the file's tests run on their own.
  • A separate commit bumps the version to 3.4.1.

Testing

All 18 tests pass (16 existing, 2 new), and flake8 is clean on the changed files. The two new tests failed before the fix.

llegregam and others added 4 commits November 30, 2025 21:09
Merge pull request #64 from MetaSys-LISBP/dev
- The CLI and GUI set the AIC fallback with
  `fitter.aic, fitter.aic_c = "NA"`, which unpacks the string into "N"
  and "A". aic_test() now sets both to "NA" itself before raising, and
  the broken assignments are removed
- select_model() returned None for an unknown model name, which surfaced
  later as an AttributeError; it now raises a ValueError listing the
  available models
- Add tests for both, and import physiofit.base.io in test_base so its
  tests also run on their own

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@llegregam
llegregam merged commit c6d2d81 into master Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant