Skip to content

feat: reorganize repository into functional top-level folders#614

Merged
edkerk merged 2 commits into
develop3from
refactor/reorganize-folders
Jun 7, 2026
Merged

feat: reorganize repository into functional top-level folders#614
edkerk merged 2 commits into
develop3from
refactor/reorganize-folders

Conversation

@edkerk

@edkerk edkerk commented Jun 7, 2026

Copy link
Copy Markdown
Member

What

Reorganizes the whole repository so functions are grouped by the type of model work they
support, with top-level functional folders whose names mirror the raven-python module layout.
The 94-function core/ catch-all is retired and several oddly-scoped folders are renamed to
say what they do.

New top-level layout

Model operations (from core/):
manipulation/ (structural edits) · analysis/ (flux/solution analysis, simulation,
deletion/sampling) · gapfilling/ · tasks/ · comparison/ · biomass/ · queries/
(read-only getters, equation/formula construction, validation, printing)

Model building & integration:
reconstruction/{kegg,metacyc,homology} (was external/) · INIT/ (kept) · curation/ ·
conditions/ · annotation/ · localization/ · omics/ (was hpa/)

I/O & interchange: io/ (kept) · conversion/ (was struct_conversion/) · solver/

Visualization: visualization/ (was pathway/ + plotting/)

Low-level helpers fold into the existing utils/; findRAVENroot to installation/.
Mis-filed io/closeModel and io/sortIdentifiers (model edits, not I/O) move to manipulation/.

How

  • Every move via git mv (history preserved — use git log --follow).
  • Path setup is recursive genpath, so no install changes are needed beyond one root-detection
    regex in removeRavenFromPath.
  • The only hardcoded paths were data-folder references, rewritten accordingly:
    external/kegg|metacyc -> reconstruction/..., and the struct_conversion CSVs -> conversion/.

Verification (MATLAB R2024b, clean path)

  • checkFunctionUniqueness: Pass.
  • Every function resolves to its new location (which -all).
  • runRAVENtests: full suite passes except:
    • solverTests testGurobi/testSCIP/testCobra - those solvers are not installed in the test
      environment (environmental, unrelated to this change);
    • importExportTests/testYAMLexport - pre-existing on develop3: the >1290 bytes threshold
      is stale after the EC-code YAML change (fix: yaml eccode annotation handling #613). io/writeYAMLmodel.m is byte-identical to
      develop3, so moving files cannot affect this assertion.

Notes

edkerk added 2 commits June 7, 2026 21:37
Split the 94-function core/ catch-all into purpose-based top-level folders,
matching how RAVEN already separates io/, solver/, INIT/ and mirroring the
raven-python module layout:

- manipulation/ : structural model edits (add/change/remove/convert/merge)
- analysis/     : flux & solution analysis, simulation, deletion studies
- gapfilling/   : gap detection & filling, production/consumption checks
- tasks/        : metabolic-task definition & checking
- comparison/   : multi-model comparison
- biomass/      : biomass composition & maintenance-energy fitting
- queries/      : read-only getters, equation/formula construction,
                  structure validation, model printing
- reconstruction/, curation/, annotation/, conditions/, localization/ :
                  seeded with their core members (extended in a later step)

Low-level helpers (dispEM, convertCharArray, parallelPoolRAVEN, printOrange)
move to utils/; findRAVENroot to installation/ alongside the path setup.
Mis-filed io/closeModel and io/sortIdentifiers (model edits, not I/O) move to
manipulation/. core/ is removed.

All moves via git mv (history preserved). MATLAB resolves functions by name and
path setup uses recursive genpath, so no path edits are required.
Complete the top-level reorganization started in the previous commit:

- external/ -> reconstruction/ with kegg/, metacyc/ and homology/ subfolders;
  BLAST/DIAMOND wrappers go to reconstruction/homology/, WoLF localization
  (getWoLFScores, parseScores) to localization/, updateDocumentation to
  installation/. Hardcoded data paths ('external','kegg' / 'external','metacyc')
  rewritten to the new location.
- struct_conversion/ -> conversion/ (ravenCobraWrapper, identifier prefixes,
  field ordering + the COBRA/order CSVs); MIRIAM editors (editMiriam,
  extractMiriam) to annotation/. CSV fopen paths rewritten.
- hpa/ -> omics/.
- pathway/ + plotting/ -> visualization/ (maps are passed by filename, so no
  path edits needed).
- io/loadDeltaGfromCSV, io/saveDeltaGtoCSV -> annotation/.
- removeRavenFromPath root-detection regex updated for the renamed folders.

Names mirror the raven-python module layout (reconstruction, omics, annotation,
localization, ...). Path setup uses recursive genpath, so no install changes are
needed beyond the one root-detection regex.
@edkerk edkerk changed the title Reorganize repository into functional top-level folders feat: reorganize repository into functional top-level folders Jun 7, 2026
@edkerk edkerk merged commit f1b08d8 into develop3 Jun 7, 2026
1 check failed
@edkerk edkerk deleted the refactor/reorganize-folders branch June 7, 2026 21:35
edkerk added a commit to SysBioChalmers/raven-python that referenced this pull request Jun 8, 2026
…20)

RAVEN moved its functions out of the core/ catch-all into purpose-based top-level
folders (SysBioChalmers/RAVEN#614). Repoint every RAVEN file path in the
cross-reference docs (IMPROVEMENTS.md, docs/reference/matlab_raven_backports.md):

- FSEOF / randomSampling / reporterMetabolites -> analysis/
- parseTaskList / checkTasks                   -> tasks/
- fillGaps                                      -> gapfilling/
- addRxns / changeRxns / standardizeGrRules     -> manipulation/
- getIndexes / checkModelStruct / getElementalBalance -> queries/
- getModelFromHomology                          -> reconstruction/homology/
- getKEGGModelForOrganism                       -> reconstruction/kegg/
- runINIT / ftINIT                              -> INIT/

Also corrects references that were stale even before the reorg (getKEGGModelForOrganism
was in external/kegg/) and points the proposed GPR-lint back-port findPotentialErrors at
manipulation/, alongside standardizeGrRules.

Doc-only: raven-python's module layout already matches RAVEN's new structure (it was the
template the reorg mirrored), so no code changes are needed.
edkerk added a commit to SysBioChalmers/raven-python that referenced this pull request Jun 9, 2026
Align the (stub) plotting subpackage with RAVEN's folder layout, where pathway +
plotting were unified into visualization/ (SysBioChalmers/RAVEN#614).

- src/raven_python/plotting/ -> src/raven_python/visualization/
- pyproject optional-dependency extra [plotting] -> [visualization] (matplotlib);
  CI (.github/workflows/ci.yml) and ReadTheDocs (.readthedocs.yaml) install lines
  updated to match so the renamed extra still resolves.
- docs updated: README, CHANGELOG, installation, docs/README, api/index, todo.

The subpackage is an unimplemented stub (empty __init__), so nothing imports it and
there is no behaviour change. Generic uses of the word "plotting" (seaborn / heatmap
prose) are left as-is.
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