Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.doctest: Eliminate hard dependency on RealIntervalField #32585

Closed
mkoeppe opened this issue Sep 29, 2021 · 13 comments
Closed

sage.doctest: Eliminate hard dependency on RealIntervalField #32585

mkoeppe opened this issue Sep 29, 2021 · 13 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 29, 2021

Follow up on #29922.
The doctester uses RealIntervalField for doctests involving numerical tolerances. This is an obstacle to doctesting modularized subset distributions because RealIntervalField depends on a compiled library (MPFI).

We should eliminate this by rewriting it in a more elementary way.

As of this ticket, we just issue a warning if RealIntervalField is not available.

CC: @kliem @sagetrac-tmonteil

Component: doctest framework

Author: Matthias Koeppe

Branch/Commit: db154ec

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32585

@mkoeppe mkoeppe added this to the sage-9.5 milestone Sep 29, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

New commits:

13eed83src/sage/doctest/parsing.py: Do not fail if RealIntervalField cannot be imported, just warn

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

Commit: 13eed83

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

Author: Matthias Koeppe

@mkoeppe mkoeppe changed the title sage.doctest: Eliminate dependency on RealIntervalField sage.doctest: Eliminate hard dependency on RealIntervalField Oct 3, 2021
@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

comment:4

LGTM.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 4, 2021

comment:5

Thank you!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 6, 2021

comment:6

Something isn't quite right with this workaround yet. Getting a TypeError in doctesting framework when testing in #32432 sage/geometry/polyhedron/library.py", line 677, in sage.geometry.polyhedron.library.Polytopes.simplex

 File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-gcc11/pkgs/sagemath-polyhedra/.tox/python/lib/python3.9/site-packages/sage/doctest/parsing.py", line 1121, in <listcomp>
    want_intervals = [self.add_tolerance(v, want) for v in want_values]
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-gcc11/pkgs/sagemath-polyhedra/.tox/python/lib/python3.9/site-packages/sage/doctest/parsing.py", line 977, in add_tolerance
    return wantval + RIFtol(want.abs_tol) * RIFtol(-1,1)
TypeError: can't multiply sequence by non-int of type 'float'

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 10, 2021

Changed commit from 13eed83 to db154ec

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 10, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

db154ecsage.doctest.parsing.RIFtol: Fixup when RealIntervalField not available

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 10, 2021

comment:11

Thanks.

@vbraun
Copy link
Member

vbraun commented Oct 13, 2021

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

No branches or pull requests

3 participants