GEOPY-2739: Accept BaseUIJson in the start of driver#190
GEOPY-2739: Accept BaseUIJson in the start of driver#190domfournier wants to merge 18 commits intodevelopfrom
Conversation
# Conflicts: # geoapps_utils/base.py
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates geoapps-utils to work with geoh5py.ui_json.UIJson as the primary ui.json representation (instead of InputFile/BaseUIJson), including allowing drivers to start from a UIJson instance and updating related templates and tests.
Changes:
- Switch driver startup and UIJsonGroup execution flow to use
UIJsonobjects directly. - Refactor
Optionsto derive/serialize UIJson via a default template (base.ui.json) and adjust tests accordingly. - Update the base ui.json asset schema for
out_groupand pingeoh5pyto a GEOPY-2739 revision.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
geoapps_utils/base.py |
Refactors Driver.start and Options to operate around UIJson, adds deprecation path for InputFile, and updates serialization/out_group saving. |
geoapps_utils/run.py |
Updates run_uijson_group and workspace/ui.json copy helpers to use UIJson.read/from_dict/write. |
geoapps_utils-assets/uijson/base.ui.json |
Updates the base template to represent out_group as a structured group parameter object. |
tests/uijson_run_test.py |
Updates test setup to build and write a UIJson file directly and adjusts expected filenames. |
tests/driver_test.py |
Aligns tests with new UIJson-based serialization behavior and updated exception types. |
tests/dataclass_test.py |
Loosens flatten equality assertions to avoid direct geoh5 comparisons and updates UIJson writing callsites. |
pyproject.toml |
Pins geoh5py dependency to rev = "GEOPY-2739". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## pip dependencies from Git repositories | ||
| #---------------------------------------- | ||
| #geoh5py = {version = ">=0.13.0a, 0.13.*", source = "pypi", allow-prereleases = true} | ||
| geoh5py = {git = "https://github.com/MiraGeoscience/geoh5py.git", rev = "develop"} | ||
| geoh5py = {git = "https://github.com/MiraGeoscience/geoh5py.git", rev = "GEOPY-2739"} | ||
|
|
There was a problem hiding this comment.
Pinning geoh5py to a moving branch name (rev = "GEOPY-2739") can make builds non-reproducible if the branch head changes. Prefer pinning to an immutable commit hash (or a released version/tag) once the needed changes are available.
There was a problem hiding this comment.
yep, this should not be merged like this!
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #190 +/- ##
============================================
- Coverage 86.14% 75.40% -10.75%
============================================
Files 19 19
Lines 1126 1114 -12
Branches 151 151
============================================
- Hits 970 840 -130
- Misses 116 235 +119
+ Partials 40 39 -1
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| ## pip dependencies from Git repositories | ||
| #---------------------------------------- | ||
| #geoh5py = {version = ">=0.13.0a, 0.13.*", source = "pypi", allow-prereleases = true} | ||
| geoh5py = {git = "https://github.com/MiraGeoscience/geoh5py.git", rev = "develop"} | ||
| geoh5py = {git = "https://github.com/MiraGeoscience/geoh5py.git", rev = "GEOPY-2739"} | ||
|
|
There was a problem hiding this comment.
yep, this should not be merged like this!
| } | ||
|
|
||
|
|
||
| def test_base_driver(tmp_path): |
There was a problem hiding this comment.
you cannot just supress those tests without replacing it, can you?
We should test the behaviors with the new UIJson class to check everything is working the same way!
MatthieuCMira
left a comment
There was a problem hiding this comment.
failueres with scigeoh5.
The solution is to open everything in the same workspace.
geoapps_utils/base.py
Outdated
| if ifile.geoh5 is None: | ||
| raise GeoAppsError("The application needs a valid 'geoh5' file.") | ||
|
|
||
| params = cls._params_class.build(ifile, **kwargs) |
There was a problem hiding this comment.
This load the objects as geoh5py instances, on my side, it leads to an error.
There was a problem hiding this comment.
The error is because i access the valus to do validations in scigeoh5.
But them the workspace is closed, so valeus cannot be loaded
geoapps_utils/base.py
Outdated
| data = input_file_deprecation_warning(input_data) | ||
|
|
||
| if isinstance(data, UIJson): | ||
| data = data.to_params() |
There was a problem hiding this comment.
to params is opening its own context.
But it's loading objects, and the driver might want to use them.
We want to pass a workspace in params, so the object are always opens!
geoapps_utils/base.py
Outdated
| if ifile.geoh5 is None: | ||
| raise GeoAppsError("The application needs a valid 'geoh5' file.") | ||
|
|
||
| params = cls._params_class.build(ifile, **kwargs) |
There was a problem hiding this comment.
| params = cls._params_class.build(ifile, **kwargs) | |
| with Workspace(ifile.geoh5).open(mode=mode) as workspace: | |
| try: | |
| params = cls._params_class.build(ifile, workspace=workspace **kwargs) |
open the workspace here,
pass the workspace in build, in build, pass the workspace to "to_params()" method.
So the objects loaded in the options will be the same as the objects in the application.

GEOPY-2739 - Accept BaseUIJson in the start of driver