Skip to content

Support string enum mappings#79

Merged
matthewhorridge merged 2 commits intomainfrom
fix/enum-to-enum-string-mapping
Jan 27, 2026
Merged

Support string enum mappings#79
matthewhorridge merged 2 commits intomainfrom
fix/enum-to-enum-string-mapping

Conversation

@matthewhorridge
Copy link
Contributor

Summary

  • Allow EnumToEnum to load string-coded mappings without forced int coercion.
  • Preserve numeric behavior by converting only when keys and values are int-like.
  • Add tests for string and numeric mappings.
  • Update demo enum example to use string codes/labels and adjust output order.

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 34 items

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

============================== 34 passed in 0.29s ==============================

Allow EnumToEnum to load string-coded mappings without forced int coercion.
Keep numeric mapping behavior by converting only when keys and values are int-like.
Add tests covering string mappings and string keys.
Switch visit_type_code example to string-coded enum mappings.
Update demo input, rules, output, and README to reflect string labels.
Reorder output so given_name and family_name are adjacent.

Closes #77.
@matthewhorridge matthewhorridge merged commit 8367447 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