Skip to content

Commit 2f78dfc

Browse files
authored
Fix polygon plots in docs (#270)
1 parent 73b6bc0 commit 2f78dfc

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

docs/_static/tutorials/shapes_uml.svg

Lines changed: 8 additions & 8 deletions
Loading

src/data_morph/shapes/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def plot_available_shapes(self) -> Axes:
144144
num_rows,
145145
num_cols,
146146
layout='constrained',
147-
figsize=(12, 2 * num_rows),
147+
figsize=(2 * num_cols, 2 * num_rows),
148148
)
149149
fig.get_layout_engine().set(w_pad=0.2, h_pad=0.2)
150150

src/data_morph/shapes/lines/diamond.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Diamond(LineCollection):
1515
1616
import matplotlib.pyplot as plt
1717
from data_morph.data.loader import DataLoader
18-
from data_morph.shapes.polygons import Diamond
18+
from data_morph.shapes.lines import Diamond
1919
2020
_ = Diamond(DataLoader.load_dataset('panda')).plot()
2121

src/data_morph/shapes/lines/rectangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Rectangle(LineCollection):
1515
1616
import matplotlib.pyplot as plt
1717
from data_morph.data.loader import DataLoader
18-
from data_morph.shapes.polygons import Rectangle
18+
from data_morph.shapes.lines import Rectangle
1919
2020
_ = Rectangle(DataLoader.load_dataset('panda')).plot()
2121

src/data_morph/shapes/lines/star.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Star(LineCollection):
1515
1616
import matplotlib.pyplot as plt
1717
from data_morph.data.loader import DataLoader
18-
from data_morph.shapes.polygons import Star
18+
from data_morph.shapes.lines import Star
1919
2020
_ = Star(DataLoader.load_dataset('panda')).plot()
2121

tests/shapes/test_polygons.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Test polygons module."""
1+
"""Test polygons in the lines module."""
22

33
from numbers import Number
44

@@ -8,7 +8,7 @@
88
pytestmark = [pytest.mark.shapes, pytest.mark.lines, pytest.mark.polygons]
99

1010

11-
class PolygonsModuleTestBase:
11+
class PolygonsLineModuleTestBase:
1212
"""Base for testing polygon shapes."""
1313

1414
shape_name: str
@@ -47,7 +47,7 @@ def test_lines_form_polygon(self, shape):
4747
assert np.unique(endpoints, axis=0).shape[0] == self.expected_line_count
4848

4949

50-
class TestDiamond(PolygonsModuleTestBase):
50+
class TestDiamond(PolygonsLineModuleTestBase):
5151
"""Test the Diamond class."""
5252

5353
shape_name = 'diamond'
@@ -59,7 +59,7 @@ def test_slopes(self, slopes):
5959
np.testing.assert_array_equal(np.sort(slopes).flatten(), [-1.5, -1.5, 1.5, 1.5])
6060

6161

62-
class TestRectangle(PolygonsModuleTestBase):
62+
class TestRectangle(PolygonsLineModuleTestBase):
6363
"""Test the Rectangle class."""
6464

6565
shape_name = 'rectangle'
@@ -71,7 +71,7 @@ def test_slopes(self, slopes):
7171
np.testing.assert_array_equal(np.sort(slopes).flatten(), [0, 0, np.inf, np.inf])
7272

7373

74-
class TestStar(PolygonsModuleTestBase):
74+
class TestStar(PolygonsLineModuleTestBase):
7575
"""Test the Star class."""
7676

7777
shape_name = 'star'

0 commit comments

Comments
 (0)