Skip to content

Add format_number primitive#80

Merged
matthewhorridge merged 1 commit intomainfrom
feat/format-number-primitive
Jan 27, 2026
Merged

Add format_number primitive#80
matthewhorridge merged 1 commit intomainfrom
feat/format-number-primitive

Conversation

@matthewhorridge
Copy link
Contributor

Summary

  • Introduce FormatNumber to format numeric values as fixed-width strings.
  • Register the primitive in the vocabulary and rule deserializer.
  • Add tests for formatting, serialization, and validation.
  • Update the harmonize demo to use format_number for weight_kg output.

Testing

  • ============================= test session starts ==============================
    platform darwin -- Python 3.12.4, pytest-9.0.2, pluggy-1.6.0
    rootdir: /Users/matthewhorridge/IdeaProjects/harmonization-framework
    configfile: pyproject.toml
    plugins: anyio-4.12.1
    collected 37 items

tests/test_primitives_serialization.py ................................. [ 89%]
.... [100%]

============================== 37 passed in 0.28s ==============================

Introduce FormatNumber to format numeric values as fixed-width strings.
Expose the primitive in the vocabulary and rule deserializer.
Add tests for round-trip serialization, formatting, and validation.
Update the harmonize demo to use format_number for weight_kg output.

Closes #76.
@matthewhorridge matthewhorridge merged commit 4e23ea0 into main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant