Skip to content

Add cached app/config accessors in bionetgen.main - #96

Merged
jrfaeder merged 2 commits into
RuleWorld:mainfrom
wshlavacek:main-app-accessors
May 12, 2026
Merged

Add cached app/config accessors in bionetgen.main#96
jrfaeder merged 2 commits into
RuleWorld:mainfrom
wshlavacek:main-app-accessors

Conversation

@wshlavacek

Copy link
Copy Markdown
Contributor

Summary

  • Add cached app and config accessors in bionetgen.main.
  • Rename the exported accessor to get_default_app and add focused tests for caching and default bngpath lookup.
  • Keep this PR limited to the accessor lane and leave deferred app setup changes for later work.

Testing

  • uv run python -m pytest -q tests/test_main_accessors.py tests/test_bionetgen.py -k 'bionetgen_help or test_main_accessors'
  • uvx black --check bionetgen/main.py tests/test_main_accessors.py

@jrfaeder
jrfaeder merged commit d88b139 into RuleWorld:main May 12, 2026
17 checks passed
@wshlavacek
wshlavacek deleted the main-app-accessors branch May 15, 2026 15:14
jrfaeder pushed a commit that referenced this pull request Jul 20, 2026
* Replace ast.literal_eval with regex parser for ontology keys

This commit removes the use of `ast.literal_eval` when parsing keys from external JSON ontology files in `bionetgen/atomizer/atomizer/detectOntology.py`. It introduces a custom, robust regex-based parser `_parse_pattern_key` that explicitly extracts and validates string components of the tuple keys before evaluating them, mitigating the risk of Denial of Service (DoS) via arbitrary or deeply nested AST evaluation from untrusted inputs.

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

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

---------

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