Replace :: with codeblocks in demos - #5414
Conversation
connorjward
left a comment
There was a problem hiding this comment.
Seems basically fine and is probably a nice improvement.
4d27d24 to
06436b3
Compare
leo-collins
left a comment
There was a problem hiding this comment.
There is a pylit command in docs/Makefile that needs updating.
Also test_demos_run.py needs updating. Currently all these tests are passing trivially because the files contain no actual python code.
| :: | ||
| .. code-block:: python | ||
|
|
||
| HDF5 "example.h5" { | ||
| FILE_CONTENTS { | ||
| group / | ||
| group /topologies | ||
| group /topologies/firedrake_mixed_meshes | ||
| group /topologies/firedrake_mixed_meshes/meshA | ||
| group /topologies/firedrake_mixed_meshes/meshA/firedrake_mixed_function_spaces |
There was a problem hiding this comment.
This is not python code
| on Zenodo). For example:: | ||
| on Zenodo). For example: | ||
|
|
||
| .. code-block:: | ||
|
|
||
| firedrake-zenodo -t "My paper title" |
|
Previously, Also, found some demos that used |
|
@leo-collins hoping you can review this one |
connorjward
left a comment
There was a problem hiding this comment.
Made it about 80% through. Will review the rest shortly. This is great, thankless work - thank you!
| To mark cells by some other criterion, refine the finest mesh yourself and add the result, which is all that :meth:`~.HierarchyBase.adapt` does once it has marked: | ||
|
|
||
| .. code-block:: python | ||
| .. code-block:: none |
There was a problem hiding this comment.
| .. code-block:: none | |
| .. code-block:: python |
| If you publish results using Firedrake, we would be grateful if you would cite the Firedrake user manual:: | ||
| If you publish results using Firedrake, we would be grateful if you would cite the Firedrake user manual: | ||
|
|
||
| .. code-block:: python |
There was a problem hiding this comment.
| .. code-block:: python | |
| .. code-block:: text |
| \int_{\Omega} w \cdot u_h \, dx = \int_{\Omega} w \cdot u_0 \, dx + \frac{\Delta t}{2} \int_{\Omega} (\nabla \cdot w) p_0 \, dx \quad \forall w \in W | ||
|
|
||
| .. code-block:: python | ||
| .. code-block:: none |
There was a problem hiding this comment.
| .. code-block:: none | |
| .. code-block:: python |
| \int_{\Omega} w \cdot u_1 \, dx = \int_{\Omega} w \cdot u_h \, dx + \frac{\Delta t}{2} \int_{\Omega} (\nabla \cdot w) p_1 \, dx \quad \forall w \in W | ||
|
|
||
| .. code-block:: python | ||
| .. code-block:: none |
There was a problem hiding this comment.
| .. code-block:: none | |
| .. code-block:: python |
| \int_{\Omega} \phi \, p_1 \, dx = \int_{\Omega} \phi \, p_0 \, dx - \Delta t \int_{\Omega} \phi (\nabla \cdot u_h) \, dx \quad \forall \phi \in X | ||
|
|
||
| .. code-block:: python | ||
| .. code-block:: none |
There was a problem hiding this comment.
| .. code-block:: none | |
| .. code-block:: python |
| We also print the current simulation time at each step for tracking progress. | ||
|
|
||
| .. code-block:: python | ||
| .. code-block:: none |
There was a problem hiding this comment.
| .. code-block:: none | |
| .. code-block:: python |
| which results in the following mesh topology.:: | ||
| which results in the following mesh topology. | ||
|
|
||
| .. code-block:: python |
There was a problem hiding this comment.
| .. code-block:: python | |
| .. code-block:: text |
| which results in the following mesh topology.:: | ||
| which results in the following mesh topology. | ||
|
|
||
| .. code-block:: python |
There was a problem hiding this comment.
| .. code-block:: python | |
| .. code-block:: text |
connorjward
left a comment
There was a problem hiding this comment.
All done now. Once these fixes are in I think we're good to merge.
This PR is going into main not release, but a release is just around the corner so I'm not concerned.
| <https://doi.org/10.25561/104839>`_:: | ||
| <https://doi.org/10.25561/104839>`_: | ||
|
|
||
| .. code-block:: python |
There was a problem hiding this comment.
| .. code-block:: python | |
| .. code-block:: text |
| decomposition that supports the patches. This is set via the | ||
| `distribution_parameters` kwarg of the :func:`.Mesh` constructor. For | ||
| instance, vertex-star patches require :: | ||
| instance, vertex-star patches require: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| distribution_parameters["overlap_type"] = (DistributedMeshOverlapType.VERTEX, 1) | ||
|
|
||
| while Vanka patches require :: | ||
| while Vanka patches require: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| distribution_parameters["overlap_type"] = (DistributedMeshOverlapType.VERTEX, 2) |
There was a problem hiding this comment.
These code blocks need to be indented into the .. note:: block
leo-collins
left a comment
There was a problem hiding this comment.
This seems pretty much fine now
Description
Currently codeblocks are defined in Firedrake demos using
::.This change replaces all uses of
::with.. codeblock:: python. This provides more control over code formatting.