Skip to content
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

Implement Python wrappers for cell-based simulations #60

Closed
kwabenantim opened this issue Jan 18, 2023 · 10 comments
Closed

Implement Python wrappers for cell-based simulations #60

kwabenantim opened this issue Jan 18, 2023 · 10 comments

Comments

@kwabenantim
Copy link
Member

This issue continues the discussion for legacy trac ticket 3104:


kwabenantim created the following ticket on 2022-09-02 at 11:33:49, it is owned by kwabenantim*

For those without C++ expertise, implementation of higher-level programming language bindings would offer a step change in Chaste’s usability. Extending on preliminary work in [legacy ticket 2686] on PyChaste, we will use PyBind11 to generate Python wrappers for cell-based Chaste.

@kwabenantim
Copy link
Member Author

kwabenantim commented Feb 2, 2023

Building a conda package for PyChaste that works with develop.

So far, a manual build with these versions of dependencies from conda-forge and bioconda works:

  - python >=3.7
  - vtk ==8.2.0
  - tbb ==2019.9
  - tbb-devel ==2019.9
  - boost ==1.74.0
  - petsc ==3.10.5
  - petsc4py ==3.10.0
  - hdf5 =1.10.5=mpi_mpich_*
  - parmetis ==4.0.3
  - sundials ==5.0.0
  - xsd
  - xerces-c ==3.2.4

Note: the vtk builds from conda-forge depend on tbb, not mpi.

Trying to get conda-build to make the conda package.

@kwabenantim
Copy link
Member Author

kwabenantim commented Feb 9, 2023

The conda package was built with conda mambabuild and is now up on a test channel. Currently testing it in a Jupyter notebook and fixing issues.

To install, run:
conda install -c kwabenantim chaste

To start a Jupyter notebook, run:
jupyter notebook

@kwabenantim
Copy link
Member Author

kwabenantim commented Apr 4, 2023

Test Status
ode/TestOdeSystemPython.py passing
cell_based/tutorials/TestScratchAssayTutorial.py passing
cell_based/tutorials/TestVertexBasedCellSimulationsPythonTutorial.py failing
cell_based/tutorials/TestMeshBasedCellSimulationsPythonTutorial.py passing
cell_based/tutorials/TestPottsBasedCellSimulationsPythonTutorial.py passing
cell_based/tutorials/TestSpheroidTutorial.py passing
cell_based/tutorials/TestCellSortingTutorial.py passing
cell_based/tutorials/TestTensileTestTutorial.py failing
cell_based/tutorials/TestNodeBasedCellSimulationsPythonTutorial.py failing
cell_based/TestVertexBasedCellPopulationPython.py failing
cell_based/TestMeshBasedCellPopulationPython.py failing
cell_based/TestNodeBasedCellPopulationPython.py failing
cell_based/TestCaBasedCellPopulationPython.py failing
mesh/TestPottsMeshPython.py passing
mesh/TestChastePointPython.py failing
core/TestFileFinderPython.py failing
core/TestPetscToolsPython.py failing
core/TestRandomNumberGeneratorPython.py passing
core/TestTimerPython.py passing
core/TestVersionPython.py passing
core/TestOutputFileHandlerPython.py passing

@kwabenantim
Copy link
Member Author

TestVertexBasedCellPopulationPython.py

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run 
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=59
:
system msg for write_line failure : Bad file descriptor

This stems from the visualisation scene modifier: modifier = chaste.cell_based.VtkSceneModifier2()

@kwabenantim
Copy link
Member Author

Scene rendering fixed: Chaste/PyChaste#1

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 4, 2023

Colab notebooks enabled:
Chaste/PyChaste#2
Chaste/PyChaste#8

@kwabenantim
Copy link
Member Author

Wrappers updated to Chaste/develop branch:
Chaste/PyChaste#7
Chaste/PyChaste#13

@kwabenantim
Copy link
Member Author

Fixing c_vector support:
Chaste/PyChaste#11

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 4, 2023

Remaining Tasks

@AlexFletcher AlexFletcher changed the title #3104 - Implement Python wrappers for cell-based simulations Implement Python wrappers for cell-based simulations Jul 4, 2023
@kwabenantim
Copy link
Member Author

Closing this issue as Python bindings are now implemented: https://github.com/Chaste/PyChaste. New issues will be created for further updates to the Python bindings including, but not limited to:

  • Supporting new versions of dependencies
  • Building conda packages for different versions of Python
  • Updating the docker image
  • Adding new wrappers when Chaste changes
  • Adding new tutorials
  • Adding new tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant