Skip to content

[ENH] Convert InterpolationOptions to Pydantic model #12

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 7 commits into from
May 14, 2025
Merged

Conversation

Leguark
Copy link
Member

@Leguark Leguark commented May 10, 2025

Getting the first example of InterpolationOptions serializable

This PR converts the InterpolationOptions class from a dataclass to a Pydantic model to enable serialization. The changes include:

  • Replaced dataclass with Pydantic's BaseModel for InterpolationOptions
  • Converted the constructor to a class method from_args() to maintain backward compatibility
  • Added proper type annotations and Pydantic Field definitions
  • Fixed a minor type issue in octree_curvature_threshold by adding a decimal point
  • Added proper model configuration for enum handling
  • Made TempInterpolationValues a proper dataclass

These changes are the first step toward making the model serializable while maintaining the existing functionality.

Copy link
Member Author

Leguark commented May 10, 2025

@Leguark Leguark changed the title [WIP] Getting the first example of InterpolationOptions serializable [ENH] Convert InterpolationOptions to Pydantic model May 10, 2025
Replaced direct instantiation of `InterpolationOptions` with the `from_args` class method across multiple modules and tests for consistency and improved clarity. Updated related examples and fixtures to align with this change.
@Leguark Leguark marked this pull request as ready for review May 12, 2025 07:31
Leguark added 4 commits May 12, 2025 08:33
Added validation logic for `kernel_function` fields to ensure proper deserialization from string inputs to enums. Enhanced default JSON serialization by including additional encoders and adjusted relevant field exclusions.
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:26 AM EDT: @Leguark merged this pull request with Graphite.

@Leguark Leguark merged commit 4e0103f 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