Skip to content

Defer BioNetGen app setup in library imports#108

Merged
jrfaeder merged 1 commit into
RuleWorld:mainfrom
wshlavacek:defer-import-time-bng-setup
Jul 20, 2026
Merged

Defer BioNetGen app setup in library imports#108
jrfaeder merged 1 commit into
RuleWorld:mainfrom
wshlavacek:defer-import-time-bng-setup

Conversation

@wshlavacek

Copy link
Copy Markdown
Contributor

Summary

  • remove module-level BioNetGen().setup() from modelapi, network, and C simulator imports
  • resolve the default BNG path lazily when BNGFile is constructed without an explicit BNGPATH
  • pass explicit BNGPATH / suppress options through bngmodel -> BNGParser -> BNGFile
  • add regression coverage that importing library modules does not call Cement App.setup()

Tests

  • uvx black --check bionetgen/modelapi/bngfile.py bionetgen/modelapi/bngparser.py bionetgen/modelapi/model.py bionetgen/network/network.py bionetgen/network/networkparser.py bionetgen/simulator/csimulator.py tests/test_deferred_app_setup.py tests/test_csimulator_errors.py tests/test_modelapi_export_errors.py
  • .venv/bin/python -m pytest tests/test_deferred_app_setup.py tests/test_csimulator_errors.py tests/test_modelapi_export_errors.py tests/test_main_accessors.py -q

Local full-suite note

  • .venv/bin/python -m pytest -q currently reaches unrelated local environment failures for missing libsbml, missing/undiscovered BNG2.pl, and visualization output checks.

@jrfaeder
jrfaeder merged commit 55b21d6 into RuleWorld:main Jul 20, 2026
17 checks passed
jrfaeder pushed a commit that referenced this pull request Jul 20, 2026
…on (#108)

* Optimize getSpeciesFromFileName in NamingDatabase by batching queries.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>

* chore: PR #108 remove forbidden artifacts and run black

* chore: remove generated artifact files from PR #108

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
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.

2 participants