Skip to content

Add RescaleDiagnostics to return detailed rescaling information - #119

Merged
t-uda merged 2 commits into
ellphi-0.1.3from
claude/resolve-github-issue-3FV4H
Jul 3, 2026
Merged

Add RescaleDiagnostics to return detailed rescaling information#119
t-uda merged 2 commits into
ellphi-0.1.3from
claude/resolve-github-issue-3FV4H

Conversation

@t-uda

@t-uda t-uda commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a new RescaleDiagnostics dataclass that provides detailed information about the rescaling operation performed by EllipseCloud.rescale(). Users can now optionally retrieve pre- and post-rescaling summaries along with the scale factor.

Key Changes

  • New RescaleDiagnostics dataclass: A frozen dataclass containing:

    • scale: The scaling factor applied
    • pre_summary: Per-axis aggregate semi-axis lengths before rescaling
    • post_summary: Per-axis aggregate semi-axis lengths after rescaling
  • Enhanced EllipseCloud.rescale() method:

    • Added optional return_diagnostics parameter (default False for backward compatibility)
    • Returns float when return_diagnostics=False (existing behavior)
    • Returns RescaleDiagnostics when return_diagnostics=True
  • Type hints: Added overloaded type signatures in .pyi stub file to properly reflect the conditional return type based on the return_diagnostics parameter

  • Public API: Exported RescaleDiagnostics from main __init__.py and .pyi files

  • Tests: Added three comprehensive test cases:

    • Validates RescaleDiagnostics type and shape of returned data
    • Verifies mathematical relationship: post_summary = pre_summary / scale
    • Ensures scale value matches between default and diagnostics modes

Implementation Details

The diagnostics are computed from the existing ell_scales array that was already being calculated internally, so there is minimal performance overhead. The implementation maintains full backward compatibility by defaulting return_diagnostics to False.

https://claude.ai/code/session_01S8zuHdfhWRruSejHtQZo6L

feat(ellcloud): add RescaleDiagnostics and return_diagnostics to rescale() (#105)

- Upgrade codecov/codecov-action from v4.0.1 to v5; add continue-on-error: true
  so a Codecov network glitch cannot fail an otherwise-passing CI run.
- Add frozen dataclass RescaleDiagnostics (scale, pre_summary, post_summary)
  exported from ellphi and ellcloud.
- rescale() gains an opt-in return_diagnostics=False flag; default path is
  fully backward-compatible.
- Update ellcloud.pyi with @overload stubs for both call signatures.
- Add three new regression tests covering type, shape, pre/post relationship,
  and consistency with the default return path.

https://claude.ai/code/session_01S8zuHdfhWRruSejHtQZo6L
@codecov

codecov Bot commented Mar 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e2c8315f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ellphi/ellcloud.pyi
Addresses Codex review: a non-literal bool variable passed as
return_diagnostics was rejected by type checkers. Add a third overload
accepting bool -> float | RescaleDiagnostics as the fallback case.

https://claude.ai/code/session_01S8zuHdfhWRruSejHtQZo6L

@t-uda t-uda left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

LGTM

@t-uda
t-uda merged commit 05e6315 into ellphi-0.1.3 Jul 3, 2026
21 checks passed
@t-uda
t-uda deleted the claude/resolve-github-issue-3FV4H branch July 3, 2026 13:00
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.

1 participant