Skip to content

Commit

Permalink
Merge pull request #58 from Chaste/57-tutorial-formatting
Browse files Browse the repository at this point in the history
Improve PyChaste tutorial formatting
  • Loading branch information
kwabenantim authored Mar 4, 2024
2 parents 952cbb7 + c36d25f commit 278ccb9
Show file tree
Hide file tree
Showing 62 changed files with 646 additions and 116 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
branches:
- '**'

# Limit concurrent deployments to one per branch
concurrency:
group: build-and-test-${{ github.ref }}
cancel-in-progress: true

jobs:

build-and-test:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/update-pychaste-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
- develop
workflow_dispatch:

# Limit concurrent deployments to one per branch
concurrency:
group: update-pychaste-tutorials-${{ github.ref }}
cancel-in-progress: true

jobs:

generate-pychaste-tutorials-markdown:
Expand Down
12 changes: 5 additions & 7 deletions doc/tutorials/TestCellSortingTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestCellSortingTutorial.py .
This tutorial is automatically generated from [TestCellSortingTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestCellSortingTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
This test is a demonstration of cell sorting using a Cellular Potts based framework.
It shows:
* How to set up a Potts simulation
Expand All @@ -34,7 +33,7 @@ import chaste.visualization # Visualization tools
class TestCellSortingTutorial(chaste.cell_based.AbstractCellBasedTestSuite):

```
## Test 1 - Cell sorting
### Test 1 - Cell sorting
The next test generates a collection of cells, there are two types of cells, labelled ones and non labelled ones,
there is differential adhesion between the cell types. For the parameters specified, the cells sort into separate types.

Expand Down Expand Up @@ -150,11 +149,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestCellSortingTutorial.py`
**File name:** `TestCellSortingTutorial.py`

```python
import unittest # Python testing framework
Expand Down
16 changes: 7 additions & 9 deletions doc/tutorials/TestMeshBasedCellSimulationsPythonTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestMeshBasedCellSimulationsPythonTutorial.py .
This tutorial is automatically generated from [TestMeshBasedCellSimulationsPythonTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestMeshBasedCellSimulationsPythonTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
In this tutorial we show how Chaste can be used to create, run and visualize mesh-based simulations.
Full details of the mathematical model can be found in van Leeuwen et al. (2009) [doi:10.1111/j.1365-2184.2009.00627.x].

## Imports and Setup
## The Test

```python
import unittest # Python testing framework
Expand All @@ -32,7 +31,7 @@ import chaste.visualization # Visualization tools
class TestRunningMeshBasedSimulationsTutorial(chaste.cell_based.AbstractCellBasedTestSuite):

```
## Test 1 - a basic mesh-based simulation
### Test 1 - a basic mesh-based simulation
In the first test, we run a simple mesh-based simulation,
in which we create a monolayer of cells, using a mutable mesh. Each cell is assigned a stochastic cell-cycle model.

Expand Down Expand Up @@ -139,7 +138,7 @@ To run the simulation, we call `Solve()`. We can again do a quick rendering of t
```
Full results can be visualized in Paraview from the `file_handler.GetOutputDirectoryFullPath()` directory.

## Test 2 - a basic mesh-based simulation with ghost nodes
### Test 2 - a basic mesh-based simulation with ghost nodes
In the second test, we run a simple mesh-based simulation with ghost nodes, in which we create a monolayer of cells, using a mutable mesh.
Each cell is assigned a stochastic cell-cycle model.

Expand Down Expand Up @@ -256,11 +255,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestMeshBasedCellSimulationsPythonTutorial.py`
**File name:** `TestMeshBasedCellSimulationsPythonTutorial.py`

```python
import unittest # Python testing framework
Expand Down
16 changes: 7 additions & 9 deletions doc/tutorials/TestNodeBasedCellSimulationsPythonTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestNodeBasedCellSimulationsPythonTutorial.py .
This tutorial is automatically generated from [TestNodeBasedCellSimulationsPythonTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestNodeBasedCellSimulationsPythonTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
In this tutorial we show how Chaste can be used to create, run and visualize node-based simulations. Full details of the mechanical model can be found in Pathamathan et
al "A computational study of discrete mechanical tissue models", Physical Biology. Vol. 6. No. 3. 2009.. DOI (10.1088/1478-3975/6/3/036001).

Expand All @@ -30,7 +29,7 @@ chaste.init() # Set up MPI

class TestRunningNodeBasedSimulationsTutorial(chaste.cell_based.AbstractCellBasedTestSuite):
```
## Test 1 - A basic node-based simulation
### Test 1 - A basic node-based simulation
In the first test, we run a simple node-based simulation, in which we create a monolayer of cells,
using a nodes only mesh. Each cell is assigned a uniform cell-cycle model.

Expand Down Expand Up @@ -136,7 +135,7 @@ If different simulation input parameters are being explored the lines should be
# JUPYTER_TEARDOWN

```
## Test 2 - a basic node-based simulation in 3D
### Test 2 - a basic node-based simulation in 3D
In the second test we run a simple node-based simulation in 3D. This is very similar to the 2D test with the dimension changed from 2 to 3 and
instead of using a mesh generator we generate the nodes directly.

Expand Down Expand Up @@ -238,7 +237,7 @@ If different simulation input parameters are being explored the lines should be
# JUPYTER_TEARDOWN

```
## Test 3 - a node-based simulation on a restricted geometry
### Test 3 - a node-based simulation on a restricted geometry
In the second test we run a simple node-based simulation in 3D. This is very similar to the 2D test with the dimension changed from 2 to 3 and
instead of using a mesh generator we generate the nodes directly.

Expand Down Expand Up @@ -339,11 +338,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestNodeBasedCellSimulationsPythonTutorial.py`
**File name:** `TestNodeBasedCellSimulationsPythonTutorial.py`

```python
import unittest # Python testing framework
Expand Down
16 changes: 7 additions & 9 deletions doc/tutorials/TestPottsBasedCellSimulationsPythonTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestPottsBasedCellSimulationsPythonTutorial.py .
This tutorial is automatically generated from [TestPottsBasedCellSimulationsPythonTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestPottsBasedCellSimulationsPythonTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
In this tutorial we show how Chaste can be used to create, run and visualize Potts-based simulations.
Full details of the mathematical model can be found in Graner, F. and Glazier, J. A. (1992).

Expand All @@ -29,7 +28,7 @@ chaste.init() # Set up MPI

class TestRunningPottsBasedSimulationsTutorial(chaste.cell_based.AbstractCellBasedTestSuite):
```
## Test 1 - A basic node-based simulation
### Test 1 - A basic node-based simulation
In the first test, we run a simple Potts-based simulation, in which we create a monolayer of cells, using a Potts mesh.
Each cell is assigned a stochastic cell-cycle model.

Expand Down Expand Up @@ -174,7 +173,7 @@ If different simulation input parameters are being explored the lines should be
# JUPYTER_TEARDOWN

```
## Test 2 - Cell sorting
### Test 2 - Cell sorting
The next test generates a collection of cells, there are two types of cells, labelled ones and non labelled ones,
there is differential adhesion between the cell types. For the parameters specified, the cells sort into separate types.

Expand Down Expand Up @@ -276,7 +275,7 @@ If different simulation input parameters are being explored the lines should be
# JUPYTER_TEARDOWN

```
## Test 3 - 3D Cell Sorting
### Test 3 - 3D Cell Sorting
The next test extends the previous example to three dimensions.

```python
Expand Down Expand Up @@ -384,11 +383,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestPottsBasedCellSimulationsPythonTutorial.py`
**File name:** `TestPottsBasedCellSimulationsPythonTutorial.py`

```python
import unittest # Python testing framework
Expand Down
14 changes: 7 additions & 7 deletions doc/tutorials/TestScratchAssayTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestScratchAssayTutorial.py .
This tutorial is automatically generated from [TestScratchAssayTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestScratchAssayTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
This tutorial is an example of modelling a scratch assay using a simple cellular automaton
representation of cells. It will cover the following techniques:

Expand All @@ -24,6 +23,8 @@ representation of cells. It will cover the following techniques:
* Simulating cell migration on the mesh
* Real-time visualization of the cell population and plotting of population statistics

## The Test

```python
import unittest # Python testing framework
import matplotlib.pyplot as plt # Plotting
Expand All @@ -37,7 +38,7 @@ import chaste.visualization # Visualization tools
class TestScratchAssayTutorial(chaste.cell_based.AbstractCellBasedTestSuite):

```
## Test 1 - Scratch Assay
### Test 1 - Scratch Assay
In this test we will create a scratch along the middle of a domain and quantify the migration
of cells into the region. Cells will migrate by random walk on the their regular mesh (lattice).

Expand Down Expand Up @@ -227,11 +228,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestScratchAssayTutorial.py`
**File name:** `TestScratchAssayTutorial.py`

```python
import unittest # Python testing framework
Expand Down
15 changes: 7 additions & 8 deletions doc/tutorials/TestSpheroidTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestSpheroidTutorial.py .
This tutorial is automatically generated from [TestSpheroidTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestSpheroidTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
This tutorial is an example of modelling spheroid growth with a nutrient.
It covers:
* Setting up an off-lattice cell population
* Setting up a cell cycle model with oxygen dependence
* Setting up and solving an oxygen transport PDE
* Setting up a cell killer
## Imports and Setup

## The Test

```python
import unittest # Python testing framework
Expand All @@ -36,7 +36,7 @@ chaste.init() # Set up MPI
class TestSpheroidTutorial(chaste.cell_based.AbstractCellBasedTestSuite):

```
## Test 1 - a 2D mesh-based spheroid
### Test 1 - a 2D mesh-based spheroid
In this test we set up a spheroid with a plentiful supply of oxygen on the boundary and watch it grow
over time. Cells can gradually become apoptotic if the oxygen tension is too low.

Expand Down Expand Up @@ -184,11 +184,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestSpheroidTutorial.py`
**File name:** `TestSpheroidTutorial.py`

```python
import unittest # Python testing framework
Expand Down
12 changes: 5 additions & 7 deletions doc/tutorials/TestTensileTestTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ toc: true
layout: "single"
---

This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestTensileTestTutorial.py .
This tutorial is automatically generated from [TestTensileTestTutorial](https://github.com/Chaste/PyChaste/blob/develop/test/python/cell_based/tutorials/TestTensileTestTutorial.py) at revision [f810861a](https://github.com/Chaste/PyChaste/commit/f810861afe376ba19bd791e14e85f29583993205).
Note that the code is given in full at the bottom of the page.



# Introduction
## Introduction
In this tutorial we will demonstrate a simulated tensile test on an epithelial sheet. This test
demonstrates:
* Working with vertex based off lattice populations
Expand All @@ -34,7 +33,7 @@ chaste.init() # Set up MPI
class TestTensileTestTutorial(chaste.cell_based.AbstractCellBasedTestSuite):

```
## Test 1 - A 2d test
### Test 1 - A 2D test

```python
def test_monolayer(self):
Expand Down Expand Up @@ -169,11 +168,10 @@ if __name__ == '__main__':
```


# Code
The full code is given below
## Full code


## File name `TestTensileTestTutorial.py`
**File name:** `TestTensileTestTutorial.py`

```python
import unittest # Python testing framework
Expand Down
Loading

0 comments on commit 278ccb9

Please sign in to comment.