Commit 1a275079 authored by Romain Casati's avatar Romain Casati
Browse files

Removing numpy + pandas warnings.

parent 3358bb69
from . import kernel
from js import document
import io
import warnings
__author__ = "Romain Casati"
__license__ = "GNU GPL v3"
......@@ -103,8 +104,12 @@ def patch_folium():
def patch_pandas():
"""
Patch Pandas to render data frames.
Patch Pandas to render data frames (and remove user warning about lzma).
"""
with warnings.catch_warnings():
warnings.simplefilter('ignore', UserWarning)
import pandas
from pandas import DataFrame
def display(self):
......@@ -147,7 +152,6 @@ def patch_scipy():
import _ivp
import scipy.integrate
import numpy as np
import warnings
# add support to solve_ivp
assert not hasattr(scipy.integrate, "solve_ivp")
......@@ -326,6 +330,13 @@ def patch_pyroutelib3():
ds.urlretrieve = urlretrieve
def patch_numpy():
""" Remove SyntaxWarning about is/== ."""
with warnings.catch_warnings():
warnings.simplefilter('ignore', SyntaxWarning)
import numpy
def patch(modules):
""" Patch a list of modules. """
if isinstance(modules, str):
......
......@@ -106,9 +106,7 @@ def test_importables(selenium):
def test_import_not_hacked(selenium):
data = selenium.run_basthon("import numpy as np; np.pi")
assert data['result']['result']['text/plain'] == "3.141592653589793"
# 0.16.1 shows numpy's warnings (Python 3.8)
if selenium.run_js("return pyodide.version()") != "0.16.1":
assert data['stderr'] == ""
assert data['stderr'] == ""
def test_banner(selenium):
......
......@@ -188,6 +188,11 @@ status
assert result['result']['result']['text/plain'] == "'success'"
def test_numpy():
# already tested in test_base and test_scipy
assert True
def test_micropip(selenium):
# at this point, folium should have loaded requests
# so we check that this is our version
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment