Repository navigation
Conversation
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>
Fix/aic and model selection
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.
Fix AIC fallback and report unknown model names (3.4.1)
Why
Two small bugs found while preparing the Galaxy wrapper update for Workflow4Metabolomics:
fitter.aic, fitter.aic_c = "NA". That unpacks the string, soaicbecomes"N"andaic_cbecomes"A". The reports print no AIC in that case, so nothing visible was wrong, but the values on the fitter were.IoHandler.select_model()returnedNonefor an unknown model name (for example a typo in the YAML config). The failure then showed up later as an unrelatedAttributeError.What
aic_test()now checks the sample size first and, if there are too few measurements, sets bothaicandaic_cto"NA"before raising its usualValueError. The broken assignments inui/cli.pyandui/gui.pyare removed.select_model()raises aValueErrorthat names the unknown model and lists the available ones.tests/test_base.pycover both cases. I also importedphysiofit.base.iothere so the file's tests run on their own.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.