Pydantic Models + Type Validation + uv Build#11
Conversation
|
Hello @thekaushikls, thank you for PR :) This PR seems to me more like a rewrite to me looking at the number of changes, especially knowing this repository is quite small.
Please let me know what you think :) Thank you once again for your input :) |
|
Hi Wojciech (@paireks) , Thank you for your comments. I agree it is a re-write, and I have tried my best to keep the current tests passing and changes very minor.
I haven't run any performance tests to compare which is "better", as the goal was to help with (de)serialization of dotbim elements/meshes with some quick validation. That said, it'd be a nice experiment to do some tests.
I like option 1 because it is a tad bit easier to maintain, and gives the end-user the flexibility to choose between the flavors. But I believe it's not completely black and white - we can decide on a later stage about merging if/when more people start using them. Do let me know if you think otherwise. Best, |
|
Hello @thekaushikls, if you also prefer option 1 then great. Please let me know then which link to your repo and to the package should I reference, I will update documentation then with these links :) Best regards, |
|
Hi @paireks, Here are the relevant links:
Thank you! Best, |
Summary
Color,Vector,Rotation,Mesh,Element,File) to PydanticBaseModelto leverage type validationjsonpicklewith Pydantic serialization (model_dump_json/model_validate)setup.py/setup.cfgwithpyproject.toml+hatchlingsrc/layoutprimitives.pyandcomposites.pyBreaking changes
pydantic.ValidationErroron invalid inputElement.guidis nowuuid.UUIDElement.info/File.inforequireDict[str, str]Issues addressed
\#10Notes
I understand you prefer small, focused PRs. I'd be happy to break this into smaller pieces to make it easier to review. This PR is the full scope so you can see the direction; let me know how you'd like to proceed.