Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
suppress scipy deprecation warnings
Browse files Browse the repository at this point in the history
scipy will more some scipy.* functions to numpy in scipy 2.0
These warings pop up in networkx 2.2, up to 2.4
and break doctests (but not in Sage code itself).
We suppress them here. This can be removed with networkx 2.5
(not yet released).
  • Loading branch information
dimpase committed Jun 1, 2020
1 parent 54595b0 commit c005562
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sage/doctest/forker.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,13 @@ def run(self, test, compileflags=None, out=None, clear_globs=True):
"""
self.setters = {}
randstate.set_random_seed(0)
# scipy 1.18 introduced reprecation warnings on a number of things they are moving to
# numpy, e.g. DeprecationWarning: scipy.array is deprecated
# and will be removed in SciPy 2.0.0, use numpy.array instead
# This affects networkx 2.2 up and including 2.4
# We filter them out here:
warnings.filterwarnings('ignore', '.*Deprec.*scipy.*instead',) # cf trac #29425

warnings.showwarning = showwarning_with_traceback
self.running_doctest_digest = hashlib.md5()
self.test = test
Expand Down

0 comments on commit c005562

Please sign in to comment.