Skip to content

Commit 0a08393

Browse files
committed
Use shape diagnostic function to display all shapes in the docs
1 parent b1bd99b commit 0a08393

21 files changed

+113
-28
lines changed

src/data_morph/shapes/circles/bullseye.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ class Bullseye(Rings):
2222
This shape is generated using the panda dataset.
2323
2424
from data_morph.data.loader import DataLoader
25+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
2526
from data_morph.shapes.circles import Bullseye
2627
27-
_ = Bullseye(DataLoader.load_dataset('panda')).plot()
28+
dataset = DataLoader.load_dataset('panda')
29+
shape = Bullseye(dataset)
30+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2831
2932
See Also
3033
--------

src/data_morph/shapes/circles/circle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ class Circle(Shape):
2828
This shape is generated using the panda dataset.
2929
3030
from data_morph.data.loader import DataLoader
31+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
3132
from data_morph.shapes.circles import Circle
3233
33-
_ = Circle(DataLoader.load_dataset('panda')).plot()
34+
dataset = DataLoader.load_dataset('panda')
35+
shape = Circle(dataset)
36+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
3437
3538
Parameters
3639
----------

src/data_morph/shapes/circles/rings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ class Rings(Shape):
2828
This shape is generated using the panda dataset.
2929
3030
from data_morph.data.loader import DataLoader
31+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
3132
from data_morph.shapes.circles import Rings
3233
33-
_ = Rings(DataLoader.load_dataset('panda')).plot()
34+
dataset = DataLoader.load_dataset('panda')
35+
shape = Rings(dataset)
36+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
3437
3538
Parameters
3639
----------

src/data_morph/shapes/lines/diamond.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ class Diamond(LineCollection):
1313
:caption:
1414
This shape is generated using the panda dataset.
1515
16-
import matplotlib.pyplot as plt
1716
from data_morph.data.loader import DataLoader
17+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1818
from data_morph.shapes.lines import Diamond
1919
20-
_ = Diamond(DataLoader.load_dataset('panda')).plot()
20+
dataset = DataLoader.load_dataset('panda')
21+
shape = Diamond(dataset)
22+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2123
2224
Parameters
2325
----------

src/data_morph/shapes/lines/high_lines.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ class HighLines(LineCollection):
1414
This shape is generated using the panda dataset.
1515
1616
from data_morph.data.loader import DataLoader
17+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1718
from data_morph.shapes.lines import HighLines
1819
19-
_ = HighLines(DataLoader.load_dataset('panda')).plot()
20+
dataset = DataLoader.load_dataset('panda')
21+
shape = HighLines(dataset)
22+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2023
2124
Parameters
2225
----------

src/data_morph/shapes/lines/horizontal_lines.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ class HorizontalLines(LineCollection):
1616
This shape is generated using the panda dataset.
1717
1818
from data_morph.data.loader import DataLoader
19+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1920
from data_morph.shapes.lines import HorizontalLines
2021
21-
_ = HorizontalLines(DataLoader.load_dataset('panda')).plot()
22+
dataset = DataLoader.load_dataset('panda')
23+
shape = HorizontalLines(dataset)
24+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2225
2326
Parameters
2427
----------

src/data_morph/shapes/lines/rectangle.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ class Rectangle(LineCollection):
1313
:caption:
1414
This shape is generated using the panda dataset.
1515
16-
import matplotlib.pyplot as plt
1716
from data_morph.data.loader import DataLoader
17+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1818
from data_morph.shapes.lines import Rectangle
1919
20-
_ = Rectangle(DataLoader.load_dataset('panda')).plot()
20+
dataset = DataLoader.load_dataset('panda')
21+
shape = Rectangle(dataset)
22+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2123
2224
Parameters
2325
----------

src/data_morph/shapes/lines/slant_down.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ class SlantDownLines(LineCollection):
1414
This shape is generated using the panda dataset.
1515
1616
from data_morph.data.loader import DataLoader
17+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1718
from data_morph.shapes.lines import SlantDownLines
1819
19-
_ = SlantDownLines(DataLoader.load_dataset('panda')).plot()
20+
dataset = DataLoader.load_dataset('panda')
21+
shape = SlantDownLines(dataset)
22+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2023
2124
Parameters
2225
----------

src/data_morph/shapes/lines/slant_up.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ class SlantUpLines(LineCollection):
1414
This shape is generated using the panda dataset.
1515
1616
from data_morph.data.loader import DataLoader
17+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
1718
from data_morph.shapes.lines import SlantUpLines
1819
19-
_ = SlantUpLines(DataLoader.load_dataset('panda')).plot()
20+
dataset = DataLoader.load_dataset('panda')
21+
shape = SlantUpLines(dataset)
22+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2023
2124
Parameters
2225
----------

src/data_morph/shapes/lines/star.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ class Star(LineCollection):
1515
:caption:
1616
This shape is generated using the panda dataset.
1717
18-
import matplotlib.pyplot as plt
1918
from data_morph.data.loader import DataLoader
19+
from data_morph.plotting.diagnostics import plot_shape_on_dataset
2020
from data_morph.shapes.lines import Star
2121
22-
_ = Star(DataLoader.load_dataset('panda')).plot()
22+
dataset = DataLoader.load_dataset('panda')
23+
shape = Star(dataset)
24+
plot_shape_on_dataset(dataset, shape, show_bounds=False, alpha=0.25)
2325
2426
Parameters
2527
----------

0 commit comments

Comments
 (0)