GEOPY-2739: Accept BaseUIJson in the start of driver#860
GEOPY-2739: Accept BaseUIJson in the start of driver#860domfournier wants to merge 46 commits intofeature/uijsonfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the UI JSON model naming by renaming the core BaseUIJson class to UIJson, and adjusts tests/imports accordingly to match the new API surface.
Changes:
- Rename
BaseUIJsontoUIJsoningeoh5py.ui_json.ui_json. - Update UI JSON tests to subclass/use
UIJsoninstead ofBaseUIJson. - Update the
geoh5py.ui_jsonpackage export to re-exportUIJson.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| geoh5py/ui_json/ui_json.py | Renames the core model class and updates read() logic/type hints to reference UIJson. |
| geoh5py/ui_json/init.py | Switches the package-level export from BaseUIJson to UIJson. |
| tests/ui_json/uijson_test.py | Updates tests to use UIJson for subclassing/reading. |
| tests/ui_json/forms_test.py | Updates helper test model to subclass UIJson. |
💡 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 #860 +/- ##
===========================================
- Coverage 91.23% 91.18% -0.05%
===========================================
Files 112 112
Lines 10369 10402 +33
Branches 1908 1916 +8
===========================================
+ Hits 9460 9485 +25
- Misses 481 487 +6
- Partials 428 430 +2
🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
…into GEOPY-2739 # Conflicts: # geoh5py/ui_json/ui_json.py # geoh5py/ui_json/validations/__init__.py # geoh5py/ui_json/validations/uijson.py
# Conflicts: # geoh5py/ui_json/ui_json.py # geoh5py/ui_json/validations/__init__.py # geoh5py/ui_json/validations/uijson.py # tests/ui_json/uijson_test.py
# Conflicts: # geoh5py/ui_json/ui_json.py
MatthieuCMira
left a comment
There was a problem hiding this comment.
check for the Form accepting multiselect, and accept list of expected values
note other forms could suffer from the same mistake?
correct the form as group_optiomnal can act as optional
for more information, see https://pre-commit.ci
- Add type annotations and docstring to str2none in utils.py - Improve UIJson.infer docstring with params and return docs - Change DataForm.value to OptionalUUIDList to support list of UUIDs when multiselect is True - Add test for DataForm with list of UUIDs Agent-Logs-Url: https://github.com/MiraGeoscience/geoh5py/sessions/59d9d0e9-5ed8-44ad-b621-90e66658a9e9 Co-authored-by: domfournier <55204635+domfournier@users.noreply.github.com>
…into GEOPY-2739 # Conflicts: # recipe.yaml
for more information, see https://pre-commit.ci
|
|
||
|
|
||
| def parent_validation(name: str, data: dict[str, Any], json_dict: dict[str, Any]): | ||
| def parent_validation(name: str, data: dict[str, Any], ui_json: UIJson): |
There was a problem hiding this comment.
this gave me an error because if child is in list, it raises an error!
geoh5py/ui_json/validation.py
Outdated
| isinstance(child, Data) and parent.get_entity(child.uid)[0] is None | ||
| ): | ||
| raise UIJsonError(f"{name} data is not a child of {form['parent']}.") | ||
| if not isinstance(parent, ObjectBase) or (child not in parent.children): |
There was a problem hiding this comment.
| if not isinstance(parent, ObjectBase) or (child not in parent.children): | |
| child = child if isinstance(child, list) else [child] | |
| missing_children = len(list(set(child) - set(parent.children))) > 0 | |
| if not isinstance(parent, ObjectBase) or missing_children: |

GEOPY-2739 - Accept BaseUIJson in the start of driver