From f085a87190240a0740cc68ac67821260d1f6ebb7 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Fri, 6 Dec 2024 11:20:44 -0700 Subject: [PATCH] remove code, doctest directives from cube module --- deltametrics/cube.py | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/deltametrics/cube.py b/deltametrics/cube.py index 85a7d4cf..0219d462 100644 --- a/deltametrics/cube.py +++ b/deltametrics/cube.py @@ -447,16 +447,17 @@ def quick_show(self, var, idx=-1, axis=0, **kwargs): -------- .. plot:: - :include-source: - >>> golfcube = dm.sample_data.golf() - >>> golfstrat = dm.cube.StratigraphyCube.from_DataCube( + >>> import matplotlib.pyplot as plt + >>> from deltametrics.cube import StratigraphyCube + >>> from deltametrics.sample_data.sample_data import golf + + >>> golfcube = golf() + >>> golfstrat = StratigraphyCube.from_DataCube( ... golfcube, dz=0.1) - ... >>> fig, ax = plt.subplots(2, 1) >>> golfcube.quick_show('eta', ax=ax[0]) # a Planform (axis=0) >>> golfstrat.quick_show('eta', idx=100, axis=2, ax=ax[1]) # a DipSection - >>> plt.show() """ if axis == 0: # this is a planform slice @@ -504,21 +505,20 @@ def show_cube(self, var, style="mesh", ve=200, ax=None): The following code snippets are not set up to actually make the plots in the documentation. - .. code:: - - >>> golfcube = dm.sample_data.golf() - >>> golfstrat = dm.cube.StratigraphyCube.from_DataCube( - ... golfcube, dz=0.1) - ... - >>> fig, ax = plt.subplots() - >>> golfstrat.show_cube('eta', ax=ax) + >>> import matplotlib.pyplot as plt + >>> from deltametrics.cube import StratigraphyCube + >>> from deltametrics.sample_data.sample_data import golf - .. code:: + >>> golfcube = golf() + >>> golfstrat = StratigraphyCube.from_DataCube( + ... golfcube, dz=0.1) + ... + >>> fig, ax = plt.subplots() + >>> golfstrat.show_cube('eta', ax=ax) # doctest: +SKIP - >>> golfcube = dm.sample_data.golf() - ... - >>> fig, ax = plt.subplots() - >>> golfcube.show_cube('velocity', style='fence', ax=ax) + >>> golfcube = golf() + >>> fig, ax = plt.subplots() + >>> golfcube.show_cube('velocity', style='fence', ax=ax) # doctest: +SKIP """ try: import pyvista as pv @@ -846,8 +846,11 @@ def from_DataCube( -------- Create a stratigraphy cube from the example ``golf``: - >>> golfcube = dm.sample_data.golf() - >>> stratcube = dm.cube.StratigraphyCube.from_DataCube(golfcube, dz=0.05) + >>> from deltametrics.cube import StratigraphyCube + >>> from deltametrics.sample_data.sample_data import golf + + >>> golfcube = golf() + >>> stratcube = StratigraphyCube.from_DataCube(golfcube, dz=0.05) Parameters ----------