Skip to content

Commit 5100006

Browse files
committed
updates
1 parent 1a26f96 commit 5100006

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

pygmt/params/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pygmt.params.box import Box

pygmt/params.py renamed to pygmt/params/base.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

3-
from collections.abc import Iterable, Sequence
4-
from dataclasses import dataclass
3+
from collections.abc import Iterable
54
from typing import NamedTuple
65

76

@@ -33,22 +32,3 @@ def __repr__(self):
3332
continue
3433
string.append(f"{alias.name}={value!r}")
3534
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-
]

pygmt/params/box.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
]

0 commit comments

Comments
 (0)