Skip to content

docs: Correct tolerance default attribution - #58

Open
Hayden Anderson (haydena7) wants to merge 1 commit into
Quantco:mainfrom
haydena7:docs/tolerance-defaults-attribution
Open

docs: Correct tolerance default attribution#58
Hayden Anderson (haydena7) wants to merge 1 commit into
Quantco:mainfrom
haydena7:docs/tolerance-defaults-attribution

Conversation

@haydena7

Copy link
Copy Markdown

Motivation

The tolerances guide states that the default abs_tol=1e-08 / rel_tol=1e-05 match Python's math.isclose defaults. They don't — math.isclose defaults to rel_tol=1e-09, abs_tol=0.0. The values actually match polars.testing.assert_frame_equal.

The error points in the risky direction: a reader trusting the guide would believe diffly is stricter (~9 significant figures) than it is (~5).

Changes

  • Reword the "Default behavior" paragraph in docs/guides/features/tolerances.ipynb to attribute the defaults to polars.testing.assert_frame_equal.

Markdown cell only; no cells were executed and no outputs changed. The compare_frames docstring note that the implementation mirrors math.isclose is left as-is, since that statement is about the formula and is correct.

Copilot AI lite review requested due to automatic review settings September 4, 2026 17:09
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 4, 2026
@haydena7 Hayden Anderson (haydena7) changed the title docs: correct tolerance default attribution docs: Correct tolerance default attribution Sep 4, 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.

🟡 Changes recommended

The updated paragraph includes a potentially confusing comparison to polars.Expr.is_close defaults even though Diffly calls Expr.is_close with explicit tolerances.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the tolerances documentation to correctly attribute Diffly’s default float tolerances to Polars testing utilities, preventing readers from misinterpreting how strict Diffly’s default comparisons are.

Changes:

  • Reworded the “Default behavior” paragraph to attribute abs_tol=1e-08 / rel_tol=1e-05 to polars.testing.assert_frame_equal.
  • Added an explanatory note contrasting these defaults with Python’s math.isclose defaults.
File summaries
File Description
docs/guides/features/tolerances.ipynb Corrects documentation text about default tolerance provenance.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/guides/features/tolerances.ipynb

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants