hyper-post 0.1.5__cp313-cp313-win_amd64.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.
LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hyper_post contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
hyper_post/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from hyper_post._api import finalize
2
+
3
+ __all__ = ["finalize"]
hyper_post/_api.py ADDED
@@ -0,0 +1,53 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Literal
4
+
5
+ import numpy as np
6
+
7
+ try:
8
+ from hyper_post._native import finalize_impl
9
+ except ImportError as exc: # pragma: no cover - depends on wheel contents
10
+ raise ImportError(
11
+ "hyper_post native extension failed to load. "
12
+ "Install a matching wheel for this platform and Python 3.11–3.13; "
13
+ "there is no pure-Python fallback."
14
+ ) from exc
15
+
16
+ _ALLOWED_TARGETS = frozenset({"y1", "y2"})
17
+ _DEFAULT_STRENGTH = 0.05
18
+ _FLOAT_DTYPES = {np.dtype(np.float32), np.dtype(np.float64)}
19
+
20
+
21
+ def finalize(
22
+ predictions: np.ndarray,
23
+ *,
24
+ target: Literal["y1", "y2"],
25
+ strength: float = _DEFAULT_STRENGTH,
26
+ ) -> np.ndarray:
27
+ """Apply the selected offline output-processing profile to a NumPy array."""
28
+ if isinstance(target, bool) or not isinstance(target, str):
29
+ raise TypeError("target must be the string 'y1' or 'y2'")
30
+ if target not in _ALLOWED_TARGETS:
31
+ raise ValueError("target must be exactly 'y1' or 'y2'")
32
+
33
+ if isinstance(strength, bool) or isinstance(strength, str):
34
+ raise TypeError("strength must be a real number")
35
+ if not isinstance(strength, (int, float, np.integer, np.floating)):
36
+ raise TypeError("strength must be a real number")
37
+ strength_f = float(strength)
38
+ if not np.isfinite(strength_f):
39
+ raise ValueError("strength must be a finite real number")
40
+ if strength_f < 0.0 or strength_f > 1.0:
41
+ raise ValueError("strength must be in [0, 1]")
42
+
43
+ if not isinstance(predictions, np.ndarray):
44
+ raise TypeError("predictions must be a numpy.ndarray")
45
+ if predictions.dtype not in _FLOAT_DTYPES:
46
+ raise TypeError("predictions must be a float32 or float64 ndarray")
47
+ if predictions.ndim != 2:
48
+ raise ValueError(
49
+ f"predictions must be 2-D, got {predictions.ndim}-D"
50
+ )
51
+
52
+ array = np.ascontiguousarray(predictions)
53
+ return finalize_impl(array, target, strength_f)
Binary file
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: hyper-post
3
+ Version: 0.1.5
4
+ Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Programming Language :: Python :: 3.11
7
+ Classifier: Programming Language :: Python :: 3.12
8
+ Classifier: Programming Language :: Python :: 3.13
9
+ Classifier: Programming Language :: Rust
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Requires-Dist: numpy>=1.26.4,<3
13
+ Requires-Dist: pytest>=8 ; extra == 'dev'
14
+ Requires-Dist: scipy==1.17.1 ; extra == 'dev'
15
+ Requires-Dist: numpy>=1.26.4,<3 ; extra == 'dev'
16
+ Requires-Dist: cryptography>=43 ; extra == 'dev'
17
+ Provides-Extra: dev
18
+ License-File: LICENSE
19
+ Summary: Post-process a NumPy array.
20
+ Author: hyper_post contributors
21
+ License: MIT
22
+ Requires-Python: >=3.11, <3.14
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+
25
+ # hyper-post
26
+
27
+ ```python
28
+ from hyper_post import finalize
29
+
30
+ out = finalize(x, target="y2")
31
+ ```
32
+
33
+ ## 安装
34
+
35
+ ```text
36
+ pip install hyper-post
37
+ ```
38
+
39
+ 需要 Python 3.11–3.13 和 NumPy 1.26 或 2.x。提供 Windows AMD64 与 Linux x86_64(manylinux_2_28)的 wheel。
40
+
41
+ ## 用法
42
+
43
+ `target` 选择 `"y1"` 或 `"y2"` 处理配置,必须用关键字传入。`strength` 控制处理强度,取值范围为 `[0, 1]`,默认 `0.05`。输出的数值尺度可能随强度变化;`strength=0` 也不表示原样返回输入。
44
+
45
+ ```python
46
+ out = finalize(x, target="y1")
47
+ out = finalize(x, target="y2", strength=0.05)
48
+ ```
49
+
50
+ 输入 `x` 为二维 `float32` 或 `float64` 数组,形状必须是 `(442, 5282)`。返回同形状的新 `float32` 数组,不修改 `x`。不读写文件,不访问网络。
51
+
52
+ 无匹配平台的 wheel 时无法安装,没有纯 Python 后备实现。
53
+
54
+ ## License
55
+
56
+ MIT
57
+
@@ -0,0 +1,9 @@
1
+ LICENSE,sha256=LUwGpNdxVfloMICIMkh7wwuTTsHdZ1RRKvko6KmeyOo,1080
2
+ hyper_post/__init__.py,sha256=39xjp2QGjEfEox4ZL6Le0dPQLhpCFCjxRiew0QjgFHI,61
3
+ hyper_post/_api.py,sha256=7RmfhJkRHdSqwZzoFU57RIqVWYN6ekOEn6wTtdD0qJc,1968
4
+ hyper_post/_native.cp313-win_amd64.pyd,sha256=uOGeHGpCL5kT-OkE-gA3wz7TgdprHHH4UD691PSzu88,8084480
5
+ hyper_post-0.1.5.dist-info/METADATA,sha256=RJqCp8fxbVizOlGFGjXdcThOPM8396PrMeppkRUFuKA,1773
6
+ hyper_post-0.1.5.dist-info/WHEEL,sha256=s-xaFzw5tWWSSNKn-DuKhiHUeYX5UHiEcnl_hzDJ9ZY,97
7
+ hyper_post-0.1.5.dist-info/licenses/LICENSE,sha256=LUwGpNdxVfloMICIMkh7wwuTTsHdZ1RRKvko6KmeyOo,1080
8
+ hyper_post-0.1.5.dist-info/sboms/hyper_post.cyclonedx.json,sha256=M0bvatlSJ2FL3lxvKJLR_rvtyroltlS1qJD9DNpMHhc,66317
9
+ hyper_post-0.1.5.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.15.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hyper_post contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.