pyplotutil 2.0.0__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.
- pyplotutil/__init__.py +70 -0
- pyplotutil/_typing.py +38 -0
- pyplotutil/datautil.py +1295 -0
- pyplotutil/loggingutil.py +743 -0
- pyplotutil/plotutil.py +846 -0
- pyplotutil/py.typed +0 -0
- pyplotutil-2.0.0.dist-info/METADATA +123 -0
- pyplotutil-2.0.0.dist-info/RECORD +10 -0
- pyplotutil-2.0.0.dist-info/WHEEL +4 -0
- pyplotutil-2.0.0.dist-info/licenses/LICENSE +21 -0
pyplotutil/__init__.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Plotting and data handling utility package."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
6
|
+
|
|
7
|
+
from pyplotutil.datautil import BaseData, Data, Dataset, TaggedData
|
|
8
|
+
from pyplotutil.loggingutil import (
|
|
9
|
+
FakeLogger,
|
|
10
|
+
check_level,
|
|
11
|
+
event_logger,
|
|
12
|
+
evlog,
|
|
13
|
+
get_event_logger_filename,
|
|
14
|
+
get_logging_level_from_verbose_count,
|
|
15
|
+
start_event_logging,
|
|
16
|
+
start_logging,
|
|
17
|
+
)
|
|
18
|
+
from pyplotutil.plotutil import (
|
|
19
|
+
apply_ieee_style,
|
|
20
|
+
apply_nature_style,
|
|
21
|
+
apply_notebook_style,
|
|
22
|
+
apply_science_style,
|
|
23
|
+
apply_style,
|
|
24
|
+
calculate_mean_err,
|
|
25
|
+
compatible_filename,
|
|
26
|
+
extract_common_path,
|
|
27
|
+
fill_between_err,
|
|
28
|
+
get_limits,
|
|
29
|
+
get_tlim_mask,
|
|
30
|
+
make_figure_paths,
|
|
31
|
+
plot_mean_err,
|
|
32
|
+
plot_multi_timeseries,
|
|
33
|
+
save_figure,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
try:
|
|
37
|
+
__version__ = version("pyplotutil")
|
|
38
|
+
except PackageNotFoundError: # pragma: no cover -- only when the package is not installed
|
|
39
|
+
__version__ = "0.0.0+unknown"
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"BaseData",
|
|
43
|
+
"Data",
|
|
44
|
+
"Dataset",
|
|
45
|
+
"FakeLogger",
|
|
46
|
+
"TaggedData",
|
|
47
|
+
"__version__",
|
|
48
|
+
"apply_ieee_style",
|
|
49
|
+
"apply_nature_style",
|
|
50
|
+
"apply_notebook_style",
|
|
51
|
+
"apply_science_style",
|
|
52
|
+
"apply_style",
|
|
53
|
+
"calculate_mean_err",
|
|
54
|
+
"check_level",
|
|
55
|
+
"compatible_filename",
|
|
56
|
+
"event_logger",
|
|
57
|
+
"evlog",
|
|
58
|
+
"extract_common_path",
|
|
59
|
+
"fill_between_err",
|
|
60
|
+
"get_event_logger_filename",
|
|
61
|
+
"get_limits",
|
|
62
|
+
"get_logging_level_from_verbose_count",
|
|
63
|
+
"get_tlim_mask",
|
|
64
|
+
"make_figure_paths",
|
|
65
|
+
"plot_mean_err",
|
|
66
|
+
"plot_multi_timeseries",
|
|
67
|
+
"save_figure",
|
|
68
|
+
"start_event_logging",
|
|
69
|
+
"start_logging",
|
|
70
|
+
]
|
pyplotutil/_typing.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
from enum import Enum, auto
|
|
5
|
+
from io import StringIO
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any, Final, Literal, TypeAlias, TypeVar
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
import polars as pl
|
|
11
|
+
|
|
12
|
+
Unknown: TypeAlias = Any
|
|
13
|
+
FilePath: TypeAlias = str | Path
|
|
14
|
+
DataSourceType: TypeAlias = FilePath | StringIO | pl.DataFrame | pl.Series
|
|
15
|
+
NumericType: TypeAlias = int | float | complex | np.number
|
|
16
|
+
NumericTypeVar = TypeVar("NumericTypeVar", bound=NumericType)
|
|
17
|
+
|
|
18
|
+
SingleIndexSelector: TypeAlias = int
|
|
19
|
+
MultiIndexSelector: TypeAlias = slice | range | Sequence[int] | pl.Series | np.ndarray
|
|
20
|
+
SingleNameSelector: TypeAlias = str
|
|
21
|
+
MultiNameSelector: TypeAlias = slice | Sequence[str] | pl.Series | np.ndarray
|
|
22
|
+
BooleanMask: TypeAlias = Sequence[bool] | pl.Series | np.ndarray
|
|
23
|
+
SingleColSelector: TypeAlias = SingleIndexSelector | SingleNameSelector
|
|
24
|
+
MultiColSelector: TypeAlias = MultiIndexSelector | MultiNameSelector | BooleanMask
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class _NoDefault(Enum):
|
|
28
|
+
"""Enum to represent the absence of a default value in method parameters."""
|
|
29
|
+
|
|
30
|
+
no_default = auto()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
no_default: Final = _NoDefault.no_default
|
|
34
|
+
NoDefault: TypeAlias = Literal[_NoDefault.no_default]
|
|
35
|
+
|
|
36
|
+
# Local Variables:
|
|
37
|
+
# jinx-local-words: "Enum"
|
|
38
|
+
# End:
|