Skip to content

Added python infix functionality#11

Merged
CodeByDrescher merged 4 commits into
mainfrom
AddedPythonInfix
Mar 3, 2026
Merged

Added python infix functionality#11
CodeByDrescher merged 4 commits into
mainfrom
AddedPythonInfix

Conversation

@CodeByDrescher

@CodeByDrescher CodeByDrescher commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Exposes VCell's Expression.infix_Python() through the native GraalVM layer as a callable Python API, converting VCell expression syntax to Python-compatible infix (e.g. ^**, csc(x)1.0/math.sin(x)).

Changes

  • Python APIvcell_infix_to_python_infix(vcell_infix: str) -> tuple[bool, str, str] added to model_utils.py and exported from libvcell
  • Native entrypointvcellInfixToPythonInfix @CEntryPoint in Entrypoints.java wraps ModelUtils.get_python_infix() with buffer-size safety and exception handling
  • XmlHelper.cloneUsingXML = true – set consistently in all model/solver utility entry methods (was missing, causing cloning failures)
  • CI – macOS runners bumped to macos-15 / macos-15-intel

Usage

from libvcell import vcell_infix_to_python_infix

success, msg, python_expr = vcell_infix_to_python_infix("id_1 * csc(id_0 ^ 2.2)")
# python_expr == "(id_1 * (1.0/math.sin(((id_0)**(2.2)))))"

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@jcschaff

jcschaff commented Mar 3, 2026

Copy link
Copy Markdown
Member

@copilot we need a good PR description

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown

@jcschaff I've opened a new pull request, #13, to work on those changes. Once the pull request is ready, I'll request review from you.

@jcschaff jcschaff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went through it with Logan, looks good - my comments are already incorporated.

@CodeByDrescher CodeByDrescher merged commit 1fa96c6 into main Mar 3, 2026
6 checks passed
@CodeByDrescher CodeByDrescher deleted the AddedPythonInfix branch March 3, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyVCell should support VCell-classic's new python-style infixes

3 participants