Skip to content

Commit e08a76a

Browse files
committed
Renamed shapes->shape, annotations->annotation
1 parent e8162da commit e08a76a

File tree

26 files changed

+93
-114
lines changed

26 files changed

+93
-114
lines changed

doc/features/items/overview.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ Annotations
6969

7070
The following annotation items are available:
7171

72-
* :py:class:`.annotations.AnnotatedPoint`
73-
* :py:class:`.annotations.AnnotatedSegment`
74-
* :py:class:`.annotations.AnnotatedRectangle`
75-
* :py:class:`.annotations.AnnotatedObliqueRectangle`
76-
* :py:class:`.annotations.AnnotatedEllipse`
77-
* :py:class:`.annotations.AnnotatedCircle`
72+
* :py:class:`.AnnotatedPoint`
73+
* :py:class:`.AnnotatedSegment`
74+
* :py:class:`.AnnotatedRectangle`
75+
* :py:class:`.AnnotatedObliqueRectangle`
76+
* :py:class:`.AnnotatedEllipse`
77+
* :py:class:`.AnnotatedCircle`
7878

7979
Labels
8080
^^^^^^
8181

8282
The following label items are available:
8383

84-
* :py:class:`.label.LabelItem`
85-
* :py:class:`.label.LegendBoxItem`
86-
* :py:class:`.label.SelectedLegendBoxItem`
87-
* :py:class:`.label.RangeComputation`
88-
* :py:class:`.label.RangeComputation2d`
89-
* :py:class:`.label.DataInfoLabel`
84+
* :py:class:`.LabelItem`
85+
* :py:class:`.LegendBoxItem`
86+
* :py:class:`.SelectedLegendBoxItem`
87+
* :py:class:`.RangeComputation`
88+
* :py:class:`.RangeComputation2d`
89+
* :py:class:`.DataInfoLabel`

plotpy/io.py

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -623,38 +623,18 @@ def register_serializable_items(modname, classnames):
623623

624624
# Curves
625625
register_serializable_items(
626-
"plotpy.items.curve.base",
627-
["CurveItem"],
628-
)
629-
register_serializable_items(
630-
"plotpy.items.polygon",
631-
["PolygonMapItem"],
632-
)
633-
register_serializable_items(
634-
"plotpy.items.curve.errorbar",
635-
["ErrorBarCurveItem"],
636-
)
637-
# Images
638-
register_serializable_items(
639-
"plotpy.items.image.base",
640-
["RawImageItem"],
641-
)
642-
register_serializable_items(
643-
"plotpy.items.image.image_items",
644-
["ImageItem", "XYImageItem", "RGBImageItem"],
645-
)
646-
register_serializable_items(
647-
"plotpy.items.image.transform",
648-
["TrImageItem"],
649-
)
650-
register_serializable_items(
651-
"plotpy.items.image.masked",
652-
["MaskedImageItem", "MaskedXYImageItem"],
653-
)
654-
# Shapes
655-
register_serializable_items(
656-
"plotpy.items.shapes",
626+
"plotpy.items",
657627
[
628+
"CurveItem",
629+
"PolygonMapItem",
630+
"ErrorBarCurveItem",
631+
"RawImageItem",
632+
"ImageItem",
633+
"XYImageItem",
634+
"RGBImageItem",
635+
"TrImageItem",
636+
"MaskedImageItem",
637+
"MaskedXYImageItem",
658638
"Marker",
659639
"PolygonShape",
660640
"PointShape",
@@ -663,25 +643,17 @@ def register_serializable_items(modname, classnames):
663643
"ObliqueRectangleShape",
664644
"EllipseShape",
665645
"Axes",
666-
],
667-
)
668-
# Annotations
669-
register_serializable_items(
670-
"plotpy.items.annotations",
671-
[
672646
"AnnotatedPoint",
673647
"AnnotatedSegment",
674648
"AnnotatedRectangle",
675649
"AnnotatedObliqueRectangle",
676650
"AnnotatedEllipse",
677651
"AnnotatedCircle",
652+
"LabelItem",
653+
"LegendBoxItem",
654+
"SelectedLegendBoxItem",
678655
],
679656
)
680-
# Labels
681-
register_serializable_items(
682-
"plotpy.items.label",
683-
["LabelItem", "LegendBoxItem", "SelectedLegendBoxItem"],
684-
)
685657

