Skip to content
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

Reorganize geometry.py #417

Merged
merged 3 commits into from
Jun 25, 2022
Merged

Reorganize geometry.py #417

merged 3 commits into from
Jun 25, 2022

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Jun 16, 2022

A bit of reorganization so we dont abuse pydantic validators.

  • Removed Geometry.center and added it as another abstract class that Box, Sphere, and Cylinder inherit from.
  • Removed Planar.length and added it explicitly to Cylinder.
  • Introduced abstract center_axis and length_axis properties to Planar, which must be implemented in subclasses for the planar logic to function appropriately.

Result is that validators are no longer used to set fields.

Note that version was changed to 1.5.0 because it introduces a minor schema change (no longer a "center" and "length" in PolySlab schema).

@twhughes twhughes force-pushed the tyler/geo_reorg branch 2 times, most recently from f54d590 to cd081df Compare June 16, 2022 23:29
@tylerflex tylerflex requested a review from momchil-flex June 16, 2022 23:33
@tylerflex tylerflex added the 1.5 label Jun 16, 2022
@tylerflex tylerflex linked an issue Jun 16, 2022 that may be closed by this pull request
@twhughes twhughes force-pushed the tyler/geo_reorg branch 2 times, most recently from 406eaac to 1054e2e Compare June 17, 2022 16:52
@tylerflex tylerflex merged commit caf700a into develop Jun 25, 2022
@tylerflex tylerflex deleted the tyler/geo_reorg branch June 25, 2022 00:28
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.

pydantic anti patterns
2 participants