Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
d6bc94ef
Commit
d6bc94ef
authored
Oct 31, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor scipy tests
parent
ba0e045b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
75 deletions
+26
-75
.circleci/config.yml
.circleci/config.yml
+0
-3
packages/scipy/meta.yaml
packages/scipy/meta.yaml
+11
-2
packages/scipy/patches/fix-blas.patch
packages/scipy/patches/fix-blas.patch
+7
-7
test/packages/test_scipy.py
test/packages/test_scipy.py
+1
-61
test/test_common.py
test/test_common.py
+7
-2
No files found.
.circleci/config.yml
View file @
d6bc94ef
...
@@ -22,9 +22,6 @@ jobs:
...
@@ -22,9 +22,6 @@ jobs:
sudo apt-get update
sudo apt-get update
sudo apt-get install gfortran f2c
sudo apt-get install gfortran f2c
# Download BLAS/LAPACK
git clone https://github.com/rth/CLAPACK-WA.git CLAPACK-WA
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v11-
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v11-
...
...
packages/scipy/meta.yaml
View file @
d6bc94ef
...
@@ -26,7 +26,7 @@ source:
...
@@ -26,7 +26,7 @@ source:
-
patches/fix_mmap.patch
-
patches/fix_mmap.patch
build
:
build
:
cflags
:
-I../../../../CLAPACK-WA/INCLUDE -Wno-implicit-function-declaration
cflags
:
-I../../../../CLAPACK
/CLAPACK
-WA/INCLUDE -Wno-implicit-function-declaration
cxxflags
:
cxxflags
:
requirements
:
requirements
:
...
@@ -36,6 +36,15 @@ requirements:
...
@@ -36,6 +36,15 @@ requirements:
test
:
test
:
imports
:
imports
:
-
scipy
-
scipy
-
scipy.cluster
-
scipy.constants
-
scipy.fftpack
-
scipy.odr
-
scipy.sparse
-
scipy.interpolate
-
scipy.integrate
-
scipy.linalg
-
scipy.linalg
-
scipy.misc
-
scipy.ndimage
-
scipy.spatial
-
scipy.special
-
scipy.special
-
scipy.sparse
packages/scipy/patches/fix-blas.patch
View file @
d6bc94ef
commit
eba70f7602827851012acd1b836b5a56a3e70e32
commit
f03d85c00ae993c3c87a5a7b2ea0c1215f57ee04
Author: Roman Yurchak <rth.yurchak@pm.me>
Author: Roman Yurchak <rth.yurchak@pm.me>
Date: Mon Oct 8 10:53:11 2018 +0200
Date: Mon Oct 8 10:53:11 2018 +0200
Partial fixes for BLAS/LAPACK
Partial fixes for BLAS/LAPACK
diff --git a/scipy/linalg/setup.py b/scipy/linalg/setup.py
diff --git a/scipy/linalg/setup.py b/scipy/linalg/setup.py
index 2c9b9ba22..
6a0c4fa6
5 100755
index 2c9b9ba22..
e8c7336d
5 100755
--- a/scipy/linalg/setup.py
--- a/scipy/linalg/setup.py
+++ b/scipy/linalg/setup.py
+++ b/scipy/linalg/setup.py
@@ -14,7 +14,13 @@
def configuration(parent_package='', top_path=None):
@@ -14,7 +14,13 @@
def configuration(parent_package='', top_path=None):
...
@@ -16,7 +16,7 @@ index 2c9b9ba22..6a0c4fa65 100755
...
@@ -16,7 +16,7 @@ index 2c9b9ba22..6a0c4fa65 100755
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ 'libraries': [],
+ 'libraries': [],
+ 'include_dirs': [],
+ 'include_dirs': [],
+ 'library_dirs': ['../../../../CLAPACK-WA/'],
+ 'library_dirs': ['../../../../CLAPACK
/CLAPACK
-WA/'],
+ 'language': 'f77',
+ 'language': 'f77',
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ ('HAVE_CBLAS', None)]}
+ ('HAVE_CBLAS', None)]}
...
@@ -50,7 +50,7 @@ index 2c9b9ba22..6a0c4fa65 100755
...
@@ -50,7 +50,7 @@ index 2c9b9ba22..6a0c4fa65 100755
# _calc_lwork:
# _calc_lwork:
config.add_extension('_calc_lwork',
config.add_extension('_calc_lwork',
diff --git a/scipy/sparse/linalg/eigen/arpack/setup.py b/scipy/sparse/linalg/eigen/arpack/setup.py
diff --git a/scipy/sparse/linalg/eigen/arpack/setup.py b/scipy/sparse/linalg/eigen/arpack/setup.py
index a8175a9d5..
0fafd82b3
100755
index a8175a9d5..
88a717fe6
100755
--- a/scipy/sparse/linalg/eigen/arpack/setup.py
--- a/scipy/sparse/linalg/eigen/arpack/setup.py
+++ b/scipy/sparse/linalg/eigen/arpack/setup.py
+++ b/scipy/sparse/linalg/eigen/arpack/setup.py
@@ -11,7 +11,13 @@
def configuration(parent_package='',top_path=None):
@@ -11,7 +11,13 @@
def configuration(parent_package='',top_path=None):
...
@@ -61,7 +61,7 @@ index a8175a9d5..0fafd82b3 100755
...
@@ -61,7 +61,7 @@ index a8175a9d5..0fafd82b3 100755
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ 'libraries': [],
+ 'libraries': [],
+ 'include_dirs': [],
+ 'include_dirs': [],
+ 'library_dirs': ['../../../../CLAPACK-WA/'],
+ 'library_dirs': ['../../../../CLAPACK
/CLAPACK
-WA/'],
+ 'language': 'f77',
+ 'language': 'f77',
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ ('HAVE_CBLAS', None)]}
+ ('HAVE_CBLAS', None)]}
...
@@ -69,7 +69,7 @@ index a8175a9d5..0fafd82b3 100755
...
@@ -69,7 +69,7 @@ index a8175a9d5..0fafd82b3 100755
if not lapack_opt:
if not lapack_opt:
raise NotFoundError('no lapack/blas resources found')
raise NotFoundError('no lapack/blas resources found')
diff --git a/scipy/sparse/linalg/isolve/setup.py b/scipy/sparse/linalg/isolve/setup.py
diff --git a/scipy/sparse/linalg/isolve/setup.py b/scipy/sparse/linalg/isolve/setup.py
index becb9237a..
c9d4379b1
100755
index becb9237a..
707e3f49d
100755
--- a/scipy/sparse/linalg/isolve/setup.py
--- a/scipy/sparse/linalg/isolve/setup.py
+++ b/scipy/sparse/linalg/isolve/setup.py
+++ b/scipy/sparse/linalg/isolve/setup.py
@@ -11,7 +11,13 @@
def configuration(parent_package='',top_path=None):
@@ -11,7 +11,13 @@
def configuration(parent_package='',top_path=None):
...
@@ -80,7 +80,7 @@ index becb9237a..c9d4379b1 100755
...
@@ -80,7 +80,7 @@ index becb9237a..c9d4379b1 100755
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ lapack_opt = { # libraries will be auto-generated by pywasmcross
+ 'libraries': [],
+ 'libraries': [],
+ 'include_dirs': [],
+ 'include_dirs': [],
+ 'library_dirs': ['../../../../CLAPACK-WA/'],
+ 'library_dirs': ['../../../../CLAPACK
/CLAPACK
-WA/'],
+ 'language': 'f77',
+ 'language': 'f77',
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ 'define_macros': [('NO_ATLAS_INFO', 1),
+ ('HAVE_CBLAS', None)]}
+ ('HAVE_CBLAS', None)]}
...
...
test/packages/test_scipy.py
View file @
d6bc94ef
...
@@ -3,39 +3,13 @@ from textwrap import dedent
...
@@ -3,39 +3,13 @@ from textwrap import dedent
import
pytest
import
pytest
def
test_scipy_import
(
selenium_standalone
,
request
):
def
test_scipy_linalg
(
selenium_standalone
,
request
):
from
selenium.common.exceptions
import
JavascriptException
selenium
=
selenium_standalone
selenium
=
selenium_standalone
if
selenium
.
browser
==
'chrome'
:
if
selenium
.
browser
==
'chrome'
:
request
.
applymarker
(
pytest
.
mark
.
xfail
(
request
.
applymarker
(
pytest
.
mark
.
xfail
(
run
=
False
,
reason
=
'chrome not supported'
))
run
=
False
,
reason
=
'chrome not supported'
))
selenium
.
load_package
(
"scipy"
)
selenium
.
run
(
"""
import scipy
"""
)
# supported modules
for
module
in
[
'cluster'
,
'constants'
,
'fftpack'
,
'odr'
,
'sparse'
,
'interpolate'
,
'integrate'
,
'linalg'
,
'misc'
,
'ndimage'
,
'spatial'
,
'special'
]:
selenium
.
run
(
f"import scipy.
{
module
}
"
)
# not yet built modules
for
module
in
[]:
print
(
module
)
with
pytest
.
raises
(
JavascriptException
)
as
err
:
selenium
.
run
(
f"import scipy.
{
module
}
"
)
assert
(
'ModuleNotFoundError'
in
str
(
err
.
value
)
or
'ImportError'
in
str
(
err
.
value
))
print
(
selenium
.
logs
)
def
test_scipy_linalg
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
.
load_package
(
"scipy"
)
selenium
.
load_package
(
"scipy"
)
cmd
=
dedent
(
r"""
cmd
=
dedent
(
r"""
import numpy as np
import numpy as np
...
@@ -55,37 +29,3 @@ def test_scipy_linalg(selenium_standalone):
...
@@ -55,37 +29,3 @@ def test_scipy_linalg(selenium_standalone):
"""
)
"""
)
selenium
.
run
(
cmd
)
selenium
.
run
(
cmd
)
print
(
selenium
.
logs
)
@
pytest
.
mark
.
skip
def
test_built_so
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
.
load_package
(
"numpy"
)
selenium
.
load_package
(
"scipy"
)
cmd
=
dedent
(
r"""
import scipy as sp
import os
base_dir = os.path.dirname(sp.__file__)
out = []
for (dirpath, dirnames, filenames) in os.walk(base_dir):
for path in filenames:
if path.endswith('.so'):
rel_path = os.path.relpath(dirpath, base_dir)
out.append(os.path.join(rel_path, path))
print("\n".join(out))
out
"""
)
def
_get_modules_name
(
modules
):
return
set
([
path
.
split
(
'.'
)[
0
]
for
path
in
modules
if
path
])
modules_target
=
selenium
.
run
(
cmd
)
modules_target
=
_get_modules_name
(
modules_target
)
print
(
f'Included modules:
{
len
(
modules_target
)
}
'
)
print
(
f'
{
modules_target
}
'
)
test/test_common.py
View file @
d6bc94ef
...
@@ -23,7 +23,7 @@ def registered_packages_meta():
...
@@ -23,7 +23,7 @@ def registered_packages_meta():
for
name
in
packages
}
for
name
in
packages
}
UNSUPPORTED_PACKAGES
=
{
'chrome'
:
[
'pandas'
],
UNSUPPORTED_PACKAGES
=
{
'chrome'
:
[
'pandas'
,
'scipy'
],
'firefox'
:
[]}
'firefox'
:
[]}
...
@@ -72,10 +72,15 @@ def test_import(name, selenium_standalone):
...
@@ -72,10 +72,15 @@ def test_import(name, selenium_standalone):
"""
"""
)
==
baseline_pyc
)
==
baseline_pyc
loaded_packages
=
[]
for
import_name
in
meta
.
get
(
'test'
,
{}).
get
(
'imports'
,
[]):
for
import_name
in
meta
.
get
(
'test'
,
{}).
get
(
'imports'
,
[]):
if
name
not
in
loaded_packages
:
selenium_standalone
.
load_package
(
name
)
loaded_packages
.
append
(
name
)
try
:
try
:
selenium_standalone
.
run
(
'import %s'
%
import_name
)
selenium_standalone
.
run
(
'import %s'
%
import_name
)
except
Exception
as
e
:
except
Exception
:
print
(
selenium_standalone
.
logs
)
print
(
selenium_standalone
.
logs
)
raise
raise
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment