Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e26d52e
#3 Fix minor setup bugs
kwabenantim Jun 16, 2026
f7ed54d
#3 Add convenience scripts
kwabenantim Jun 22, 2026
444e6e8
#3 Update gitignore
kwabenantim Jun 22, 2026
ee9479c
#3 Add setup query about project name
kwabenantim Jun 22, 2026
871bf1e
#3 Summarise chosen options
kwabenantim Jun 22, 2026
16dc0e4
#3 Add docstrings in setup.py
kwabenantim Jun 22, 2026
c8cf2ed
#3 Add linting, update gitignore
kwabenantim Jun 22, 2026
4e27e93
#3 Add safe delete in scripts
kwabenantim Jun 22, 2026
539336f
#3 Update safe delete in scripts
kwabenantim Jun 22, 2026
9eebf7c
#3 Update reset, add setup settings
kwabenantim Jun 22, 2026
abf6caa
#3 Remove complicated reset
kwabenantim Jun 22, 2026
76e0f1b
#3 Add end of setup message
kwabenantim Jun 22, 2026
238ffc7
#3 Check if project is already setup
kwabenantim Jun 22, 2026
23f60a0
#3 Update setup answer defaults
kwabenantim Jun 22, 2026
c3e5bf5
#3 Simplify cmake project substitutions
kwabenantim Jun 22, 2026
fa11860
#3 Verify Chaste source directory exists
kwabenantim Jun 22, 2026
a05b8ce
#3 Add optional Python bindings support
kwabenantim Jun 22, 2026
dc6703e
#3 Fix test workflow
kwabenantim Jun 22, 2026
d257012
#3 Default to checkout v6
kwabenantim Jun 22, 2026
f1b6294
#3 Use privileged test container
kwabenantim Jun 22, 2026
6151fd0
#3 Fix workflow template path
kwabenantim Jun 23, 2026
a79d642
#3 Auto-set chaste source dir
kwabenantim Jun 23, 2026
3ab6d49
#3 Add standard project github workflow
kwabenantim Jun 23, 2026
6075a2a
#3 Add BUILD_PROJECT_PYTHON_BINDINGS script var
kwabenantim Jun 23, 2026
5470b1f
#3 Simplify python bindings build
kwabenantim Jun 23, 2026
f4cb2d7
#3 Update safe_rm
kwabenantim Jun 23, 2026
a1675f0
#3 Simplify python src copy
kwabenantim Jun 23, 2026
efc28ca
#3 Add chaste src dir guard
kwabenantim Jun 23, 2026
48dc02a
#3 Add pybind11 OPT_SIZE flag
kwabenantim Jun 23, 2026
9ba5389
#3 Fail configure if necessary wrappers don't generate
kwabenantim Jun 23, 2026
d53c804
#3 Simplify python cmake
kwabenantim Jun 23, 2026
0b05c0c
#3 Default Chaste provenance to off
kwabenantim Jun 23, 2026
66cb27d
#3 Add common template substitutions to config.yaml
kwabenantim Jun 23, 2026
f892ff6
#3 Add SBML template project
kwabenantim Jun 29, 2026
adaaab4
#3 Add python bindings guide and example
kwabenantim Jun 29, 2026
894f936
#3 Fix pychaste bindings inheritance
kwabenantim Jun 30, 2026
3e90cfb
#3 Update cross-package bindings inheritance
kwabenantim Jun 30, 2026
25b4b89
#3 Use cmake flto setting
kwabenantim Jun 30, 2026
246455e
Merge branch 'pychaste_template' into sbml-template
kwabenantim Jun 30, 2026
4b35e12
#3 Update workflow prompts and dependencies
kwabenantim Jun 30, 2026
061cf3a
#3 Include Goldbeter example
kwabenantim Jun 30, 2026
24c616f
#3 Switch CI to chaste/base
kwabenantim Jun 30, 2026
ce2d655
Merge branch 'pychaste_template' into sbml-template
kwabenantim Jun 30, 2026
a2dc66a
#3 Fix Goldbeter1991 example
kwabenantim Jun 30, 2026
753d18e
#3 Remove wrapper generation guard
kwabenantim Jul 3, 2026
52b0f96
#3 Update wrapping troubleshooting docs
kwabenantim Jul 3, 2026
8f8294a
#3 Update force example
kwabenantim Jul 3, 2026
091e0a7
#3 Update force example
kwabenantim Jul 3, 2026
82b9612
#3 Create virtualenv during python setup
kwabenantim Jul 3, 2026
de3e7ad
Merge branch 'pychaste_template' into sbml-template
kwabenantim Jul 3, 2026
7f2ebac
#3 Add create_venv.sh
kwabenantim Jul 3, 2026
1d578a1
Merge pull request #5 from Chaste/sbml-template
kwabenantim Jul 3, 2026
a13463b
Fix missing CHASTE_SOURCE_DIR env var in workflow files
Copilot Jul 3, 2026
ac1716c
#3 Copy SBML base classes from the chaste-sbml package
kwabenantim Jul 4, 2026
202d8cd
Fix review comments in workflow and manifest
Copilot Jul 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max_line_length = 120

