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.
@@ -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
- NorthArrow.set_size(size)
20
- ScaleBar.set_size(size)
21
- InsetMap.set_size(size)
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()]
@@ -0,0 +1,4 @@
1
+ # Global configuration variables for matplotlib-map-utils
2
+
3
+ # Default size used across all artists if no size is specified during initialization
4
+ DEFAULT_SIZE = "md"