Skip to content

Commit 278ccb9

Browse files
authored
Merge pull request #58 from Chaste/57-tutorial-formatting
Improve PyChaste tutorial formatting
2 parents 952cbb7 + c36d25f commit 278ccb9

File tree

62 files changed

+646
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+646
-116
lines changed

.github/workflows/build-and-test.yml

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
branches:
77
- '**'
88

9+
# Limit concurrent deployments to one per branch
10+
concurrency:
11+
group: build-and-test-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015

1116
build-and-test:

.github/workflows/update-pychaste-tutorials.yml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
- develop
1010
workflow_dispatch:
1111

12+
# Limit concurrent deployments to one per branch
13+
concurrency:
14+
group: update-pychaste-tutorials-${{ github.ref }}
15+
cancel-in-progress: true
16+
1217
jobs:
1318

1419
generate-pychaste-tutorials-markdown:

doc/tutorials/TestCellSortingTutorial.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestCellSortingTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

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

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

@@ -150,11 +149,10 @@ if __name__ == '__main__':
150149
```
151150

152151

153-
# Code
154-
The full code is given below
152+
## Full code
155153

156154

157-
## File name `TestCellSortingTutorial.py`
155+
**File name:** `TestCellSortingTutorial.py`
158156

159157
```python
160158
import unittest # Python testing framework

doc/tutorials/TestMeshBasedCellSimulationsPythonTutorial.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestMeshBasedCellSimulationsPythonTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

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

20-
## Imports and Setup
19+
## The Test
2120

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

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

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

142-
## Test 2 - a basic mesh-based simulation with ghost nodes
141+
### Test 2 - a basic mesh-based simulation with ghost nodes
143142
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.
144143
Each cell is assigned a stochastic cell-cycle model.
145144

@@ -256,11 +255,10 @@ if __name__ == '__main__':
256255
```
257256

258257

259-
# Code
260-
The full code is given below
258+
## Full code
261259

262260

263-
## File name `TestMeshBasedCellSimulationsPythonTutorial.py`
261+
**File name:** `TestMeshBasedCellSimulationsPythonTutorial.py`
264262

265263
```python
266264
import unittest # Python testing framework

doc/tutorials/TestNodeBasedCellSimulationsPythonTutorial.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestNodeBasedCellSimulationsPythonTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

15-
16-
# Introduction
15+
## Introduction
1716
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
1817
al "A computational study of discrete mechanical tissue models", Physical Biology. Vol. 6. No. 3. 2009.. DOI (10.1088/1478-3975/6/3/036001).
1918

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

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

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

138137
```
139-
## Test 2 - a basic node-based simulation in 3D
138+
### Test 2 - a basic node-based simulation in 3D
140139
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
141140
instead of using a mesh generator we generate the nodes directly.
142141

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

240239
```
241-
## Test 3 - a node-based simulation on a restricted geometry
240+
### Test 3 - a node-based simulation on a restricted geometry
242241
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
243242
instead of using a mesh generator we generate the nodes directly.
244243

@@ -339,11 +338,10 @@ if __name__ == '__main__':
339338
```
340339

341340

342-
# Code
343-
The full code is given below
341+
## Full code
344342

345343

346-
## File name `TestNodeBasedCellSimulationsPythonTutorial.py`
344+
**File name:** `TestNodeBasedCellSimulationsPythonTutorial.py`
347345

348346
```python
349347
import unittest # Python testing framework

doc/tutorials/TestPottsBasedCellSimulationsPythonTutorial.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestPottsBasedCellSimulationsPythonTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

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

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

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

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

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

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

278277
```
279-
## Test 3 - 3D Cell Sorting
278+
### Test 3 - 3D Cell Sorting
280279
The next test extends the previous example to three dimensions.
281280

282281
```python
@@ -384,11 +383,10 @@ if __name__ == '__main__':
384383
```
385384

386385

387-
# Code
388-
The full code is given below
386+
## Full code
389387

390388

391-
## File name `TestPottsBasedCellSimulationsPythonTutorial.py`
389+
**File name:** `TestPottsBasedCellSimulationsPythonTutorial.py`
392390

393391
```python
394392
import unittest # Python testing framework

doc/tutorials/TestScratchAssayTutorial.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestScratchAssayTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

15-
16-
# Introduction
15+
## Introduction
1716
This tutorial is an example of modelling a scratch assay using a simple cellular automaton
1817
representation of cells. It will cover the following techniques:
1918

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

26+
## The Test
27+
2728
```python
2829
import unittest # Python testing framework
2930
import matplotlib.pyplot as plt # Plotting
@@ -37,7 +38,7 @@ import chaste.visualization # Visualization tools
3738
class TestScratchAssayTutorial(chaste.cell_based.AbstractCellBasedTestSuite):
3839

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

@@ -227,11 +228,10 @@ if __name__ == '__main__':
227228
```
228229

229230

230-
# Code
231-
The full code is given below
231+
## Full code
232232

233233

234-
## File name `TestScratchAssayTutorial.py`
234+
**File name:** `TestScratchAssayTutorial.py`
235235

236236
```python
237237
import unittest # Python testing framework

doc/tutorials/TestSpheroidTutorial.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestSpheroidTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

15-
16-
# Introduction
15+
## Introduction
1716
This tutorial is an example of modelling spheroid growth with a nutrient.
1817
It covers:
1918
* Setting up an off-lattice cell population
2019
* Setting up a cell cycle model with oxygen dependence
2120
* Setting up and solving an oxygen transport PDE
2221
* Setting up a cell killer
23-
## Imports and Setup
22+
23+
## The Test
2424

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

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

@@ -184,11 +184,10 @@ if __name__ == '__main__':
184184
```
185185

186186

187-
# Code
188-
The full code is given below
187+
## Full code
189188

190189

191-
## File name `TestSpheroidTutorial.py`
190+
**File name:** `TestSpheroidTutorial.py`
192191

193192
```python
194193
import unittest # Python testing framework

doc/tutorials/TestTensileTestTutorial.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ toc: true
88
layout: "single"
99
---
1010

11-
This tutorial is automatically generated from the file ../test/python/cell_based/tutorials/TestTensileTestTutorial.py .
11+
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).
1212
Note that the code is given in full at the bottom of the page.
1313

1414

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

3635
```
37-
## Test 1 - A 2d test
36+
### Test 1 - A 2D test
3837

3938
```python
4039
def test_monolayer(self):
@@ -169,11 +168,10 @@ if __name__ == '__main__':
169168
```
170169

171170

172-
# Code
173-
The full code is given below
171+
## Full code
174172

175173

176-
## File name `TestTensileTestTutorial.py`
174+
**File name:** `TestTensileTestTutorial.py`
177175

178176
```python
179177
import unittest # Python testing framework

0 commit comments

Comments
 (0)