@@ -320,24 +320,24 @@ Open `doc/_build/html/index.html` in your browser to view the pages. Follow the
320
320
Many of the PyGMT functions have example code in their documentation. To contribute an
321
321
example, add an "Example" header and put the example code below it. Have all lines
322
322
begin with ` >>> ` . To keep this example code from being run during testing, add the code
323
- ` __doctest_skip__ = [function name ] ` to the top of the module.
323
+ ` __doctest_skip__ = ["function_name" ] ` to the top of the module.
324
324
325
325
** Inline code example**
326
326
327
327
Below the import statements at the top of the file
328
328
329
- ``
330
- __ doctest_skip__ = [ "module_name"]
331
- ``
332
-
333
- At the end of the function's docstring
329
+ ``` python
330
+ __doctest_skip__ = [" function_name" ]
334
331
335
- Example
336
- -------
337
- >>> import pygmt
338
- >>> # Comment describing what is happening
339
- >>> Code example
332
+ At the end of the function' s docstring:
340
333
334
+ ```python
335
+ Example
336
+ ------ -
337
+ >> > import pygmt
338
+ >> > # Comment describing what is happening
339
+ >> > Code example
340
+ ```
341
341
342
342
### Contributing Gallery Plots
343
343
@@ -580,7 +580,9 @@ returning the `pygmt.Figure` object:
580
580
``` python
581
581
@pytest.mark.mpl_image_compare
582
582
def test_my_plotting_case ():
583
- " Test that my plotting method works"
583
+ """
584
+ Test that my plotting method works.
585
+ """
584
586
fig = Figure()
585
587
fig.basemap(region = [0 , 360 , - 90 , 90 ], projection = " W15c" , frame = True )
586
588
return fig
@@ -675,20 +677,22 @@ summarized as follows:
675
677
dvc push # Run before git push to enable automated testing with the new images
676
678
git push
677
679
678
- #### Using check_figures_equal
680
+ #### Using ` check_figures_equal `
679
681
680
682
This approach draws the same figure using two different methods (the reference
681
683
method and the tested method), and checks that both of them are the same.
682
- It takes two ` pygmt.Figure ` objects (' fig_ref' and ' fig_test' ), generates a png
684
+ It takes two ` pygmt.Figure ` objects (` fig_ref ` and ` fig_test ` ), generates a png
683
685
image, and checks for the Root Mean Square (RMS) error between the two.
684
686
Here's an example:
685
687
686
688
``` python
687
689
@check_figures_equal ()
688
690
def test_my_plotting_case ():
689
- " Test that my plotting method works"
690
- fig_ref, fig_test = Figure(), Figure()
691
- fig_ref.grdimage(" @earth_relief_01d_g" , projection = " W120/15c" , cmap = " geo" )
692
- fig_test.grdimage(grid, projection = " W120/15c" , cmap = " geo" )
693
- return fig_ref, fig_test
691
+ """
692
+ Test that my plotting method works.
693
+ """
694
+ fig_ref, fig_test = Figure(), Figure()
695
+ fig_ref.grdimage(" @earth_relief_01d_g" , projection = " W120/15c" , cmap = " geo" )
696
+ fig_test.grdimage(grid, projection = " W120/15c" , cmap = " geo" )
697
+ return fig_ref, fig_test
694
698
```
0 commit comments