ucon 0.6.3__tar.gz → 0.6.4__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.3 → ucon-0.6.4}/PKG-INFO +1 -1
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_unit_parsing.py +22 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/units.py +1 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/PKG-INFO +1 -1
- {ucon-0.6.3 → ucon-0.6.4}/.github/workflows/publish.yaml +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/.github/workflows/tests.yaml +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/.gitignore +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/LICENSE +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/Makefile +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/NOTICE +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/README.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ROADMAP.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/001-unity-distance-metric-for-nearest-scale.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/002-composite-units.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/003-composable-unit-algebra.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/004-unit-algebra-naming.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/005-pseudo-dimension-tuple-values.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/006-pydantic-integration-pattern.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/examples/basis-transform-fantasy-units.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/exponent-scale-relationship.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/type-operation-matrix.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/why-algebraic-closure-matters.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/why-type-safety-matters.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/interface-unifying-the-value-layer.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/project_unified-algebraic-core.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/support-for-fractional-exponents.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/unified-unit-presentation.md +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/pyproject.toml +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/requirements.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/setup.cfg +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/setup.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/test_graph.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/test_map.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/mcp/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/mcp/test_server.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_algebra.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_basis_transform.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_core.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_default_graph_conversions.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_dimensionless_units.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_graph_basis_transform.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_logmap.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_nines.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_pickle.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_pydantic.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_quantity.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_rebased_unit.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_uncertainty.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_unit_system.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_units.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_vector_fraction.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/algebra.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/core.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/graph.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/maps.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/mcp/__init__.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/mcp/server.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/pydantic.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon/quantity.py +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/SOURCES.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/dependency_links.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/entry_points.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/requires.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/top_level.txt +0 -0
- {ucon-0.6.3 → ucon-0.6.4}/uv.lock +0 -0
|
@@ -371,6 +371,28 @@ class TestPriorityScaledAliases(unittest.TestCase):
|
|
|
371
371
|
result = get_unit_by_name("mcg")
|
|
372
372
|
self.assertIsInstance(result, UnitProduct)
|
|
373
373
|
|
|
374
|
+
def test_cc_is_milliliter(self):
|
|
375
|
+
"""'cc' should parse as milliliter (1 cc = 1 mL)."""
|
|
376
|
+
from ucon.core import Dimension
|
|
377
|
+
result = get_unit_by_name("cc")
|
|
378
|
+
self.assertIsInstance(result, UnitProduct)
|
|
379
|
+
self.assertEqual(result.dimension, Dimension.volume)
|
|
380
|
+
self.assertAlmostEqual(result.fold_scale(), 0.001, places=10)
|
|
381
|
+
|
|
382
|
+
def test_cc_to_mL(self):
|
|
383
|
+
"""Conversion from cc to mL should be 1:1."""
|
|
384
|
+
from ucon.core import Number
|
|
385
|
+
vol = Number(5, unit=get_unit_by_name("cc"))
|
|
386
|
+
result = vol.to(get_unit_by_name("mL"))
|
|
387
|
+
self.assertAlmostEqual(result.quantity, 5.0, places=9)
|
|
388
|
+
|
|
389
|
+
def test_cc_to_L(self):
|
|
390
|
+
"""Conversion from cc to L should work."""
|
|
391
|
+
from ucon.core import Number
|
|
392
|
+
vol = Number(1000, unit=get_unit_by_name("cc"))
|
|
393
|
+
result = vol.to(get_unit_by_name("L"))
|
|
394
|
+
self.assertAlmostEqual(result.quantity, 1.0, places=9)
|
|
395
|
+
|
|
374
396
|
|
|
375
397
|
if __name__ == '__main__':
|
|
376
398
|
unittest.main()
|
|
@@ -267,6 +267,7 @@ def _build_registry() -> None:
|
|
|
267
267
|
|
|
268
268
|
# Register priority scaled aliases (medical conventions)
|
|
269
269
|
_PRIORITY_SCALED_ALIASES['mcg'] = (gram, Scale.micro) # microgram
|
|
270
|
+
_PRIORITY_SCALED_ALIASES['cc'] = (liter, Scale.milli) # cubic centimeter = 1 mL
|
|
270
271
|
|
|
271
272
|
|
|
272
273
|
def _parse_exponent(s: str) -> Tuple[str, float]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ucon-0.6.3 → ucon-0.6.4}/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
|