File tree Expand file tree Collapse file tree 3 files changed +30
-21
lines changed Expand file tree Collapse file tree 3 files changed +30
-21
lines changed Original file line number Diff line number Diff line change
1
+ from pygmt .params .box import Box
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from collections .abc import Iterable , Sequence
4
- from dataclasses import dataclass
3
+ from collections .abc import Iterable
5
4
from typing import NamedTuple
6
5
7
6
@@ -33,22 +32,3 @@ def __repr__(self):
33
32
continue
34
33
string .append (f"{ alias .name } ={ value !r} " )
35
34
return f"{ self .__class__ .__name__ } ({ ', ' .join (string )} )"
36
-
37
-
38
- @dataclass (repr = False )
39
- class Box (BaseParams ):
40
- clearance : float | str | Sequence [float | str ] | None = None
41
- fill : str | None = None
42
- innerborder : str | Sequence | None = None
43
- pen : str | None = None
44
- radius : float | bool | None = False
45
- shading : str | Sequence | None = None
46
-
47
- aliases = [
48
- Alias ("clearance" , "+c" , "/" ),
49
- Alias ("fill" , "+g" ),
50
- Alias ("innerborder" , "+i" , "/" ),
51
- Alias ("pen" , "+p" ),
52
- Alias ("radius" , "+r" ),
53
- Alias ("shading" , "+s" , "/" ),
54
- ]
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from dataclass import dataclass
6
+ from pygmt .params .base import Alias , BaseParams
7
+
8
+ if TYPE_CHECKING :
9
+ from collections .abc import Sequence
10
+
11
+
12
+ @dataclass (repr = False )
13
+ class Box (BaseParams ):
14
+ clearance : float | str | Sequence [float | str ] | None = None
15
+ fill : str | None = None
16
+ innerborder : str | Sequence | None = None
17
+ pen : str | None = None
18
+ radius : float | bool | None = False
19
+ shading : str | Sequence | None = None
20
+
21
+ aliases = [
22
+ Alias ("clearance" , "+c" , "/" ),
23
+ Alias ("fill" , "+g" ),
24
+ Alias ("innerborder" , "+i" , "/" ),
25
+ Alias ("pen" , "+p" ),
26
+ Alias ("radius" , "+r" ),
27
+ Alias ("shading" , "+s" , "/" ),
28
+ ]
You can’t perform that action at this time.
0 commit comments