Skip to content

Commit

Permalink
Fix docs test line numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
lbdreyer committed Nov 13, 2023
1 parent d01bb0f commit 4c3061f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/src/further_topics/filtering_warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Warnings:

>>> my_operation()
...
iris/coord_systems.py:456: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
iris/coord_systems.py:455: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning)
iris/coord_systems.py:823: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy.
iris/coord_systems.py:822: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy.
warnings.warn(

Warnings can be suppressed using the Python warnings filter with the ``ignore``
Expand Down Expand Up @@ -110,7 +110,7 @@ You can target specific Warning messages, e.g.
... warnings.filterwarnings("ignore", message="Discarding false_easting")
... my_operation()
...
iris/coord_systems.py:456: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
iris/coord_systems.py:455: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning)

::
Expand All @@ -125,16 +125,16 @@ Or you can target Warnings raised by specific lines of specific modules, e.g.
.. doctest:: filtering_warnings

>>> with warnings.catch_warnings():
... warnings.filterwarnings("ignore", module="iris.coord_systems", lineno=456)
... warnings.filterwarnings("ignore", module="iris.coord_systems", lineno=455)
... my_operation()
...
iris/coord_systems.py:823: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy.
iris/coord_systems.py:822: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy.
warnings.warn(

::

python -W ignore:::iris.coord_systems:454
export PYTHONWARNINGS=ignore:::iris.coord_systems:454
python -W ignore:::iris.coord_systems:453
export PYTHONWARNINGS=ignore:::iris.coord_systems:453

Warnings from a Common Source
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -188,7 +188,7 @@ module during execution:
... )
... my_operation()
...
iris/coord_systems.py:456: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
iris/coord_systems.py:455: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance.
warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning)

----
Expand Down

0 comments on commit 4c3061f

Please sign in to comment.