matplotlib-map-utils 4.0.0__py3-none-any.whl → 4.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matplotlib_map_utils/__init__.py +32 -6
- matplotlib_map_utils/config.py +4 -0
- matplotlib_map_utils/core/inset_map.py +196 -242
- matplotlib_map_utils/core/north_arrow.py +99 -136
- matplotlib_map_utils/core/scale_bar.py +128 -193
- matplotlib_map_utils/defaults/__init__.py +3 -3
- matplotlib_map_utils/defaults/inset_map.py +5 -5
- matplotlib_map_utils/defaults/north_arrow.py +98 -310
- matplotlib_map_utils/defaults/scale_bar.py +92 -343
- matplotlib_map_utils/py.typed +0 -0
- matplotlib_map_utils/validation/inset_map.py +66 -69
- matplotlib_map_utils/validation/north_arrow.py +230 -160
- matplotlib_map_utils/validation/scale_bar.py +246 -202
- matplotlib_map_utils/validation/shared.py +101 -0
- {matplotlib_map_utils-4.0.0.dist-info → matplotlib_map_utils-4.1.1.dist-info}/METADATA +6 -3
- matplotlib_map_utils-4.1.1.dist-info/RECORD +26 -0
- matplotlib_map_utils/validation/functions.py +0 -264
- matplotlib_map_utils-4.0.0.dist-info/RECORD +0 -24
- {matplotlib_map_utils-4.0.0.dist-info → matplotlib_map_utils-4.1.1.dist-info}/WHEEL +0 -0
- {matplotlib_map_utils-4.0.0.dist-info → matplotlib_map_utils-4.1.1.dist-info}/licenses/LICENSE +0 -0
- {matplotlib_map_utils-4.0.0.dist-info → matplotlib_map_utils-4.1.1.dist-info}/top_level.txt +0 -0
matplotlib_map_utils/__init__.py
CHANGED
|
@@ -4,18 +4,44 @@ from .core.scale_bar import ScaleBar, scale_bar, dual_bars
|
|
|
4
4
|
from .core.inset_map import InsetMap, inset_map, ExtentIndicator, indicate_extent, DetailIndicator, indicate_detail, inset_usa
|
|
5
5
|
from typing import Literal
|
|
6
6
|
|
|
7
|
+
# TypedDicts describing the config dictionaries accepted by the objects/functions above.
|
|
8
|
+
# These power editor intellisense (key + value autocomplete) and can be used by callers
|
|
9
|
+
# to annotate their own config variables; runtime validation is still handled by pydantic.
|
|
10
|
+
from .validation.scale_bar import (ScaleBarBarDict, ScaleBarLabelsDict, ScaleBarUnitsDict,
|
|
11
|
+
ScaleBarTextDict, ScaleBarAobDict)
|
|
12
|
+
from .validation.north_arrow import (NorthArrowBaseDict, NorthArrowFancyDict, NorthArrowLabelDict,
|
|
13
|
+
NorthArrowShadowDict, NorthArrowPackDict, NorthArrowAobDict,
|
|
14
|
+
NorthArrowRotationDict)
|
|
15
|
+
from .validation.inset_map import InsetMapPlotDict
|
|
16
|
+
|
|
7
17
|
# This defines what wildcard imports should import
|
|
8
|
-
__all__ = ["NorthArrow", "north_arrow",
|
|
18
|
+
__all__ = ["NorthArrow", "north_arrow",
|
|
9
19
|
"ScaleBar", "scale_bar", "dual_bars",
|
|
10
20
|
"InsetMap","inset_map", "ExtentIndicator","indicate_extent", "DetailIndicator","indicate_detail", "inset_usa",
|
|
11
|
-
"set_size"
|
|
21
|
+
"set_size",
|
|
22
|
+
"ScaleBarBarDict", "ScaleBarLabelsDict", "ScaleBarUnitsDict", "ScaleBarTextDict", "ScaleBarAobDict",
|
|
23
|
+
"NorthArrowBaseDict", "NorthArrowFancyDict", "NorthArrowLabelDict", "NorthArrowShadowDict",
|
|
24
|
+
"NorthArrowPackDict", "NorthArrowAobDict", "NorthArrowRotationDict",
|
|
25
|
+
"InsetMapPlotDict"]
|
|
26
|
+
|
|
27
|
+
from . import config
|
|
12
28
|
|
|
13
29
|
def set_size(size: Literal["xs","xsmall","x-small",
|
|
14
30
|
"sm","small",
|
|
15
31
|
"md","medium",
|
|
16
32
|
"lg","large",
|
|
17
33
|
"xl","xlarge","x-large"]):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
|
|
35
|
+
# standardize the size string
|
|
36
|
+
size_map = {
|
|
37
|
+
"xs": "xs", "xsmall": "xs", "x-small": "xs",
|
|
38
|
+
"sm": "sm", "small": "sm",
|
|
39
|
+
"md": "md", "medium": "md",
|
|
40
|
+
"lg": "lg", "large": "lg",
|
|
41
|
+
"xl": "xl", "xlarge": "xl", "x-large": "xl"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if size.lower() not in size_map:
|
|
45
|
+
raise ValueError("Invalid value supplied, try one of ['xsmall', 'small', 'medium', 'large', 'xlarge']")
|
|
46
|
+
|
|
47
|
+
config.DEFAULT_SIZE = size_map[size.lower()]
|