exclude =
__pycache__,
.git,
.github,
.venv,
build,
output,
venv,
65 changes: 65 additions & 0 deletions .github/workflows/test-force-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test Force Example

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

concurrency:
group: test-force-example-${{ github.ref }}
cancel-in-progress: true

jobs:
test-force-example:
runs-on: ubuntu-latest

container:
image: chaste/base
options: --user root

env:
CHASTE_SOURCE_DIR: /tmp/Chaste
CHASTE_BUILD_DIR: /tmp/build
CHASTE_TEST_OUTPUT: /tmp/testoutput
PROJECT_DIR: /tmp/myproject
Comment thread
Copilot marked this conversation as resolved.

steps:
- name: Checkout template
uses: actions/checkout@v7

- name: Checkout Chaste source
run: |
git clone --depth 1 --branch develop https://github.com/Chaste/Chaste.git "${CHASTE_SOURCE_DIR}"
git config --global --add safe.directory "${CHASTE_SOURCE_DIR}"

- name: Create test project
run: |
cp -r . ${{ env.PROJECT_DIR }}
cd ${{ env.PROJECT_DIR }}
# Yes to proceed, Yes to cell_based, No to crypt/heart/lung, Yes to Python bindings, No to SBML, Yes to confirm
printf 'y\ny\nn\nn\nn\ny\nn\ny\n' | python3 setup_project.py

- name: Add MyForce to the project bindings
run: |
cd ${{ env.PROJECT_DIR }}
cp examples/my_force/MyForce.hpp examples/my_force/MyForce.cpp src/
sed -i.bak 's/^source_includes:$/&\n - MyForce.hpp/' dynamic/config.yaml
sed -i.bak 's/^ classes:$/&\n - name: MyForce/' dynamic/config.yaml
# Import PyChaste's module and declare AbstractForce as an external base
sed -i.bak 's/^ - name: all$/&\n imports:/' dynamic/config.yaml
sed -i.bak 's/^ imports:$/&\n - chaste._pychaste_all/' dynamic/config.yaml
sed -i.bak 's/^ - chaste._pychaste_all$/&\n external_bases:/' dynamic/config.yaml
sed -i.bak 's/^ external_bases:$/&\n - AbstractForce/' dynamic/config.yaml

- name: Configure
run: ${{ env.PROJECT_DIR }}/scripts/configure.sh

- name: Compile
run: ${{ env.PROJECT_DIR }}/scripts/compile.sh

- name: Install
run: ${{ env.PROJECT_DIR }}/scripts/bindings_install.sh

- name: Run the MyForce simulation from Python
run: ${{ env.PROJECT_DIR }}/.virtualenv/bin/python ${{ env.PROJECT_DIR }}/examples/my_force/run_my_force.py
50 changes: 50 additions & 0 deletions .github/workflows/test-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test Project

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

concurrency:
group: test-project-${{ github.ref }}
cancel-in-progress: true

jobs:
test-project:
runs-on: ubuntu-latest

container:
image: chaste/base
options: --user root

env:
CHASTE_SOURCE_DIR: /tmp/Chaste
CHASTE_BUILD_DIR: /tmp/build
CHASTE_TEST_OUTPUT: /tmp/testoutput
PROJECT_DIR: /tmp/myproject
Comment thread
Copilot marked this conversation as resolved.

steps:
- name: Checkout template
uses: actions/checkout@v7

- name: Checkout Chaste source
run: |
git clone --depth 1 --branch develop https://github.com/Chaste/Chaste.git "${CHASTE_SOURCE_DIR}"
git config --global --add safe.directory "${CHASTE_SOURCE_DIR}"

- name: Create test project
run: |
cp -r . ${{ env.PROJECT_DIR }}
cd ${{ env.PROJECT_DIR }}
# Prompt defaults (no components, no Python bindings, no SBML), yes to confirm
printf '\n\n\n\n\nn\nn\ny\n' | python3 setup_project.py

- name: Configure
run: ${{ env.PROJECT_DIR }}/scripts/configure.sh

- name: Compile
run: ${{ env.PROJECT_DIR }}/scripts/compile.sh

- name: Test
run: ${{ env.PROJECT_DIR }}/scripts/test.sh
64 changes: 64 additions & 0 deletions .github/workflows/test-python-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Python Project

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

concurrency:
group: test-python-project-${{ github.ref }}
cancel-in-progress: true

jobs:
test-python-project:
runs-on: ubuntu-latest

container:
image: chaste/base
options: --user root

