__init__.pyi 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. __all__ = [
  2. "__bibtex__",
  3. "__version__",
  4. "__version_info__",
  5. "set_loglevel",
  6. "ExecutableNotFoundError",
  7. "get_configdir",
  8. "get_cachedir",
  9. "get_data_path",
  10. "matplotlib_fname",
  11. "MatplotlibDeprecationWarning",
  12. "RcParams",
  13. "rc_params",
  14. "rc_params_from_file",
  15. "rcParamsDefault",
  16. "rcParams",
  17. "rcParamsOrig",
  18. "defaultParams",
  19. "rc",
  20. "rcdefaults",
  21. "rc_file_defaults",
  22. "rc_file",
  23. "rc_context",
  24. "use",
  25. "get_backend",
  26. "interactive",
  27. "is_interactive",
  28. "colormaps",
  29. "color_sequences",
  30. ]
  31. import os
  32. from pathlib import Path
  33. from collections.abc import Callable, Generator
  34. import contextlib
  35. from packaging.version import Version
  36. from matplotlib._api import MatplotlibDeprecationWarning
  37. from typing import Any, Literal, NamedTuple, overload
  38. class _VersionInfo(NamedTuple):
  39. major: int
  40. minor: int
  41. micro: int
  42. releaselevel: str
  43. serial: int
  44. __bibtex__: str
  45. __version__: str
  46. __version_info__: _VersionInfo
  47. def set_loglevel(level: str) -> None: ...
  48. class _ExecInfo(NamedTuple):
  49. executable: str
  50. raw_version: str
  51. version: Version
  52. class ExecutableNotFoundError(FileNotFoundError): ...
  53. def _get_executable_info(name: str) -> _ExecInfo: ...
  54. def get_configdir() -> str: ...
  55. def get_cachedir() -> str: ...
  56. def get_data_path() -> str: ...
  57. def matplotlib_fname() -> str: ...
  58. class RcParams(dict[str, Any]):
  59. validate: dict[str, Callable]
  60. def __init__(self, *args, **kwargs) -> None: ...
  61. def _set(self, key: str, val: Any) -> None: ...
  62. def _get(self, key: str) -> Any: ...
  63. def _update_raw(self, other_params: dict | RcParams) -> None: ...
  64. def _ensure_has_backend(self) -> None: ...
  65. def __setitem__(self, key: str, val: Any) -> None: ...
  66. def __getitem__(self, key: str) -> Any: ...
  67. def __iter__(self) -> Generator[str, None, None]: ...
  68. def __len__(self) -> int: ...
  69. def find_all(self, pattern: str) -> RcParams: ...
  70. def copy(self) -> RcParams: ...
  71. def rc_params(fail_on_error: bool = ...) -> RcParams: ...
  72. def rc_params_from_file(
  73. fname: str | Path | os.PathLike,
  74. fail_on_error: bool = ...,
  75. use_default_template: bool = ...,
  76. ) -> RcParams: ...
  77. rcParamsDefault: RcParams
  78. rcParams: RcParams
  79. rcParamsOrig: RcParams
  80. defaultParams: dict[str, Any]
  81. def rc(group: str, **kwargs) -> None: ...
  82. def rcdefaults() -> None: ...
  83. def rc_file_defaults() -> None: ...
  84. def rc_file(
  85. fname: str | Path | os.PathLike, *, use_default_template: bool = ...
  86. ) -> None: ...
  87. @contextlib.contextmanager
  88. def rc_context(
  89. rc: dict[str, Any] | None = ..., fname: str | Path | os.PathLike | None = ...
  90. ) -> Generator[None, None, None]: ...
  91. def use(backend: str, *, force: bool = ...) -> None: ...
  92. @overload
  93. def get_backend(*, auto_select: Literal[True] = True) -> str: ...
  94. @overload
  95. def get_backend(*, auto_select: Literal[False]) -> str | None: ...
  96. def interactive(b: bool) -> None: ...
  97. def is_interactive() -> bool: ...
  98. def _preprocess_data(
  99. func: Callable | None = ...,
  100. *,
  101. replace_names: list[str] | None = ...,
  102. label_namer: str | None = ...
  103. ) -> Callable: ...
  104. from matplotlib.cm import _colormaps as colormaps # noqa: E402
  105. from matplotlib.cm import _multivar_colormaps as multivar_colormaps # noqa: E402
  106. from matplotlib.cm import _bivar_colormaps as bivar_colormaps # noqa: E402
  107. from matplotlib.colors import _color_sequences as color_sequences # noqa: E402