-
Notifications
You must be signed in to change notification settings - Fork 3
Add scaffolding for SBML and python wrappers #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kwabenantim
wants to merge
55
commits into
main
Choose a base branch
from
pychaste_template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 f7ed54d
#3 Add convenience scripts
kwabenantim 444e6e8
#3 Update gitignore
kwabenantim ee9479c
#3 Add setup query about project name
kwabenantim 871bf1e
#3 Summarise chosen options
kwabenantim 16dc0e4
#3 Add docstrings in setup.py
kwabenantim c8cf2ed
#3 Add linting, update gitignore
kwabenantim 4e27e93
#3 Add safe delete in scripts
kwabenantim 539336f
#3 Update safe delete in scripts
kwabenantim 9eebf7c
#3 Update reset, add setup settings
kwabenantim abf6caa
#3 Remove complicated reset
kwabenantim 76e0f1b
#3 Add end of setup message
kwabenantim 238ffc7
#3 Check if project is already setup
kwabenantim 23f60a0
#3 Update setup answer defaults
kwabenantim c3e5bf5
#3 Simplify cmake project substitutions
kwabenantim fa11860
#3 Verify Chaste source directory exists
kwabenantim a05b8ce
#3 Add optional Python bindings support
kwabenantim dc6703e
#3 Fix test workflow
kwabenantim d257012
#3 Default to checkout v6
kwabenantim f1b6294
#3 Use privileged test container
kwabenantim 6151fd0
#3 Fix workflow template path
kwabenantim a79d642
#3 Auto-set chaste source dir
kwabenantim 3ab6d49
#3 Add standard project github workflow
kwabenantim 6075a2a
#3 Add BUILD_PROJECT_PYTHON_BINDINGS script var
kwabenantim 5470b1f
#3 Simplify python bindings build
kwabenantim f4cb2d7
#3 Update safe_rm
kwabenantim a1675f0
#3 Simplify python src copy
kwabenantim efc28ca
#3 Add chaste src dir guard
kwabenantim 48dc02a
#3 Add pybind11 OPT_SIZE flag
kwabenantim 9ba5389
#3 Fail configure if necessary wrappers don't generate
kwabenantim d53c804
#3 Simplify python cmake
kwabenantim 0b05c0c
#3 Default Chaste provenance to off
kwabenantim 66cb27d
#3 Add common template substitutions to config.yaml
kwabenantim f892ff6
#3 Add SBML template project
kwabenantim adaaab4
#3 Add python bindings guide and example
kwabenantim 894f936
#3 Fix pychaste bindings inheritance
kwabenantim 3e90cfb
#3 Update cross-package bindings inheritance
kwabenantim 25b4b89
#3 Use cmake flto setting
kwabenantim 246455e
Merge branch 'pychaste_template' into sbml-template
kwabenantim 4b35e12
#3 Update workflow prompts and dependencies
kwabenantim 061cf3a
#3 Include Goldbeter example
kwabenantim 24c616f
#3 Switch CI to chaste/base
kwabenantim ce2d655
Merge branch 'pychaste_template' into sbml-template
kwabenantim a2dc66a
#3 Fix Goldbeter1991 example
kwabenantim 753d18e
#3 Remove wrapper generation guard
kwabenantim 52b0f96
#3 Update wrapping troubleshooting docs
kwabenantim 8f8294a
#3 Update force example
kwabenantim 091e0a7
#3 Update force example
kwabenantim 82b9612
#3 Create virtualenv during python setup
kwabenantim de3e7ad
Merge branch 'pychaste_template' into sbml-template
kwabenantim 7f2ebac
#3 Add create_venv.sh
kwabenantim 1d578a1
Merge pull request #5 from Chaste/sbml-template
kwabenantim a13463b
Fix missing CHASTE_SOURCE_DIR env var in workflow files
Copilot ac1716c
#3 Copy SBML base classes from the chaste-sbml package
kwabenantim 202d8cd
Fix review comments in workflow and manifest
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
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!') | ||
| " | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.