ucon 0.6.5__tar.gz → 0.6.6__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.
- {ucon-0.6.5 → ucon-0.6.6}/PKG-INFO +1 -1
- {ucon-0.6.5 → ucon-0.6.6}/ucon/core.py +2 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/graph.py +24 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/units.py +15 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/PKG-INFO +1 -1
- {ucon-0.6.5 → ucon-0.6.6}/.github/workflows/publish.yaml +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/.github/workflows/tests.yaml +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/.gitignore +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/LICENSE +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/Makefile +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/NOTICE +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/README.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ROADMAP.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/001-unity-distance-metric-for-nearest-scale.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/002-composite-units.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/003-composable-unit-algebra.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/004-unit-algebra-naming.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/005-pseudo-dimension-tuple-values.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/decisions/006-pydantic-integration-pattern.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/examples/basis-transform-fantasy-units.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/explainers/exponent-scale-relationship.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/explainers/type-operation-matrix.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/explainers/why-algebraic-closure-matters.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/explainers/why-type-safety-matters.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/proposals/interface-unifying-the-value-layer.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/proposals/project_unified-algebraic-core.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/proposals/support-for-fractional-exponents.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/docs/proposals/unified-unit-presentation.md +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/pyproject.toml +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/requirements.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/setup.cfg +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/setup.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/conversion/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/conversion/test_graph.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/conversion/test_map.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/mcp/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/mcp/test_server.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_algebra.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_basis_transform.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_core.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_default_graph_conversions.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_dimensionless_units.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_graph_basis_transform.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_logmap.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_mcp_server.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_nines.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_pickle.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_pydantic.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_quantity.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_rebased_unit.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_uncertainty.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_unit_parsing.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_unit_system.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_units.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/tests/ucon/test_vector_fraction.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/algebra.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/maps.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/mcp/__init__.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/mcp/server.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/pydantic.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon/quantity.py +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/SOURCES.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/dependency_links.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/entry_points.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/requires.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/ucon.egg-info/top_level.txt +0 -0
- {ucon-0.6.5 → ucon-0.6.6}/uv.lock +0 -0
|
@@ -99,6 +99,8 @@ class Dimension(Enum):
|
|
|
99
99
|
permittivity = Vector(4, -3, -1, 2, 0, 0, 0, 0)
|
|
100
100
|
power = Vector(-3, 2, 1, 0, 0, 0, 0, 0)
|
|
101
101
|
pressure = Vector(-2, -1, 1, 0, 0, 0, 0, 0)
|
|
102
|
+
dynamic_viscosity = Vector(-1, -1, 1, 0, 0, 0, 0, 0) # M·L⁻¹·T⁻¹ (Pa·s)
|
|
103
|
+
kinematic_viscosity = Vector(-1, 2, 0, 0, 0, 0, 0, 0) # L²·T⁻¹ (m²/s)
|
|
102
104
|
resistance = Vector(-3, 2, 1, -2, 0, 0, 0, 0)
|
|
103
105
|
resistivity = Vector(-3, 3, 1, -2, 0, 0, 0, 0)
|
|
104
106
|
specific_heat_capacity = Vector(-2, 2, 0, 0, -1, 0, 0, 0)
|
|
@@ -555,6 +555,8 @@ def _build_standard_graph() -> ConversionGraph:
|
|
|
555
555
|
graph.add_edge(src=units.celsius, dst=units.kelvin, map=AffineMap(1, 273.15))
|
|
556
556
|
# F → C: C = (F - 32) * 5/9
|
|
557
557
|
graph.add_edge(src=units.fahrenheit, dst=units.celsius, map=AffineMap(5/9, -32 * 5/9))
|
|
558
|
+
# K → °R: °R = K × 9/5 (both absolute scales, same zero point)
|
|
559
|
+
graph.add_edge(src=units.kelvin, dst=units.rankine, map=LinearMap(9/5))
|
|
558
560
|
|
|
559
561
|
# --- Pressure ---
|
|
560
562
|
# 1 Pa = 0.00001 bar, so 1 bar = 100000 Pa
|
|
@@ -563,6 +565,28 @@ def _build_standard_graph() -> ConversionGraph:
|
|
|
563
565
|
graph.add_edge(src=units.pascal, dst=units.psi, map=LinearMap(0.000145038))
|
|
564
566
|
# 1 atm = 101325 Pa
|
|
565
567
|
graph.add_edge(src=units.atmosphere, dst=units.pascal, map=LinearMap(101325))
|
|
568
|
+
# 1 torr = 133.322368 Pa
|
|
569
|
+
graph.add_edge(src=units.torr, dst=units.pascal, map=LinearMap(133.322368))
|
|
570
|
+
# 1 mmHg ≈ 1 torr (by definition, at 0°C)
|
|
571
|
+
graph.add_edge(src=units.millimeter_mercury, dst=units.torr, map=LinearMap(1.0))
|
|
572
|
+
# 1 inHg = 3386.389 Pa
|
|
573
|
+
graph.add_edge(src=units.inch_mercury, dst=units.pascal, map=LinearMap(3386.389))
|
|
574
|
+
|
|
575
|
+
# --- Force ---
|
|
576
|
+
# 1 lbf = 4.4482216152605 N (exact, from lb_m × g_n)
|
|
577
|
+
graph.add_edge(src=units.pound_force, dst=units.newton, map=LinearMap(4.4482216152605))
|
|
578
|
+
# 1 kgf = 9.80665 N (exact, by definition)
|
|
579
|
+
graph.add_edge(src=units.kilogram_force, dst=units.newton, map=LinearMap(9.80665))
|
|
580
|
+
# 1 dyne = 1e-5 N (CGS unit)
|
|
581
|
+
graph.add_edge(src=units.dyne, dst=units.newton, map=LinearMap(1e-5))
|
|
582
|
+
|
|
583
|
+
# --- Dynamic Viscosity ---
|
|
584
|
+
# 1 poise = 0.1 Pa·s (CGS unit)
|
|
585
|
+
graph.add_edge(src=units.poise, dst=units.pascal * units.second, map=LinearMap(0.1))
|
|
586
|
+
|
|
587
|
+
# --- Kinematic Viscosity ---
|
|
588
|
+
# 1 stokes = 1e-4 m²/s (CGS unit)
|
|
589
|
+
graph.add_edge(src=units.stokes, dst=units.meter ** 2 / units.second, map=LinearMap(1e-4))
|
|
566
590
|
|
|
567
591
|
# --- Volume ---
|
|
568
592
|
graph.add_edge(src=units.liter, dst=units.gallon, map=LinearMap(0.264172))
|
|
@@ -80,6 +80,12 @@ webers_per_meter = Unit(name='webers_per_meter', dimension=Dimension.magnetic_pe
|
|
|
80
80
|
# ----------------------------------------------------------------------
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
# -- Viscosity Units ---------------------------------------------------
|
|
84
|
+
poise = Unit(name='poise', dimension=Dimension.dynamic_viscosity, aliases=('P',))
|
|
85
|
+
stokes = Unit(name='stokes', dimension=Dimension.kinematic_viscosity, aliases=('St',))
|
|
86
|
+
# ----------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
|
|
83
89
|
# -- Time Units --------------------------------------------------------
|
|
84
90
|
second = Unit(name='second', dimension=Dimension.time, aliases=('s', 'sec'))
|
|
85
91
|
minute = Unit(name='minute', dimension=Dimension.time, aliases=('min',))
|
|
@@ -101,6 +107,7 @@ ounce = Unit(name='ounce', dimension=Dimension.mass, aliases=('oz', 'ounces'))
|
|
|
101
107
|
|
|
102
108
|
# Temperature
|
|
103
109
|
fahrenheit = Unit(name='fahrenheit', dimension=Dimension.temperature, aliases=('°F', 'degF'))
|
|
110
|
+
rankine = Unit(name='rankine', dimension=Dimension.temperature, aliases=('°R', 'degR', 'R'))
|
|
104
111
|
|
|
105
112
|
# Volume
|
|
106
113
|
gallon = Unit(name='gallon', dimension=Dimension.volume, aliases=('gal', 'gallons'))
|
|
@@ -116,6 +123,14 @@ horsepower = Unit(name='horsepower', dimension=Dimension.power, aliases=('hp',))
|
|
|
116
123
|
bar = Unit(name='bar', dimension=Dimension.pressure, aliases=('bar',))
|
|
117
124
|
psi = Unit(name='psi', dimension=Dimension.pressure, aliases=('psi', 'lbf/in²'))
|
|
118
125
|
atmosphere = Unit(name='atmosphere', dimension=Dimension.pressure, aliases=('atm',))
|
|
126
|
+
torr = Unit(name='torr', dimension=Dimension.pressure, aliases=('Torr',))
|
|
127
|
+
millimeter_mercury = Unit(name='millimeter_mercury', dimension=Dimension.pressure, aliases=('mmHg',))
|
|
128
|
+
inch_mercury = Unit(name='inch_mercury', dimension=Dimension.pressure, aliases=('inHg',))
|
|
129
|
+
|
|
130
|
+
# Force
|
|
131
|
+
pound_force = Unit(name='pound_force', dimension=Dimension.force, aliases=('lbf',))
|
|
132
|
+
kilogram_force = Unit(name='kilogram_force', dimension=Dimension.force, aliases=('kgf',))
|
|
133
|
+
dyne = Unit(name='dyne', dimension=Dimension.force, aliases=('dyn',))
|
|
119
134
|
# ----------------------------------------------------------------------
|
|
120
135
|
|
|
121
136
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ucon-0.6.5 → ucon-0.6.6}/NOTICE
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|