@@ -221,7 +221,7 @@ Python <https://www.python.org/dev/peps/pep-0020/>`_. When in doubt:
221
221
222
222
.. code :: python
223
223
224
- import this
224
+ import this
225
225
226
226
PyVista uses `pre-commit `_ to enforce PEP8 and other styles
227
227
automatically. Please see the `Style Checking section <#style-checking >`_ for
@@ -243,14 +243,14 @@ and partially enforced for Python source files.
243
243
These rules are enforced through the use of `Vale <https://vale.sh/ >`_ via our
244
244
GitHub Actions, and you can run Vale locally with:
245
245
246
- .. code ::
246
+ .. code :: bash
247
247
248
248
pip install vale
249
249
vale --config doc/.vale.ini doc pyvista examples ./* .rst --glob=' !*{_build,AUTHORS.rst}*'
250
250
251
251
If you are on Linux or macOS, you can run:
252
252
253
- .. code ::
253
+ .. code :: bash
254
254
255
255
make docstyle
256
256
@@ -387,6 +387,7 @@ directive.
387
387
import warnings
388
388
from pyvista.core.errors import PyVistaDeprecationWarning
389
389
390
+
390
391
def addition (a , b ):
391
392
""" Add two numbers.
392
393
@@ -410,7 +411,7 @@ directive.
410
411
# deprecated 0.37.0, convert to error in 0.40.0, remove 0.41.0
411
412
warnings.warn(
412
413
' `addition` has been deprecated. Use pyvista.add instead' ,
413
- PyVistaDeprecationWarning
414
+ PyVistaDeprecationWarning,
414
415
)
415
416
add(a, b)
416
417
@@ -621,15 +622,14 @@ the ``verify_image_cache`` fixture can be utilized:
621
622
622
623
.. code :: python
623
624
624
-
625
- def test_add_background_image_not_global (verify_image_cache ):
626
- verify_image_cache.skip = True # Turn off caching
627
- plotter = pyvista.Plotter()
628
- plotter.add_mesh(sphere)
629
- plotter.show()
630
- # Turn on caching for further plotting
631
- verify_image_cache.skip = False
632
- ...
625
+ def test_add_background_image_not_global (verify_image_cache ):
626
+ verify_image_cache.skip = True # Turn off caching
627
+ plotter = pyvista.Plotter()
628
+ plotter.add_mesh(sphere)
629
+ plotter.show()
630
+ # Turn on caching for further plotting
631
+ verify_image_cache.skip = False
632
+ ...
633
633
634
634
This ensures that immediately before the plotter is closed, the current
635
635
render window will be verified against the image in CI. If no image
@@ -720,7 +720,7 @@ included in a single ``.py`` file. The test cases are all stored in
720
720
721
721
The tests can be executed with:
722
722
723
- .. code :: python
723
+ .. code :: bash
724
724
725
725
pytest tests/core/typing
726
726
@@ -965,11 +965,14 @@ download the dataset in ``pyvista/examples/downloads.py``. This might be as easy
965
965
966
966
.. code :: python
967
967
968
- def download_my_new_mesh (load = True ):
969
- """ Download my new mesh."""
970
- return _download_dataset(_dataset_my_new_mesh, load = load)
968
+ def download_my_new_mesh (load = True ):
969
+ """ Download my new mesh."""
970
+ return _download_dataset(_dataset_my_new_mesh, load = load)
971
+
971
972
972
- _dataset_my_new_mesh = _SingleFileDownloadableDatasetLoader(' mydata/my_new_mesh.vtk' )
973
+ _dataset_my_new_mesh = _SingleFileDownloadableDatasetLoader(
974
+ ' mydata/my_new_mesh.vtk'
975
+ )
973
976
974
977
Note that a separate dataset loading object, ``_dataset_my_new_mesh ``, should
975
978
first be defined outside of the function (with module scope), and the new
@@ -1004,21 +1007,21 @@ For example:
1004
1007
1005
1008
.. code :: python
1006
1009
1007
- def download_my_new_mesh (load = True ):
1008
- """ Download my new mesh.
1010
+ def download_my_new_mesh (load = True ):
1011
+ """ Download my new mesh.
1009
1012
1010
- Examples
1011
- --------
1012
- >>> from pyvista import examples
1013
- >>> dataset = examples.download_my_new_mesh()
1014
- >>> dataset.plot()
1013
+ Examples
1014
+ --------
1015
+ >>> from pyvista import examples
1016
+ >>> dataset = examples.download_my_new_mesh()
1017
+ >>> dataset.plot()
1015
1018
1016
- .. seealso::
1019
+ .. seealso::
1017
1020
1018
- :ref:`My New Mesh Dataset <my_new_mesh_dataset>`
1019
- See this dataset in the Dataset Gallery for more info.
1021
+ :ref:`My New Mesh Dataset <my_new_mesh_dataset>`
1022
+ See this dataset in the Dataset Gallery for more info.
1020
1023
1021
- """
1024
+ """
1022
1025
1023
1026
.. note ::
1024
1027
0 commit comments