Skip to content

GEOPY-2739: Accept BaseUIJson in the start of driver#190

Open
domfournier wants to merge 18 commits intodevelopfrom
GEOPY-2739
Open

GEOPY-2739: Accept BaseUIJson in the start of driver#190
domfournier wants to merge 18 commits intodevelopfrom
GEOPY-2739

Conversation

@domfournier
Copy link
Copy Markdown
Contributor

@domfournier domfournier commented Mar 31, 2026

GEOPY-2739 - Accept BaseUIJson in the start of driver

@github-actions github-actions bot changed the title GEOPY-2739 GEOPY-2739: Accept BaseUIJson in the start of driver Mar 31, 2026
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@domfournier domfournier marked this pull request as ready for review April 2, 2026 21:03
Copilot AI review requested due to automatic review settings April 2, 2026 21:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UIJson objects directly.
  • Refactor Options to derive/serialize UIJson via a default template (base.ui.json) and adjust tests accordingly.
  • Update the base ui.json asset schema for out_group and pin geoh5py to 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.

Comment on lines 70 to 74
## 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"}

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this should not be merged like this!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 70.76923% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.40%. Comparing base (eb04741) to head (11b1282).

Files with missing lines Patch % Lines
geoapps_utils/base.py 67.34% 11 Missing and 5 partials ⚠️
geoapps_utils/run.py 81.25% 1 Missing and 2 partials ⚠️
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     
Files with missing lines Coverage Δ
geoapps_utils/run.py 90.99% <81.25%> (-1.61%) ⬇️
geoapps_utils/base.py 78.31% <67.34%> (-13.40%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling the tests were supress without being replaced.

As this is at the root of all our apps, it shoulkd be heavily unitested right?

image

!!

Comment on lines 70 to 74
## 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"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this should not be merged like this!

}


def test_base_driver(tmp_path):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failueres with scigeoh5.
The solution is to open everything in the same workspace.

if ifile.geoh5 is None:
raise GeoAppsError("The application needs a valid 'geoh5' file.")

params = cls._params_class.build(ifile, **kwargs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This load the objects as geoh5py instances, on my side, it leads to an error.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is because i access the valus to do validations in scigeoh5.
But them the workspace is closed, so valeus cannot be loaded

data = input_file_deprecation_warning(input_data)

if isinstance(data, UIJson):
data = data.to_params()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

if ifile.geoh5 is None:
raise GeoAppsError("The application needs a valid 'geoh5' file.")

params = cls._params_class.build(ifile, **kwargs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

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.

3 participants