Repository navigation
Read the model adapter from model_adapter.toml, shared with geckopy - #1
Merged
Merged
Conversation
A project's parameters can now live in model_adapter.toml, so one file
configures GECKO and geckopy. ModelAdapterManager.getAdapter and setDefault
take the project folder or the TOML file and return a TomlAdapter; adapter
classes keep working as before.
- readAdapterToml and writeAdapterToml read and write the subset of TOML
that adapters use, with an error naming the line for anything else.
- loadAdapterParams maps the snake_case keys to GECKO's field names and
fills geckopy's defaults, both from adapterParameters.tsv, and rejects
unknown keys. Evotune source groups become kcatSources and
sigma0logSource.
- TomlAdapter takes spontaneous reactions from [spontaneous] and the
anaerobic and protein-content functions from [matlab]; parameters only
GECKO uses go under [matlab.params]. A class that needs more code can
subclass TomlAdapter.
- convertAdapterToToml writes an existing adapter class to
model_adapter.toml and lists the methods it cannot carry over.
- createGECKOproject writes model_adapter.toml by default
('adapterFormat','class' for the old template).
- The full_ecModel tutorial uses model_adapter.toml; HumanGEMAdapter in
light_ecModel subclasses TomlAdapter. It now marks all 14 reactions that
data/spontaneousReactions.tsv flags as spontaneous; the old class found
one.
Original-commit: SysBioChalmers/GECKO@5b32cf6
Unit test results60 tests 60 ✅ 8s ⏱️ Results for commit 34052a0. ♻️ This comment has been updated with latest results. |
edkerk
force-pushed
the
feat/toml-adapter
branch
from
October 16, 2026 23:52
27ba381 to
34052a0
Compare
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.
Copied from SysBioChalmers/GECKO#486, opened by edkerk on 2026-10-15.
A project's model adapter can now be
model_adapter.toml, the file geckopy reads, so one file configures GECKO and geckopy. Adapter classes keep working. See CompMetEng/raven-gecko-parity#132.Loading
ModelAdapterManager.getAdapterandsetDefaulttake the project folder, itsmodel_adapter.toml, or an adapter class.mfile as before.TomlAdapter.New functions (
src/model_adapter/)readAdapterToml,writeAdapterTomlloadAdapterParamsadapterParameters.tsv. Unknown keys are errors, as in geckopy. Paths are relative to the project folder. Evotune source groups becomekcatSourcesandsigma0logSource.TomlAdapter[spontaneous](name_contains,file). The anaerobic and protein-content functions used during tuning from[matlab]. Parameters only GECKO uses from[matlab.params]. A project that needs more code subclassesTomlAdapter.convertAdapterToTomlmodel_adapter.toml, keeping parameters without a geckopy name under[matlab.params]. Lists the methods it cannot carry over, with what to use instead.Project creation:
createGECKOprojectwritesmodel_adapter.tomlfromadapterTemplate.toml.'adapterFormat','class'gives the class template.Tutorials
full_ecModelusesmodel_adapter.toml;YeastGEMAdapter.mis removed. The parameters are identical, and the same 6 reactions of yeast-GEM are spontaneous.light_ecModel'sHumanGEMAdaptersubclassesTomlAdapterand keepsgetHumanGEMRootPath. The parameters are identical. All 14 reactions thatdata/spontaneousReactions.tsvmarks are now spontaneous; the class found one.Tests
test/unit_tests/adapterTomlTests.m(tc0061–tc0068) covers:TestGEMAdapterand a legacy-style class and loading the result back to the same parameters;ecYeastGEM/model_adapter.toml.develop3, GLPK).geckopy accepts the
[spontaneous]and[matlab]sections in CompMetEng/geckopy#61.