test: port invariants asserted by the raven-toolbox suite - #683
Merged
Conversation
The Python suite asserts behaviour on functions RAVEN also has, where the MATLAB tests only assert a type or a count. Ported the invariants that carry over; skipped everything resting on cobra object semantics, pandas or an API RAVEN does not have. manipulation: - convertToIrrev: a reversible reaction with bounds (-500,1000) keeps (0,1000) and its stoichiometry while the _REV copy gets (0,500) and the negated stoichiometry, and inherits the grRule. The existing test asserted only that every rev flag ended up 0, so the bound arithmetic — the only part that can be wrong — was untested. - findDuplicateRxns: a -> b and b -> a group by default and stay separate with ignoreDirection=false. The function's only parameter had no test. - changeGrRules: replace=false ORs onto the existing rule and adds the gene. Only replace=true was covered. - copyToComps: deleteOriginal makes it a move rather than a copy. - mergeModels: metParam decides whether the same metabolite under two ids unifies. The central design decision of the function had no test. conditions: applyCondition had one test, for bounds. Added the prelude reset, metabolite removal, the charge-balance recompute (the most numerically subtle line in the file) and the biomass delta adding to rather than replacing a coefficient.
Function test results250 tests 228 ✅ 1m 0s ⏱️ Results for commit 80138aa. |
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.
Main improvements in this PR:
Ports invariants the Python suite asserts on functions RAVEN also has, where the MATLAB tests assert only a type or a count. Test-only; no source changes.
tManipulation.m:convertToIrrevbound-splitting and grRule inheritance;findDuplicateRxnsignoreDirection(its only parameter, previously untested);changeGrRuleswithreplace=false;copyToCompswithdeleteOriginal;mergeModelsmetParamdeciding metabolite unification.tConditions.m: exchange reset, metabolite removal, the charge-balance recompute, and the biomass delta adding to rather than replacing a coefficient. This file previously had one test.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.