Skip to content

[ENH] Add numpy array validator and fix type annotations #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025

Conversation

Leguark
Copy link
Member

@Leguark Leguark commented May 14, 2025

Improved JSON Serialization and Validation for Numpy Arrays

This PR adds proper JSON serialization support for numpy arrays in the Transform class by using Pydantic's Annotated type with a custom validator. The changes include:

  • Added a new encoders module with a converters.py file containing a numpy array validator
  • Updated the Transform class to use the new validator for position, rotation, and scale properties
  • Fixed the kernel_function field validator to properly handle JSON schema input
  • Updated floating point values in interpolation_options.py to use explicit decimal notation

These changes improve the serialization/deserialization process, particularly when working with JSON data.

Copy link
Member Author

Leguark commented May 14, 2025

@Leguark Leguark changed the title [WIP] Fixing deserialize json [ENH] Add numpy array validator and fix type annotations May 14, 2025
@Leguark Leguark marked this pull request as ready for review May 14, 2025 11:21
Copy link
Member Author

Leguark commented May 14, 2025

Merge activity

  • May 14, 7:26 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 14, 7:27 AM EDT: Graphite rebased this pull request as part of a merge.
  • May 14, 7:32 AM EDT: @Leguark merged this pull request with Graphite.

@Leguark Leguark changed the base branch from model_serialize to graphite-base/13 May 14, 2025 11:26
@Leguark Leguark changed the base branch from graphite-base/13 to main May 14, 2025 11:26
@Leguark Leguark force-pushed the serialize_input branch from 9902dc8 to 6b27ff1 Compare May 14, 2025 11:27
@Leguark Leguark merged commit 3821295 into main May 14, 2025
2 checks 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