Add RescaleDiagnostics to return detailed rescaling information - #119
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 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".
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
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
RescaleDiagnosticsdataclass that provides detailed information about the rescaling operation performed byEllipseCloud.rescale(). Users can now optionally retrieve pre- and post-rescaling summaries along with the scale factor.Key Changes
New
RescaleDiagnosticsdataclass: A frozen dataclass containing:scale: The scaling factor appliedpre_summary: Per-axis aggregate semi-axis lengths before rescalingpost_summary: Per-axis aggregate semi-axis lengths after rescalingEnhanced
EllipseCloud.rescale()method:return_diagnosticsparameter (defaultFalsefor backward compatibility)floatwhenreturn_diagnostics=False(existing behavior)RescaleDiagnosticswhenreturn_diagnostics=TrueType hints: Added overloaded type signatures in
.pyistub file to properly reflect the conditional return type based on thereturn_diagnosticsparameterPublic API: Exported
RescaleDiagnosticsfrom main__init__.pyand.pyifilesTests: Added three comprehensive test cases:
RescaleDiagnosticstype and shape of returned datapost_summary = pre_summary / scaleImplementation Details
The diagnostics are computed from the existing
ell_scalesarray that was already being calculated internally, so there is minimal performance overhead. The implementation maintains full backward compatibility by defaultingreturn_diagnosticstoFalse.https://claude.ai/code/session_01S8zuHdfhWRruSejHtQZo6L