GEOPY-2657: Allow UIJson forms to accept geoh5py.Entity#866
GEOPY-2657: Allow UIJson forms to accept geoh5py.Entity#866domfournier merged 12 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the UI JSON form validation/annotation layer so form fields that represent UUIDs can accept Entity instances (and lists of entities) and be automatically converted to UUIDs, with accompanying test updates.
Changes:
- Added an
entity_to_uuidvalidator to demoteEntityinputs to their.uid. - Moved several Pydantic
Annotatedaliases (e.g.,MeshTypes,GroupTypes,OptionalUUID*,PathList) intogeoh5py/ui_json/annotations.pyand updated imports accordingly. - Extended tests to cover passing
ObjectForm.valueas an entity andMultiSelectDataForm.valueas a list of data entities.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/ui_json/forms_test.py |
Adds coverage for entity/list-of-entity inputs to form value fields. |
geoh5py/ui_json/validations/form.py |
Introduces entity_to_uuid and refactors UUID serialization helpers. |
geoh5py/ui_json/forms.py |
Switches form type aliases to centralized ui_json.annotations and keeps enums local. |
geoh5py/ui_json/annotations.py |
Centralizes shared Annotated aliases and wires in entity_to_uuid as a BeforeValidator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #866 +/- ##
===========================================
+ Coverage 91.13% 91.20% +0.07%
===========================================
Files 115 112 -3
Lines 10353 10338 -15
Branches 1915 1911 -4
===========================================
- Hits 9435 9429 -6
+ Misses 491 481 -10
- Partials 427 428 +1
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
MatthieuCMira
left a comment
There was a problem hiding this comment.
I have the feeling things could be simpler and have a better organization
# Conflicts: # geoh5py/ui_json/annotations.py # geoh5py/ui_json/forms.py # geoh5py/ui_json/validations/form.py
…tion # Conflicts: # geoh5py/shared/utils.py # geoh5py/ui_json/annotations.py # geoh5py/ui_json/forms.py # geoh5py/ui_json/ui_json.py
GEOPY-2657 - Allow UIJson forms to accept geoh5py.Entity