ukceh-time-stream 4.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.
- time_stream/__init__.py +32 -0
- time_stream/aggregation.py +1166 -0
- time_stream/base.py +1168 -0
- time_stream/exceptions.py +177 -0
- time_stream/flags/bitwise_flag_system.py +162 -0
- time_stream/flags/categorical_flag_system.py +213 -0
- time_stream/flags/flag_manager.py +899 -0
- time_stream/flags/flag_system.py +148 -0
- time_stream/formatting.py +243 -0
- time_stream/infill.py +908 -0
- time_stream/metadata.py +99 -0
- time_stream/operation.py +111 -0
- time_stream/py.typed +0 -0
- time_stream/qc.py +387 -0
- time_stream/time_manager.py +444 -0
- time_stream/types.py +19 -0
- time_stream/utils.py +566 -0
- ukceh_time_stream-4.0.0.dist-info/METADATA +211 -0
- ukceh_time_stream-4.0.0.dist-info/RECORD +21 -0
- ukceh_time_stream-4.0.0.dist-info/WHEEL +4 -0
- ukceh_time_stream-4.0.0.dist-info/licenses/LICENSE +21 -0
time_stream/__init__.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
2
|
+
from typing import TYPE_CHECKING, Any
|
|
3
|
+
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
# These imports are only for static type checkers (e.g., Pyright, IDEs).
|
|
6
|
+
# At runtime, they are not executed, so the modules won't be imported unless needed.
|
|
7
|
+
from time_stream.base import TimeFrame
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
__version__ = version("ukceh-time-stream")
|
|
12
|
+
except PackageNotFoundError:
|
|
13
|
+
__version__ = "unknown"
|
|
14
|
+
|
|
15
|
+
# Declare the public API of the package. This tells `from time_stream import *` what to include.
|
|
16
|
+
__all__ = ["TimeFrame"] # noqa
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def __getattr__(name: str) -> Any:
|
|
20
|
+
# NOTE: We use __getattr__ for lazy imports instead of top-level imports because setuptools may evaluate
|
|
21
|
+
# this module during build (e.g., to use the value of time_stream.__version__), before submodules like
|
|
22
|
+
# `time_stream.base` exist. This avoids import-time errors when building from source using pyproject.toml
|
|
23
|
+
# and ensures compatibility with dynamic versioning tools like autosemver.
|
|
24
|
+
#
|
|
25
|
+
# This 'lazy loading' also has additional benefits in that it can help with performance by avoiding unnecessary
|
|
26
|
+
# dependencies being loaded at startup and also gives us control over what to expose from the package.
|
|
27
|
+
|
|
28
|
+
if name == "TimeFrame":
|
|
29
|
+
from time_stream.base import TimeFrame # noqa: PLC0415
|
|
30
|
+
|
|
31
|
+
return TimeFrame
|
|
32
|
+
raise AttributeError(f"module {__name__} has no attribute {name}")
|