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.
Files changed (69) hide show
  1. {ucon-0.6.3 → ucon-0.6.4}/PKG-INFO +1 -1
  2. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_unit_parsing.py +22 -0
  3. {ucon-0.6.3 → ucon-0.6.4}/ucon/units.py +1 -0
  4. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/PKG-INFO +1 -1
  5. {ucon-0.6.3 → ucon-0.6.4}/.github/workflows/publish.yaml +0 -0
  6. {ucon-0.6.3 → ucon-0.6.4}/.github/workflows/tests.yaml +0 -0
  7. {ucon-0.6.3 → ucon-0.6.4}/.gitignore +0 -0
  8. {ucon-0.6.3 → ucon-0.6.4}/LICENSE +0 -0
  9. {ucon-0.6.3 → ucon-0.6.4}/Makefile +0 -0
  10. {ucon-0.6.3 → ucon-0.6.4}/NOTICE +0 -0
  11. {ucon-0.6.3 → ucon-0.6.4}/README.md +0 -0
  12. {ucon-0.6.3 → ucon-0.6.4}/ROADMAP.md +0 -0
  13. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/001-unity-distance-metric-for-nearest-scale.md +0 -0
  14. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/002-composite-units.md +0 -0
  15. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/003-composable-unit-algebra.md +0 -0
  16. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/004-unit-algebra-naming.md +0 -0
  17. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/005-pseudo-dimension-tuple-values.md +0 -0
  18. {ucon-0.6.3 → ucon-0.6.4}/docs/decisions/006-pydantic-integration-pattern.md +0 -0
  19. {ucon-0.6.3 → ucon-0.6.4}/docs/examples/basis-transform-fantasy-units.md +0 -0
  20. {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/exponent-scale-relationship.md +0 -0
  21. {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/type-operation-matrix.md +0 -0
  22. {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/why-algebraic-closure-matters.md +0 -0
  23. {ucon-0.6.3 → ucon-0.6.4}/docs/explainers/why-type-safety-matters.md +0 -0
  24. {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/interface-unifying-the-value-layer.md +0 -0
  25. {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/project_unified-algebraic-core.md +0 -0
  26. {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/support-for-fractional-exponents.md +0 -0
  27. {ucon-0.6.3 → ucon-0.6.4}/docs/proposals/unified-unit-presentation.md +0 -0
  28. {ucon-0.6.3 → ucon-0.6.4}/pyproject.toml +0 -0
  29. {ucon-0.6.3 → ucon-0.6.4}/requirements.txt +0 -0
  30. {ucon-0.6.3 → ucon-0.6.4}/setup.cfg +0 -0
  31. {ucon-0.6.3 → ucon-0.6.4}/setup.py +0 -0
  32. {ucon-0.6.3 → ucon-0.6.4}/tests/__init__.py +0 -0
  33. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/__init__.py +0 -0
  34. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/__init__.py +0 -0
  35. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/test_graph.py +0 -0
  36. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/conversion/test_map.py +0 -0
  37. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/mcp/__init__.py +0 -0
  38. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/mcp/test_server.py +0 -0
  39. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_algebra.py +0 -0
  40. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_basis_transform.py +0 -0
  41. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_core.py +0 -0
  42. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_default_graph_conversions.py +0 -0
  43. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_dimensionless_units.py +0 -0
  44. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_graph_basis_transform.py +0 -0
  45. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_logmap.py +0 -0
  46. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_nines.py +0 -0
  47. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_pickle.py +0 -0
  48. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_pydantic.py +0 -0
  49. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_quantity.py +0 -0
  50. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_rebased_unit.py +0 -0
  51. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_uncertainty.py +0 -0
  52. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_unit_system.py +0 -0
  53. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_units.py +0 -0
  54. {ucon-0.6.3 → ucon-0.6.4}/tests/ucon/test_vector_fraction.py +0 -0
  55. {ucon-0.6.3 → ucon-0.6.4}/ucon/__init__.py +0 -0
  56. {ucon-0.6.3 → ucon-0.6.4}/ucon/algebra.py +0 -0
  57. {ucon-0.6.3 → ucon-0.6.4}/ucon/core.py +0 -0
  58. {ucon-0.6.3 → ucon-0.6.4}/ucon/graph.py +0 -0
  59. {ucon-0.6.3 → ucon-0.6.4}/ucon/maps.py +0 -0
  60. {ucon-0.6.3 → ucon-0.6.4}/ucon/mcp/__init__.py +0 -0
  61. {ucon-0.6.3 → ucon-0.6.4}/ucon/mcp/server.py +0 -0
  62. {ucon-0.6.3 → ucon-0.6.4}/ucon/pydantic.py +0 -0
  63. {ucon-0.6.3 → ucon-0.6.4}/ucon/quantity.py +0 -0
  64. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/SOURCES.txt +0 -0
  65. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/dependency_links.txt +0 -0
  66. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/entry_points.txt +0 -0
  67. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/requires.txt +0 -0
  68. {ucon-0.6.3 → ucon-0.6.4}/ucon.egg-info/top_level.txt +0 -0
  69. {ucon-0.6.3 → ucon-0.6.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ucon
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: A tool for dimensional analysis: a 'Unit CONverter'
5
5
  Home-page: https://github.com/withtwoemms/ucon
6
6
  Author: Emmanuel I. Obi
@@ -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]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ucon
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: A tool for dimensional analysis: a 'Unit CONverter'
5
5
  Home-page: https://github.com/withtwoemms/ucon
6
6
  Author: Emmanuel I. Obi
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