Closed swheaton closed 2 months ago
The updates primarily enhance the FiftyOne library's 3D module, focusing on robust unit testing and refined data validation. Changes include new utility functions for property assertions, improved validation logic in transformation classes, and expanded unit tests for camera, material, and scene functionalities to ensure reliability and correctness in handling 3D data.
Files | Summary of Changes |
---|---|
.../threed/camera_tests.py |
Unit tests for PerspectiveCamera covering initialization, property settings, and dictionary conversions. |
.../threed/dataclass_test_utils.py |
New utility functions for asserting various property types in tests. |
.../threed/material_3d_tests.py |
Unit tests for multiple Material3D classes, verifying properties and methods. |
.../threed/object_3d_tests.py |
Updated tests for 3D object initialization, position, scale settings, and traversal. |
.../threed/scene_3d_tests.py , .../threed/transformation_tests.py |
Enhanced tests for scene backgrounds and 3D transformations. |
.../threed/transformation.py , .../threed/validators.py |
Major updates to validation logic in transformation classes and new validator utilities. |
🐰✨ In the code's warren, under the moon's light bright, Changes hop forth, bringing bugs to flight. Vectors align, cameras capture with might, In FiftyOne's fields, where 3D dances right. Cheers to the devs, whose work shines so bright!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
⭐ 🚀 ⭐ for adding tests
(failing on CI, though, might want to take a look 🤔)
Ok! I meant to check with you but forgot. Which of these do we support: https://threejs.org/docs/#api/en/math/Color
Alternatively I can just relax it to a string
Ok! I meant to check with you but forgot. Which of these do we support: https://threejs.org/docs/#api/en/math/Color
I thought we supported string/name, hex (eg #ffffff), and rgb via colors from matplotlib or something like that
What changes are proposed in this pull request?
Remove
pydantic
requirement previously introduced but not yet included in a release.Rationale: we were not using
pydantic
pervasively. And while it is a solid library, we should be frugal in adding new dependencies, else we run the risk of breaking some users' environments.To do this while maintaining functionality (actually improving on it as it was previously implemented because validation setting didn't seem to be turned on):
pydantic.dataclass
into a "dataclass" of our own that enforces validation on both init and set.__eq__()
and__repr()__
behavior by implementing inBaseValidatedDataClass
dataclasses
previously, likeObject3D
and descendants.If we use
pydantic
for something more pervasive such as replacingmongoengine
in the future, we should come back and replace this.Alternatives
dataclasses
without type validationdataclasses
with validationDownsides
dataclasses
(builtin or pydantic).How is this patch tested? If it is not, please explain why.
added a bajillion unit tests like for real
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
Tests
New Features
Refactor