rcsetup.pyi 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. from cycler import Cycler
  2. from collections.abc import Callable, Iterable
  3. from typing import Any, Literal, TypeVar
  4. from matplotlib.typing import ColorType, LineStyleType, MarkEveryType
  5. interactive_bk: list[str]
  6. non_interactive_bk: list[str]
  7. all_backends: list[str]
  8. _T = TypeVar("_T")
  9. def _listify_validator(s: Callable[[Any], _T]) -> Callable[[Any], list[_T]]: ...
  10. class ValidateInStrings:
  11. key: str
  12. ignorecase: bool
  13. valid: dict[str, str]
  14. def __init__(
  15. self,
  16. key: str,
  17. valid: Iterable[str],
  18. ignorecase: bool = ...,
  19. *,
  20. _deprecated_since: str | None = ...
  21. ) -> None: ...
  22. def __call__(self, s: Any) -> str: ...
  23. def validate_any(s: Any) -> Any: ...
  24. def validate_anylist(s: Any) -> list[Any]: ...
  25. def validate_bool(b: Any) -> bool: ...
  26. def validate_axisbelow(s: Any) -> bool | Literal["line"]: ...
  27. def validate_dpi(s: Any) -> Literal["figure"] | float: ...
  28. def validate_string(s: Any) -> str: ...
  29. def validate_string_or_None(s: Any) -> str | None: ...
  30. def validate_stringlist(s: Any) -> list[str]: ...
  31. def validate_int(s: Any) -> int: ...
  32. def validate_int_or_None(s: Any) -> int | None: ...
  33. def validate_float(s: Any) -> float: ...
  34. def validate_float_or_None(s: Any) -> float | None: ...
  35. def validate_floatlist(s: Any) -> list[float]: ...
  36. def validate_fonttype(s: Any) -> int: ...
  37. _auto_backend_sentinel: object
  38. def validate_backend(s: Any) -> str: ...
  39. def validate_color_or_inherit(s: Any) -> Literal["inherit"] | ColorType: ...
  40. def validate_color_or_auto(s: Any) -> ColorType | Literal["auto"]: ...
  41. def validate_color_for_prop_cycle(s: Any) -> ColorType: ...
  42. def validate_color(s: Any) -> ColorType: ...
  43. def validate_colorlist(s: Any) -> list[ColorType]: ...
  44. def _validate_color_or_linecolor(
  45. s: Any,
  46. ) -> ColorType | Literal["linecolor", "markerfacecolor", "markeredgecolor"] | None: ...
  47. def validate_aspect(s: Any) -> Literal["auto", "equal"] | float: ...
  48. def validate_fontsize_None(
  49. s: Any,
  50. ) -> Literal[
  51. "xx-small",
  52. "x-small",
  53. "small",
  54. "medium",
  55. "large",
  56. "x-large",
  57. "xx-large",
  58. "smaller",
  59. "larger",
  60. ] | float | None: ...
  61. def validate_fontsize(
  62. s: Any,
  63. ) -> Literal[
  64. "xx-small",
  65. "x-small",
  66. "small",
  67. "medium",
  68. "large",
  69. "x-large",
  70. "xx-large",
  71. "smaller",
  72. "larger",
  73. ] | float: ...
  74. def validate_fontsizelist(
  75. s: Any,
  76. ) -> list[
  77. Literal[
  78. "xx-small",
  79. "x-small",
  80. "small",
  81. "medium",
  82. "large",
  83. "x-large",
  84. "xx-large",
  85. "smaller",
  86. "larger",
  87. ]
  88. | float
  89. ]: ...
  90. def validate_fontweight(
  91. s: Any,
  92. ) -> Literal[
  93. "ultralight",
  94. "light",
  95. "normal",
  96. "regular",
  97. "book",
  98. "medium",
  99. "roman",
  100. "semibold",
  101. "demibold",
  102. "demi",
  103. "bold",
  104. "heavy",
  105. "extra bold",
  106. "black",
  107. ] | int: ...
  108. def validate_fontstretch(
  109. s: Any,
  110. ) -> Literal[
  111. "ultra-condensed",
  112. "extra-condensed",
  113. "condensed",
  114. "semi-condensed",
  115. "normal",
  116. "semi-expanded",
  117. "expanded",
  118. "extra-expanded",
  119. "ultra-expanded",
  120. ] | int: ...
  121. def validate_font_properties(s: Any) -> dict[str, Any]: ...
  122. def validate_whiskers(s: Any) -> list[float] | float: ...
  123. def validate_ps_distiller(s: Any) -> None | Literal["ghostscript", "xpdf"]: ...
  124. validate_fillstyle: ValidateInStrings
  125. def validate_fillstylelist(
  126. s: Any,
  127. ) -> list[Literal["full", "left", "right", "bottom", "top", "none"]]: ...
  128. def validate_markevery(s: Any) -> MarkEveryType: ...
  129. def _validate_linestyle(s: Any) -> LineStyleType: ...
  130. def validate_markeverylist(s: Any) -> list[MarkEveryType]: ...
  131. def validate_bbox(s: Any) -> Literal["tight", "standard"] | None: ...
  132. def validate_sketch(s: Any) -> None | tuple[float, float, float]: ...
  133. def validate_hatch(s: Any) -> str: ...
  134. def validate_hatchlist(s: Any) -> list[str]: ...
  135. def validate_dashlist(s: Any) -> list[list[float]]: ...
  136. # TODO: copy cycler overloads?
  137. def cycler(*args, **kwargs) -> Cycler: ...
  138. def validate_cycler(s: Any) -> Cycler: ...
  139. def validate_hist_bins(
  140. s: Any,
  141. ) -> Literal["auto", "sturges", "fd", "doane", "scott", "rice", "sqrt"] | int | list[
  142. float
  143. ]: ...
  144. # At runtime is added in __init__.py
  145. defaultParams: dict[str, Any]