@@ -36,6 +36,11 @@ def merge_dict(dict_1: dict, dict_2: dict) -> None:
36
36
dict_1 [k ] = dict_2 [k ]
37
37
38
38
39
+ class BaseStyle (BaseModel ):
40
+ class Config :
41
+ use_enum_values = True
42
+
43
+
39
44
class FillStyleEnum (str , Enum ):
40
45
"""Constants that represent the possible fill styles for markers."""
41
46
@@ -99,7 +104,7 @@ class DashCapStyleEnum(str, Enum):
99
104
ROUND = "round"
100
105
101
106
102
- class MarkerStyle (BaseModel ):
107
+ class MarkerStyle (BaseStyle ):
103
108
"""
104
109
Styling properties for markers.
105
110
@@ -154,7 +159,7 @@ def matplot_kwargs(self, size_multiplier: float = 1.0) -> dict:
154
159
)
155
160
156
161
157
- class LineStyle (BaseModel ):
162
+ class LineStyle (BaseStyle ):
158
163
"""
159
164
Styling properties for lines.
160
165
@@ -204,7 +209,7 @@ def matplot_kwargs(self, size_multiplier: float = 1.0) -> dict:
204
209
return result
205
210
206
211
207
- class PolygonStyle (BaseModel ):
212
+ class PolygonStyle (BaseStyle ):
208
213
"""
209
214
Styling properties for polygons.
210
215
@@ -244,7 +249,7 @@ def matplot_kwargs(self, size_multiplier: float = 1.0) -> dict:
244
249
)
245
250
246
251
247
- class LabelStyle (BaseModel ):
252
+ class LabelStyle (BaseStyle ):
248
253
"""
249
254
Styling properties for a label.
250
255
@@ -295,7 +300,7 @@ def matplot_kwargs(self, size_multiplier: float = 1.0) -> dict:
295
300
)
296
301
297
302
298
- class ObjectStyle (BaseModel ):
303
+ class ObjectStyle (BaseStyle ):
299
304
"""Defines the style for a SkyObject"""
300
305
301
306
marker : MarkerStyle = MarkerStyle ()
@@ -305,7 +310,7 @@ class ObjectStyle(BaseModel):
305
310
"""Style for the object's label (see [LabelStyle][starplot.styles.LabelStyle])"""
306
311
307
312
308
- class PathStyle (BaseModel ):
313
+ class PathStyle (BaseStyle ):
309
314
"""Defines the style for a path (e.g. constellation lines)"""
310
315
311
316
line : LineStyle = LineStyle ()
@@ -315,7 +320,7 @@ class PathStyle(BaseModel):
315
320
"""Style for the path's label (see [LabelStyle][starplot.styles.LabelStyle])"""
316
321
317
322
318
- class PlotStyle (BaseModel ):
323
+ class PlotStyle (BaseStyle ):
319
324
"""
320
325
Defines the styling for a plot
321
326
"""
0 commit comments