Skip to content

GEOPY-2731: Replace InputFile for BaseUIJson class - #134

Open
domfournier wants to merge 9 commits into
developfrom
GEOPY-2731
Open

GEOPY-2731: Replace InputFile for BaseUIJson class#134
domfournier wants to merge 9 commits into
developfrom
GEOPY-2731

Conversation

@domfournier

@domfournier domfournier commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

GEOPY-2731 - Replace InputFile for BaseUIJson class

Copilot AI review requested due to automatic review settings July 31, 2026 16:34
@github-actions github-actions Bot changed the title GEOPY-2731 GEOPY-2731: Replace InputFile for BaseUIJson class Jul 31, 2026

Copilot AI left a comment

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.

Pull request overview

This PR migrates curve-apps away from geoh5py.ui_json.InputFile toward the newer geoh5py.ui_json.UIJson / geoapps_utils.base.Options flow, updating both runtime drivers/apps and the test suite to build and run from UIJson-backed parameter models.

Changes:

  • Updated tests and drivers to use UIJson.read()/write() and Options.build(...) instead of InputFile.read_ui_json()/write_ui_json().
  • Refactored Peak Finder parameters from the legacy BaseParams pattern to an Options model and adjusted driver/app integration accordingly.
  • Tweaked UI JSON assets (e.g., Peak Finder group dataType entries) and contour fixed-contour serialization behavior.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/trend_line_run_test.py Updates Trend Lines tests to use UIJson and new build(...) calling convention.
tests/peak_finder/peak_finder_test.py Updates Peak Finder tests to build params directly from objects/kwargs rather than UIJson string payloads.
tests/parameters_test.py Switches validation assertions to UIJson access patterns and updated contour fixed-contour serialization expectations.
tests/edge_detection_run_test.py Updates Edge Detection tests to use UIJson and Options.build(...).
tests/contour_test.py Adjusts ContourParameters.build(...) invocation to match new API.
curve_apps/trend_lines/driver.py Removes InputFile constructor support and imports in favor of Options.
curve_apps/peak_finder/peak_finder.geoh5 Removes the (LFS pointer) .geoh5 asset from the repo.
curve_apps/peak_finder/params.py Refactors Peak Finder params into an Options model.
curve_apps/peak_finder/layout.py Updates a layout html.Div to explicit children= with flex styling.
curve_apps/peak_finder/driver.py Updates Peak Finder driver to use Options patterns and adds get_line_field helper.
curve_apps/peak_finder/base_dash.py Migrates dash base application from BaseParams to Options/ui_json.flatten().
curve_apps/peak_finder/application.py Switches CLI entrypoint to UIJson.read and PeakFinderParams.build(...); simplifies trigger handling.
curve_apps/edges/driver.py Removes InputFile constructor support and imports in favor of Options.
curve_apps/driver.py Removes InputFile constructor handling from BaseCurveDriver.
curve_apps/contours/options.py Adds serializer for fixed contours to persist as comma-separated string in ui.json output.
curve_apps/contours/driver.py Removes InputFile constructor support and imports in favor of Options.
curve_apps-assets/uijson/peak_finder.ui.json Adds dataType: Float metadata for Peak Finder data groups.
curve_apps-assets/uijson/contours.ui.json Removes one meshType entry from contour ui.json.
Suppressed comments (1)

curve_apps/peak_finder/application.py:1983

  • In the __main__ launch-dash path, _ = peak_parameters.survey no longer "triggers computation" because PeakFinderParams.survey is now just a plain field (the computed in-memory survey copy lives on PeakFinder.survey). As written, this line is a no-op and the comment is misleading.
    if peak_parameters.launch_dash:
        with peak_parameters.geoh5.open(mode="r"):
            _ = peak_parameters.survey  # Trigger computation
            logger.info("Loaded. Launching peak finder app . . .")
            PeakFinder(peak_parameters).run()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread curve_apps/peak_finder/driver.py Outdated
Comment thread curve_apps/peak_finder/params.py Outdated
Comment thread curve_apps/contours/options.py
Comment thread curve_apps/peak_finder/driver.py
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.89655% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.57%. Comparing base (dfec2e9) to head (ae7a8a2).

Files with missing lines Patch % Lines
curve_apps/peak_finder/driver.py 50.00% 6 Missing and 3 partials ⚠️
curve_apps/peak_finder/application.py 66.66% 7 Missing ⚠️
curve_apps/peak_finder/base_dash.py 72.22% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #134      +/-   ##
===========================================
- Coverage    67.97%   64.57%   -3.41%     
===========================================
  Files           20       20              
  Lines         2364     2120     -244     
  Branches       325      323       -2     
===========================================
- Hits          1607     1369     -238     
+ Misses         654      651       -3     
+ Partials       103      100       -3     
Files with missing lines Coverage Δ
curve_apps/contours/driver.py 72.41% <100.00%> (-0.92%) ⬇️
curve_apps/contours/options.py 96.87% <100.00%> (+0.26%) ⬆️
curve_apps/edges/driver.py 85.71% <100.00%> (-0.37%) ⬇️
curve_apps/peak_finder/layout.py 100.00% <ø> (ø)
curve_apps/peak_finder/params.py 90.62% <100.00%> (-3.79%) ⬇️
curve_apps/trend_lines/driver.py 79.45% <100.00%> (-0.55%) ⬇️
curve_apps/peak_finder/base_dash.py 58.87% <72.22%> (-2.37%) ⬇️
curve_apps/peak_finder/application.py 31.52% <66.66%> (+0.59%) ⬆️
curve_apps/peak_finder/driver.py 75.13% <50.00%> (-2.24%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmcga gmcga left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Noticed a couple of small potential issues, other than that seems good!

Comment thread curve_apps/peak_finder/driver.py Outdated
@@ -436,16 +423,34 @@ def run(self): # pylint: disable=too-many-locals, too-many-branches, too-many-s

self.update_monitoring_directory(out_group)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

run creates a local out_group but neither stores or returns it, which will probably cause problems with the new Driver.start as it will receive result = None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Technically no issue because the driver.out_group is not None. But agree that update_monitoring_directory(out_group) is already in the start

Comment thread tests/contour_test.py Outdated
@gmcga gmcga assigned gmcga and unassigned gmcga Aug 7, 2026
@gmcga
gmcga self-requested a review August 7, 2026 20:03

@gmcga gmcga left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good

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