hyper-post 0.1.0__cp312-cp312-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.12; "
13
+ "there is no pure-Python fallback."
14
+ ) from exc
15
+
16
+ _ALLOWED_TARGETS = frozenset({"y1", "y2"})
17
+ _DEFAULT_STRENGTH = 0.00767
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
+ """Rank-fuse a prediction array with the selected offline reference."""
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,95 @@
1
+ Metadata-Version: 2.4
2
+ Name: hyper-post
3
+ Version: 0.1.0
4
+ Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Programming Language :: Python :: 3.12
7
+ Classifier: Programming Language :: Rust
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: POSIX :: Linux
10
+ Requires-Dist: numpy>=1.26.4,<2
11
+ Requires-Dist: pytest>=8 ; extra == 'dev'
12
+ Requires-Dist: scipy==1.17.1 ; extra == 'dev'
13
+ Requires-Dist: numpy==1.26.4 ; extra == 'dev'
14
+ Requires-Dist: cryptography>=43 ; extra == 'dev'
15
+ Provides-Extra: dev
16
+ License-File: LICENSE
17
+ Summary: Offline rank fusion of prediction arrays against embedded reference data.
18
+ Author: hyper_post contributors
19
+ License: MIT
20
+ Requires-Python: >=3.12, <3.13
21
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
22
+
23
+ # hyper-post
24
+
25
+ Offline rank fusion of a prediction array with an embedded reference. Intended for a one-line call at the end of a training script:
26
+
27
+ ```python
28
+ from hyper_post import finalize
29
+
30
+ result = finalize(predictions, target="y2", strength=0.00767)
31
+ ```
32
+
33
+ The package does not load or save files, does not use the network, and does not upload predictions.
34
+
35
+ ## Install
36
+
37
+ Python 3.12, NumPy 1.26.x. Use a wheel that matches the platform:
38
+
39
+ ```text
40
+ pip install --no-index --find-links=wheelhouse hyper-post
41
+ ```
42
+
43
+ There is no pure-Python fallback. If the native extension cannot load, installation or import fails.
44
+
45
+ ## API
46
+
47
+ ```python
48
+ def finalize(
49
+ predictions: np.ndarray,
50
+ *,
51
+ target: Literal["y1", "y2"],
52
+ strength: float = 0.00767,
53
+ ) -> np.ndarray: ...
54
+ ```
55
+
56
+ | Input | Rule |
57
+ | --- | --- |
58
+ | `predictions` | 2-D `float32` or `float64` array with shape `(442, 5282)` |
59
+ | `target` | required keyword, exactly `"y1"` or `"y2"` |
60
+ | `strength` | finite real in `[0, 1]`; not bool or str |
61
+ | return | new C-contiguous `float32` array, same shape |
62
+
63
+ `float64` values are ranked at original precision. The function does not modify the input. `y1` and `y2` are independent references and are never mixed.
64
+
65
+ ## Support matrix (v0.1.0)
66
+
67
+ | Platform | Arch | Python | NumPy |
68
+ | --- | --- | --- | --- |
69
+ | Windows | AMD64 | 3.12 | `>=1.26.4,<2` |
70
+ | Linux | x86_64 | 3.12 | `>=1.26.4,<2` |
71
+
72
+ macOS, ARM, and free-threaded CPython are out of scope for this version. Linux wheels are built on the project's WSL Ubuntu host. They are not manylinux images unless a container toolchain is added later; the training machine must have a compatible glibc.
73
+
74
+ ## Build (private environment)
75
+
76
+ ```text
77
+ python tools/build_payload.py
78
+ maturin build --release --out dist
79
+ python tools/inspect_wheel.py dist/*.whl
80
+ ```
81
+
82
+ `private/y1.npy` and `private/y2.npy` are required to generate the payload. `generated/` is local build output and must not be published or committed.
83
+
84
+ ## Security boundary
85
+
86
+ This package raises the cost of extracting the embedded reference from the wheel. It does not make the reference unrecoverable.
87
+
88
+ The public formula is `output = (1 - s) * R(X) + s * R(Y)`. When `s != 0`, a caller who also knows `X` can recover `R(Y)` from the returned array. `strength=1` returns the reference rank directly. That is a property of the API, not a defect to be papered over by renaming functions or packing the binary.
89
+
90
+ Runtime is fully offline. Keys needed for decryption are necessarily present in the native extension.
91
+
92
+ ## License
93
+
94
+ MIT. Publishing a wheel is a separate step from implementing this package and is not implied by the license text.
95
+
@@ -0,0 +1,8 @@
1
+ LICENSE,sha256=LUwGpNdxVfloMICIMkh7wwuTTsHdZ1RRKvko6KmeyOo,1080
2
+ hyper_post/__init__.py,sha256=39xjp2QGjEfEox4ZL6Le0dPQLhpCFCjxRiew0QjgFHI,61
3
+ hyper_post/_api.py,sha256=sBDfj1HHiqVLZ9x5cWM39xj5Ex6MS0S2FJQgCaiMhNM,1959
4
+ hyper_post/_native.cp312-win_amd64.pyd,sha256=qeRBkVQRSoXkfT6z0f38rSWusveun8pKqvpYqCSNtHI,8068608
5
+ hyper_post-0.1.0.dist-info/METADATA,sha256=EQZbe1FKDoofHG8PAFDSj5hpKi47hxlUv83FRpG7ick,3460
6
+ hyper_post-0.1.0.dist-info/WHEEL,sha256=Uf438hGD-NUftH08dxSaiYRxcfiZqeYK9g3DNJ-vPY0,97
7
+ hyper_post-0.1.0.dist-info/licenses/LICENSE,sha256=LUwGpNdxVfloMICIMkh7wwuTTsHdZ1RRKvko6KmeyOo,1080
8
+ hyper_post-0.1.0.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: cp312-cp312-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.