Skip to content

Improve type hints and return value for process close#17

Merged
sethrj merged 1 commit into
celeritas-project:mainfrom
sethrj:type-hints
May 29, 2026
Merged

Improve type hints and return value for process close#17
sethrj merged 1 commit into
celeritas-project:mainfrom
sethrj:type-hints

Conversation

@sethrj
Copy link
Copy Markdown
Member

@sethrj sethrj commented May 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2026 15:37
Copy link
Copy Markdown
Contributor

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

Adds an optional structure field to the ORANGE BihMetadata output model, tightens CelerGeo.close to always return a dict[str, Any] (capturing any decode failure rather than silently returning the raw string), and extends plot_all_geometry to surface the matplotlib fig and a top-level colorbar in its returned mapping.

Changes:

  • BihMetadata gains an optional structure: Optional[list[dict]] field.
  • CelerGeo.close always returns a dict, wrapping non-JSON output as {"result": ..., "decode_error": ...}.
  • plot_all_geometry returns a Mapping[Union[str, GeometryEngine], Any] and includes "fig" and (when applicable) "colorbar" entries.

Reviewed changes

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

File Description
celerpy/model/output.py Adds structure field to BihMetadata.
celerpy/visualize.py Normalizes CelerGeo.close return type to a dict and exposes fig/colorbar from plot_all_geometry.

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

Comment thread celerpy/model/output.py Outdated
Comment thread celerpy/visualize.py
@sethrj sethrj changed the title Add BIH structure output and change close to always return a dict Improve type hints and return value for process close May 29, 2026
@sethrj sethrj merged commit 5a7a94f into celeritas-project:main May 29, 2026
5 checks passed
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