Skip to content

docs: Correct tolerance default attribution - #58

Merged
Oliver Borchert (borchero) merged 2 commits into
Quantco:mainfrom
haydena7:docs/tolerance-defaults-attribution
Sep 9, 2026
Merged

docs: Correct tolerance default attribution#58
Oliver Borchert (borchero) merged 2 commits into
Quantco:mainfrom
haydena7:docs/tolerance-defaults-attribution

Conversation

@haydena7

Copy link
Copy Markdown
Contributor

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!

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dbe91d8) to head (05a941b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #58   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines         1138      1138           
=========================================
  Hits          1138      1138           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@borchero
Oliver Borchert (borchero) merged commit 707b796 into Quantco:main Sep 9, 2026
18 checks passed
@haydena7
Hayden Anderson (haydena7) deleted the docs/tolerance-defaults-attribution branch September 9, 2026 12:51
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.

4 participants