Skip to content

Add scaffolding for SBML and python wrappers#4

Open
kwabenantim wants to merge 55 commits into
mainfrom
pychaste_template
Open

Add scaffolding for SBML and python wrappers#4
kwabenantim wants to merge 55 commits into
mainfrom
pychaste_template

Conversation

@kwabenantim

Copy link
Copy Markdown
Member

Supports #3

kwabenantim and others added 29 commits June 16, 2026 14:16
When setup_project.py is run with Python bindings opted in, it:
- Substitutes the project name into dynamic/config.yaml and
  dynamic/CMakeLists.txt, which set up CPPWG-based wrapper generation
- Renames src/py/template_project/ to src/py/<project_name>/ and
  substitutes the project name into the Python package files
- Leaves dynamic/ and src/py/ in place for the build system to use

When opted out, dynamic/ and src/py/ are removed.

The build scripts are extended accordingly:
- common.sh auto-detects Chaste_ENABLE_PYCHASTE from dynamic/config.yaml
  and guards against CHASTE_BUILD_DIR pointing at the project root
- configure.sh passes Chaste_ENABLE_PYCHASTE to cmake
- compile.sh builds pychaste then _<project>_all when pychaste is enabled,
  or the C++ project library only when it is not
- install.sh (new) creates .virtualenv/ and pip-installs the pychaste and
  project Python packages from the build directory
- .github/workflows/test-python-project.yml (new) tests the full pipeline
  using the chaste/develop container

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kwabenantim kwabenantim requested a review from Copilot June 23, 2026 09:33
@kwabenantim

kwabenantim commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

This currently needs hardening for cases where errors in config.yaml cause configuration to fail. Re-running the config to regenerate wrappers can fail persistently.

Some potential steps to address this:

  • Remove the "if wrappers already exist, don't regenerate them" gating in CMakeLists.txt. This setting was fine in main Chaste where wrappers don't change too often, but may not be a good idea in a user project where wrappers may change constantly during development.
  • Throw a warning if no wrappers were generated. This will make it easier to diagnose errors further down when trying to make a compile target for the wrappers with no source files.
  • Add more documentation on what to do when user runs into problems with generating / compiling wrappers in a python bindings template.

@kwabenantim

Copy link
Copy Markdown
Member Author

This also needs to work outside a chaste docker environment where the extra pychaste dependencies are preinstalled.

Potential steps to address this:

  • Add user docs explaining which extra dependencies need to be installed for creating python bindings.
  • Allow user to install petsc4py etc. into a virtualenv.

@kwabenantim kwabenantim changed the title Add pychaste scaffolding Add scaffolding for SBML and python wrappers Jul 3, 2026
@kwabenantim kwabenantim requested a review from Copilot July 3, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 44 out of 46 changed files in this pull request and generated 8 comments.

Comment thread src/AbstractSbmlCellCycleModel.cpp Outdated
Comment thread src/AbstractSbmlOdeSystem.cpp Outdated
Comment thread src/fortests/SbmlTestHelpers.hpp Outdated
Comment thread src/AbstractSbmlSrnModel.cpp Outdated
Comment thread .github/workflows/test-project.yml
Comment thread .github/workflows/test-sbml-project.yml
Comment thread .github/workflows/test-python-project.yml
Comment thread .github/workflows/test-force-example.yml
- Stop vendoring the SBML base classes in src/; sbml_install.sh now copies them
  from the installed chaste-sbml package via 'chaste-sbml copy-base-classes'.
- Drop the vendored-file handling from setup_project.py.
- Use the chaste-sbml command and its generate subcommand in the workflow,
  README, and Goldbeter example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/test-force-example.yml Outdated
Comment thread src/py/MANIFEST.in Outdated
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.

3 participants