686658

687659
def item_class_from_name(name: str) -> type[Any] | None:

plotpy/items/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
# pylint: disable=unused-import
4-
from .annotations import (
4+
from .annotation import (
55
AnnotatedCircle,
66
AnnotatedEllipse,
77
AnnotatedObliqueRectangle,
@@ -48,7 +48,7 @@
4848
SelectedLegendBoxItem,
4949
)
5050
from .polygon import PolygonMapItem
51-
from .shapes import (
51+
from .shape import (
5252
AbstractShape,
5353
Axes,
5454
CircleSVGShape,
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Annotations
1010
-----------
1111
12-
The :mod:`annotations` module provides annotated shape plot items.
12+
The :mod:`annotation` module provides annotated shape plot items.
1313
"""
1414

1515
from __future__ import annotations
@@ -25,11 +25,11 @@
2525
from plotpy.coords import canvas_to_axes
2626
from plotpy.interfaces import IBasePlotItem, ISerializableType, IShapeItemType
2727
from plotpy.items.label import DataInfoLabel
28-
from plotpy.items.shapes.base import AbstractShape
29-
from plotpy.items.shapes.ellipse import EllipseShape
30-
from plotpy.items.shapes.point import PointShape
31-
from plotpy.items.shapes.rectangle import ObliqueRectangleShape, RectangleShape
32-
from plotpy.items.shapes.segment import SegmentShape
28+
from plotpy.items.shape.base import AbstractShape
29+
from plotpy.items.shape.ellipse import EllipseShape
30+
from plotpy.items.shape.point import PointShape
31+
from plotpy.items.shape.rectangle import ObliqueRectangleShape, RectangleShape
32+
from plotpy.items.shape.segment import SegmentShape
3333
from plotpy.mathutils.geometry import (
3434
compute_angle,
3535
compute_center,

plotpy/items/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
from plotpy.config import _
3131
from plotpy.contour2d import contour_2d_grid, contour_2d_ortho
32-
from plotpy.items.shapes.polygon import PolygonShape
32+
from plotpy.items.shape.polygon import PolygonShape
3333
from plotpy.styles import ShapeParam
3434

3535

plotpy/items/image/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ITrackableItemType,
4040
IVoiImageItemType,
4141
)
42-
from plotpy.items.shapes.rectangle import RectangleShape
42+
from plotpy.items.shape.rectangle import RectangleShape
4343
from plotpy.lutrange import lut_range_threshold
4444
from plotpy.mathutils.colormap import FULLRANGE, get_cmap, get_cmap_name
4545
from plotpy.styles.image import LUTAlpha, RawImageParam

plotpy/items/shape/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# pylint: disable=W0611
4+
from .axis import Axes
5+
from .base import AbstractShape
6+
from .ellipse import EllipseShape
7+
from .marker import Marker
8+
from .point import PointShape
9+
from .polygon import PolygonShape
10+
from .range import XRangeSelection
11+
from .rectangle import ObliqueRectangleShape, RectangleShape
12+
from .segment import SegmentShape
13+
from .svg import CircleSVGShape, RectangleSVGShape, SquareSVGShape
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from qtpy import QtGui as QG
1414

1515
from plotpy.config import CONF, _
16-
from plotpy.items.shapes.polygon import PolygonShape
16+
from plotpy.items.shape.polygon import PolygonShape
1717
from plotpy.styles.shape import AxesShapeParam
1818

1919
if TYPE_CHECKING: # pragma: no cover
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from qtpy import QtGui as QG
1414
from qwt import QwtSymbol
1515

16-
from plotpy.items.shapes.polygon import PolygonShape
16+
from plotpy.items.shape.polygon import PolygonShape
1717
from plotpy.mathutils.geometry import compute_angle, compute_center
1818

1919
if TYPE_CHECKING: # pragma: no cover

0 commit comments

Comments
 (0)