Skip to content

Commit 847c818

Browse files
committed
Enable rings shape in factory.
1 parent ff95a29 commit 847c818

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/data_morph/shapes/factory.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ShapeFactory:
5151
'up_parab': points.UpParabola,
5252
'diamond': polygons.Diamond,
5353
'rectangle': polygons.Rectangle,
54+
'rings': circles.Rings,
5455
'star': polygons.Star,
5556
}
5657

@@ -61,22 +62,25 @@ class ShapeFactory:
6162
def __init__(self, dataset: Dataset) -> None:
6263
self._dataset: Dataset = dataset
6364

64-
def generate_shape(self, shape: str) -> Shape:
65+
def generate_shape(self, shape: str, **kwargs) -> Shape:
6566
"""
6667
Generate the shape object based on the dataset.
6768
6869
Parameters
6970
----------
7071
shape : str
7172
The desired shape. See :attr:`.AVAILABLE_SHAPES`.
73+
**kwargs
74+
Additional keyword arguments to pass down when creating
75+
the shape.
7276
7377
Returns
7478
-------
7579
Shape
7680
An shape object of the requested type.
7781
"""
7882
try:
79-
return self._SHAPE_MAPPING[shape](self._dataset)
83+
return self._SHAPE_MAPPING[shape](self._dataset, **kwargs)
8084
except KeyError as err:
8185
raise ValueError(f'No such shape as {shape}.') from err
8286

0 commit comments

Comments
 (0)