env:
CHASTE_SOURCE_DIR: /tmp/Chaste
CHASTE_BUILD_DIR: /tmp/build
CHASTE_TEST_OUTPUT: /tmp/testoutput
PROJECT_DIR: /tmp/myproject
Comment thread
Copilot marked this conversation as resolved.

steps:
- name: Checkout template
uses: actions/checkout@v7

- name: Checkout Chaste source
run: |
git clone --depth 1 --branch develop https://github.com/Chaste/Chaste.git "${CHASTE_SOURCE_DIR}"
git config --global --add safe.directory "${CHASTE_SOURCE_DIR}"

- name: Create test project
run: |
cp -r . ${{ env.PROJECT_DIR }}
cd ${{ env.PROJECT_DIR }}
# Yes to Python bindings, no to SBML, yes to final confirmation
printf '\n\n\n\n\ny\nn\ny\n' | python3 setup_project.py

- name: Configure
run: |
${{ env.PROJECT_DIR }}/scripts/configure.sh

- name: Compile
run: |
${{ env.PROJECT_DIR }}/scripts/compile.sh

- name: Install
run: |
${{ env.PROJECT_DIR }}/scripts/bindings_install.sh

- name: Test Python bindings
run: |
${{ env.PROJECT_DIR }}/.virtualenv/bin/python -c "
import myproject
h = myproject.Hello_myproject('Hello from Python!')
message = h.GetMessage()
assert message == 'Hello from Python!', f'Expected \"Hello from Python!\" but got \"{message}\"'
print(f'GetMessage() returned: {message}')
print('Test passed!')
"
66 changes: 66 additions & 0 deletions .github/workflows/test-sbml-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test SBML Project

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

concurrency:
group: test-sbml-project-${{ github.ref }}
cancel-in-progress: true

jobs:
test-sbml-project:
runs-on: ubuntu-latest

container:
image: chaste/base
options: --user root

env:
CHASTE_SOURCE_DIR: /tmp/Chaste
CHASTE_BUILD_DIR: /tmp/build
CHASTE_TEST_OUTPUT: /tmp/testoutput
PROJECT_DIR: /tmp/myproject
Comment thread
Copilot marked this conversation as resolved.

steps:
- name: Checkout template
uses: actions/checkout@v7

- name: Checkout Chaste source
run: |
git clone --depth 1 --branch develop https://github.com/Chaste/Chaste.git "${CHASTE_SOURCE_DIR}"
git config --global --add safe.directory "${CHASTE_SOURCE_DIR}"

- name: Install clang-format and curl
run: apt-get update && apt-get install -y clang-format curl

- name: Create test project
run: |
cp -r . ${{ env.PROJECT_DIR }}
cd ${{ env.PROJECT_DIR }}
# Prompt defaults for proceed/components/no-python-bindings, yes to SBML, yes to confirm
printf '\n\n\n\n\n\ny\ny\n' | python3 setup_project.py

- name: Install SBML code generator
run: ${{ env.PROJECT_DIR }}/scripts/sbml_install.sh

- name: Import the Goldbeter 1991 model
run: |
cd ${{ env.PROJECT_DIR }}
# Use the vendored model (examples/goldbeter_1991/Goldbeter1991.xml) so the
# job does not depend on reaching BioModels at run time.
cp examples/goldbeter_1991/Goldbeter1991.xml .
.virtualenv/bin/chaste-sbml generate Goldbeter1991.xml --model-type srn --output-dir src/
cp examples/goldbeter_1991/TestGoldbeter1991SbmlSrnModel.hpp test/
echo "TestGoldbeter1991SbmlSrnModel.hpp" >> test/ContinuousTestPack.txt

- name: Configure
run: ${{ env.PROJECT_DIR }}/scripts/configure.sh

- name: Compile
run: ${{ env.PROJECT_DIR }}/scripts/compile.sh

- name: Test
run: ${{ env.PROJECT_DIR }}/scripts/test.sh
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,42 @@
build/
output/

.vscode/

.DS_Store
Thumbs.db

# Python
__pycache__/
*.py[cod]
*.egg-info/
.eggs/
.virtualenv/
.venv/
venv/
env/
.pytest_cache/
.mypy_cache/
.ruff_cache/

# C++
*.o
*.obj
*.lo
*.slo
*.a
*.lib
*.so
*.dylib
*.dll
*.exe
*.out
*.gch
*.pch

# CMake
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
CTestTestfile.cmake
compile_commands.json
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ find_package(Chaste COMPONENTS continuum_mechanics global io linalg mesh ode pde
# Change the project name in the line below to match the folder this file is in,
# i.e. the name of your project.
chaste_do_project(template_project)

if(Chaste_ENABLE_PYCHASTE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/dynamic")
add_subdirectory(dynamic)
endif()
Loading