phaethon 0.2.2__tar.gz → 0.2.3__tar.gz
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.
- {phaethon-0.2.2/src/phaethon.egg-info → phaethon-0.2.3}/PKG-INFO +16 -3
- {phaethon-0.2.2 → phaethon-0.2.3}/README.md +15 -2
- {phaethon-0.2.2 → phaethon-0.2.3}/pyproject.toml +1 -1
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/__init__.py +1 -1
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/engine.py +8 -3
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/registry.py +12 -9
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/mass.py +2 -2
- {phaethon-0.2.2 → phaethon-0.2.3/src/phaethon.egg-info}/PKG-INFO +16 -3
- {phaethon-0.2.2 → phaethon-0.2.3}/LICENSE +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/setup.cfg +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/__init__.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/axioms.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/base.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/constants.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/schema.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/core/vmath.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/exceptions.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/u.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/__init__.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/area.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/data.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/density.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/energy.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/force.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/frequency.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/length.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/power.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/pressure.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/speed.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/temperature.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/time.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon/units/volume.py +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon.egg-info/SOURCES.txt +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon.egg-info/dependency_links.txt +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon.egg-info/requires.txt +0 -0
- {phaethon-0.2.2 → phaethon-0.2.3}/src/phaethon.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phaethon
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Unit-Safe Data Pipeline Schema and Semantic Data Transformation
|
|
5
5
|
Author-email: Zahraan Dzakii Tsaqiif <zahraandzakiits@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -36,7 +36,7 @@ Dynamic: license-file
|
|
|
36
36
|
|
|
37
37
|
<div align="center">
|
|
38
38
|
|
|
39
|
-
<h1>Phaethon — Unit-Safe Data Pipeline Schema</h1>
|
|
39
|
+
<h1>Phaethon — Unit-Safe Data Pipeline Schema & Semantic Data Transformation</h1>
|
|
40
40
|
|
|
41
41
|
<p>
|
|
42
42
|
<img src="https://img.shields.io/badge/MADE_WITH-PYTHON-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python">
|
|
@@ -46,7 +46,7 @@ Dynamic: license-file
|
|
|
46
46
|
</p>
|
|
47
47
|
|
|
48
48
|
<p>
|
|
49
|
-
<i>
|
|
49
|
+
<i>Translate raw bytes into meaningful domain concepts, normalize messy units, and enforce physical integrity before your data hits ML or production systems.</i>
|
|
50
50
|
</p>
|
|
51
51
|
|
|
52
52
|
</div>
|
|
@@ -145,6 +145,19 @@ class ColdChainPipeline(ptn.Schema):
|
|
|
145
145
|
return clean_df
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## ⚖️ Absolute Precision: 100% Parity with Pint
|
|
151
|
+
|
|
152
|
+
Phaethon doesn't just parse strings quickly; it calculates physical reality flawlessly. From quantum scales (`eV`) to astronomical masses (`M_jup`), the core engine retains absolute `float64` precision without underflow truncation.
|
|
153
|
+
|
|
154
|
+
We enforce **100% mathematical parity** against the industry-standard `Pint` library using brutal, property-based automated testing (`hypothesis`).
|
|
155
|
+
|
|
156
|
+
* **Empirical Accuracy:** Phaethon achieves zero-deviation parity across hundreds of randomized, bidirectional cross-dimensional conversions.
|
|
157
|
+
* **Superior Vocabulary:** Phaethon natively parses **65+ specialized units** (e.g., historical mass, regional volumes, astrophysical constants) that standard libraries fail to recognize or fatally misinterpret due to string hyphenation bugs.
|
|
158
|
+
|
|
159
|
+
> *Transparency Note: You can audit and run the rigorous O(N) Hub-and-Spoke accuracy tests yourself via the `benchmarks/test_pint_parity.py` script included in this repository.*
|
|
160
|
+
|
|
148
161
|
---
|
|
149
162
|
## 🏎️ The Fluent API (Quick Inline Conversions)
|
|
150
163
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<h1>Phaethon — Unit-Safe Data Pipeline Schema</h1>
|
|
3
|
+
<h1>Phaethon — Unit-Safe Data Pipeline Schema & Semantic Data Transformation</h1>
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<img src="https://img.shields.io/badge/MADE_WITH-PYTHON-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python">
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p>
|
|
13
|
-
<i>
|
|
13
|
+
<i>Translate raw bytes into meaningful domain concepts, normalize messy units, and enforce physical integrity before your data hits ML or production systems.</i>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
</div>
|
|
@@ -109,6 +109,19 @@ class ColdChainPipeline(ptn.Schema):
|
|
|
109
109
|
return clean_df
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## ⚖️ Absolute Precision: 100% Parity with Pint
|
|
115
|
+
|
|
116
|
+
Phaethon doesn't just parse strings quickly; it calculates physical reality flawlessly. From quantum scales (`eV`) to astronomical masses (`M_jup`), the core engine retains absolute `float64` precision without underflow truncation.
|
|
117
|
+
|
|
118
|
+
We enforce **100% mathematical parity** against the industry-standard `Pint` library using brutal, property-based automated testing (`hypothesis`).
|
|
119
|
+
|
|
120
|
+
* **Empirical Accuracy:** Phaethon achieves zero-deviation parity across hundreds of randomized, bidirectional cross-dimensional conversions.
|
|
121
|
+
* **Superior Vocabulary:** Phaethon natively parses **65+ specialized units** (e.g., historical mass, regional volumes, astrophysical constants) that standard libraries fail to recognize or fatally misinterpret due to string hyphenation bugs.
|
|
122
|
+
|
|
123
|
+
> *Transparency Note: You can audit and run the rigorous O(N) Hub-and-Spoke accuracy tests yourself via the `benchmarks/test_pint_parity.py` script included in this repository.*
|
|
124
|
+
|
|
112
125
|
---
|
|
113
126
|
## 🏎️ The Fluent API (Quick Inline Conversions)
|
|
114
127
|
|
|
@@ -54,7 +54,7 @@ class _ConversionBuilder:
|
|
|
54
54
|
|
|
55
55
|
self._options = {
|
|
56
56
|
"mode": "float64",
|
|
57
|
-
"prec":
|
|
57
|
+
"prec": None,
|
|
58
58
|
"roundin": "half_even",
|
|
59
59
|
"output": "raw",
|
|
60
60
|
"sigfigs": None,
|
|
@@ -273,7 +273,10 @@ class _ConversionBuilder:
|
|
|
273
273
|
else:
|
|
274
274
|
final_value = converted_value
|
|
275
275
|
else:
|
|
276
|
-
|
|
276
|
+
if prec is not None:
|
|
277
|
+
final_value = round(converted_value, prec)
|
|
278
|
+
else:
|
|
279
|
+
final_value = float(converted_value)
|
|
277
280
|
else:
|
|
278
281
|
raise ConversionError(f"Computation mode '{mode}' is not recognized. Use 'decimal' or 'float64'.")
|
|
279
282
|
|
|
@@ -372,8 +375,10 @@ class _ConversionBuilder:
|
|
|
372
375
|
if sigfigs and isinstance(final_value, Decimal):
|
|
373
376
|
decimal_places = max(sigfigs - (final_value.adjusted() + 1), 0)
|
|
374
377
|
val_str = f"{final_value:.{decimal_places}f}"
|
|
378
|
+
elif prec is not None:
|
|
379
|
+
val_str = format(final_value, f'.{prec}f')
|
|
375
380
|
else:
|
|
376
|
-
val_str =
|
|
381
|
+
val_str = str(final_value)
|
|
377
382
|
|
|
378
383
|
if not scinote and '.' in val_str:
|
|
379
384
|
val_str = val_str.rstrip('0')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
from typing import Dict, List, Type, Optional, Set, Any, Union
|
|
1
|
+
from typing import Dict, List, Type, Optional, Set, Any, Union, TYPE_CHECKING, overload, Literal
|
|
2
2
|
from ..exceptions import UnitNotFoundError, DimensionMismatchError, AmbiguousUnitError
|
|
3
|
-
|
|
3
|
+
if TYPE_CHECKING:
|
|
4
|
+
from .base import BaseUnit
|
|
4
5
|
|
|
5
6
|
_DIMENSIONAL_DNA = {
|
|
6
7
|
frozenset({('length', 1), ('time', -1)}): 'speed',
|
|
@@ -93,7 +94,7 @@ class UnitRegistry:
|
|
|
93
94
|
|
|
94
95
|
return candidates[0]
|
|
95
96
|
|
|
96
|
-
def baseof(self, dimension: str) -> Type:
|
|
97
|
+
def baseof(self, dimension: str) -> Type['BaseUnit']:
|
|
97
98
|
dimension = dimension.lower().strip()
|
|
98
99
|
for candidates in self._units.values():
|
|
99
100
|
for cls in candidates:
|
|
@@ -144,7 +145,7 @@ class UnitRegistry:
|
|
|
144
145
|
default_ureg = UnitRegistry()
|
|
145
146
|
|
|
146
147
|
|
|
147
|
-
def baseof(dimension: str) -> Type:
|
|
148
|
+
def baseof(dimension: str) -> Type['BaseUnit']:
|
|
148
149
|
"""
|
|
149
150
|
Retrieves the base unit class (the absolute reference point) for a dimension.
|
|
150
151
|
Args:
|
|
@@ -162,17 +163,19 @@ def dims() -> List[str]:
|
|
|
162
163
|
"""
|
|
163
164
|
return default_ureg.dims()
|
|
164
165
|
|
|
165
|
-
|
|
166
|
+
@overload
|
|
167
|
+
def unitsin(dimension: str, ascls: Literal[False] = ...) -> List[str]: ...
|
|
168
|
+
|
|
169
|
+
@overload
|
|
170
|
+
def unitsin(dimension: str, ascls: Literal[True]) -> List[Type['BaseUnit']]: ...
|
|
171
|
+
|
|
172
|
+
def unitsin(dimension: str, ascls: bool = False) -> Union[List[str], List[Type['BaseUnit']]]:
|
|
166
173
|
"""
|
|
167
174
|
Retrieves units associated with a specific dimension.
|
|
168
175
|
|
|
169
176
|
Args:
|
|
170
177
|
dimension: The dimension name (e.g., 'mass').
|
|
171
178
|
ascls: If True, returns the actual Class objects instead of strings.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
>>> phaethon.unitsin('mass') -> ['g', 'kg', 'lb', ...]
|
|
175
|
-
>>> phaethon.unitsin('mass', ascls=True) -> [<class 'Gram'>, <class 'Kilogram'>, ...]
|
|
176
179
|
"""
|
|
177
180
|
return default_ureg.unitsin(dimension, ascls=ascls)
|
|
178
181
|
|
|
@@ -29,7 +29,7 @@ class Kilogram(MassUnit):
|
|
|
29
29
|
|
|
30
30
|
class Gram(MassUnit):
|
|
31
31
|
symbol = "g"
|
|
32
|
-
aliases = ["gram", "grams", "gm", "gms", "G"
|
|
32
|
+
aliases = ["gram", "grams", "gm", "gms", "G"]
|
|
33
33
|
base_multiplier = 1e-3
|
|
34
34
|
|
|
35
35
|
class Milligram(MassUnit):
|
|
@@ -184,7 +184,7 @@ class AtomicMassUnit(MassUnit):
|
|
|
184
184
|
base_multiplier = _const.ATOMIC_MASS_UNIT_KG
|
|
185
185
|
|
|
186
186
|
class PlanckMass(MassUnit):
|
|
187
|
-
symbol = "
|
|
187
|
+
symbol = "m_P"
|
|
188
188
|
aliases = ["planckmass", "planck-mass", "planck mass"]
|
|
189
189
|
base_multiplier = _const.PLANCK_MASS_KG
|
|
190
190
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phaethon
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Unit-Safe Data Pipeline Schema and Semantic Data Transformation
|
|
5
5
|
Author-email: Zahraan Dzakii Tsaqiif <zahraandzakiits@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -36,7 +36,7 @@ Dynamic: license-file
|
|
|
36
36
|
|
|
37
37
|
<div align="center">
|
|
38
38
|
|
|
39
|
-
<h1>Phaethon — Unit-Safe Data Pipeline Schema</h1>
|
|
39
|
+
<h1>Phaethon — Unit-Safe Data Pipeline Schema & Semantic Data Transformation</h1>
|
|
40
40
|
|
|
41
41
|
<p>
|
|
42
42
|
<img src="https://img.shields.io/badge/MADE_WITH-PYTHON-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python">
|
|
@@ -46,7 +46,7 @@ Dynamic: license-file
|
|
|
46
46
|
</p>
|
|
47
47
|
|
|
48
48
|
<p>
|
|
49
|
-
<i>
|
|
49
|
+
<i>Translate raw bytes into meaningful domain concepts, normalize messy units, and enforce physical integrity before your data hits ML or production systems.</i>
|
|
50
50
|
</p>
|
|
51
51
|
|
|
52
52
|
</div>
|
|
@@ -145,6 +145,19 @@ class ColdChainPipeline(ptn.Schema):
|
|
|
145
145
|
return clean_df
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## ⚖️ Absolute Precision: 100% Parity with Pint
|
|
151
|
+
|
|
152
|
+
Phaethon doesn't just parse strings quickly; it calculates physical reality flawlessly. From quantum scales (`eV`) to astronomical masses (`M_jup`), the core engine retains absolute `float64` precision without underflow truncation.
|
|
153
|
+
|
|
154
|
+
We enforce **100% mathematical parity** against the industry-standard `Pint` library using brutal, property-based automated testing (`hypothesis`).
|
|
155
|
+
|
|
156
|
+
* **Empirical Accuracy:** Phaethon achieves zero-deviation parity across hundreds of randomized, bidirectional cross-dimensional conversions.
|
|
157
|
+
* **Superior Vocabulary:** Phaethon natively parses **65+ specialized units** (e.g., historical mass, regional volumes, astrophysical constants) that standard libraries fail to recognize or fatally misinterpret due to string hyphenation bugs.
|
|
158
|
+
|
|
159
|
+
> *Transparency Note: You can audit and run the rigorous O(N) Hub-and-Spoke accuracy tests yourself via the `benchmarks/test_pint_parity.py` script included in this repository.*
|
|
160
|
+
|
|
148
161
|
---
|
|
149
162
|
## 🏎️ The Fluent API (Quick Inline Conversions)
|
|
150
163
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|