Skip to content

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

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

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

Conversation

@domfournier
Copy link
Copy Markdown
Contributor

@domfournier domfournier commented Mar 21, 2026

GEOPY-2739 - Accept BaseUIJson in the start of driver

Copilot AI review requested due to automatic review settings March 21, 2026 15:23
@github-actions github-actions bot changed the title GEOPY-2739 GEOPY-2739: Accept BaseUIJson in the start of driver Mar 21, 2026
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 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 BaseUIJson to UIJson in geoh5py.ui_json.ui_json.
  • Update UI JSON tests to subclass/use UIJson instead of BaseUIJson.
  • Update the geoh5py.ui_json package export to re-export UIJson.

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.

Comment on lines 119 to +120
@classmethod
def read(cls, path: str | Path) -> BaseUIJson:
def read(cls, path: str | Path) -> UIJson:
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

read can return an instance of a subclass when called as MyUIJson.read(...), but the return type is annotated as UIJson. This makes the public API typing inaccurate and can cause mypy/IDE issues. Consider typing it as Self (e.g., cls: type[Self] -> Self) or using overloads to express the UIJson vs subclass behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 121 to 123
"""
Create a UIJson object from ui.json file.

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The read method docstring still mentions BaseUIJson (a name that no longer exists after this rename). Please update the wording to UIJson (or remove the class-name reference) so the documentation matches the current API.

Copilot uses AI. Check for mistakes.
Comment on lines 56 to 60

class BaseUIJson(BaseModel):
class UIJson(BaseModel):
"""
Base class for storing ui.json data on disk.

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

Renaming BaseUIJson to UIJson and removing the old symbol is a breaking public API change (it was previously importable from geoh5py.ui_json). If backward compatibility is expected, consider keeping BaseUIJson as a deprecated alias of UIJson (and optionally emitting a DeprecationWarning) to avoid breaking downstream imports.

Copilot uses AI. Check for mistakes.
from .validation import InputValidation
from .forms import BaseForm
from .ui_json import BaseUIJson
from .ui_json import UIJson
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

This change drops the BaseUIJson re-export from geoh5py.ui_json, which is a breaking import for external callers (from geoh5py.ui_json import BaseUIJson). If the rename is intended, consider re-exporting a deprecated BaseUIJson alias alongside UIJson, or ensure the project versioning/release notes explicitly cover the breaking change.

Suggested change
from .ui_json import UIJson
from .ui_json import UIJson
# Backwards-compatible alias: BaseUIJson was renamed to UIJson.
# External callers may still import BaseUIJson from geoh5py.ui_json.
BaseUIJson = UIJson

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.21%. Comparing base (8a2adcc) to head (6572a04).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #860      +/-   ##
===========================================
+ Coverage    91.18%   91.21%   +0.02%     
===========================================
  Files          115      115              
  Lines        10298    10296       -2     
  Branches      1901     1900       -1     
===========================================
+ Hits          9390     9391       +1     
+ Misses         485      483       -2     
+ Partials       423      422       -1     
Files with missing lines Coverage Δ
geoh5py/ui_json/__init__.py 100.00% <100.00%> (ø)
geoh5py/ui_json/ui_json.py 90.66% <100.00%> (+1.22%) ⬆️
geoh5py/ui_json/validations/__init__.py 100.00% <ø> (ø)
geoh5py/ui_json/validations/uijson.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants