Skip to content

Commit

Permalink
Take float precision into account when highlighting table cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Sep 8, 2020
1 parent 5e2b785 commit beee39f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ v6.1 (unreleased)

Lab
^^^
* Take float precision into account when highlighting table cells (Jendrik Seipp).
* Separate tests for Singularity and FF example experiments from other tests (Jendrik Seipp).
* Skip ``cached_revision`` doctests if ``DOWNWARD_REVISION_CACHE`` variable is not set (Jendrik Seipp).
* Add ``.github/CONTRIBUTING.md`` file (Jendrik Seipp).
Expand Down
3 changes: 2 additions & 1 deletion lab/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ def _format_row(self, row_name, row):
min_value, max_value = None, None

def is_close(a, b):
return math.isclose(a, b)
# Highlight based on precision visible in table, not actual values.
return math.isclose(a, b, abs_tol=10 ** -self.digits)

for col_name, value in row.items():
color = None
Expand Down

0 comments on commit beee39f

Please sign in to comment.