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
3747c6db
Commit
3747c6db
authored
Oct 25, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch mmap
parent
7358049b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
122 deletions
+44
-122
packages/scipy/meta.yaml
packages/scipy/meta.yaml
+1
-0
packages/scipy/patches/skip-blas-imports.patch
packages/scipy/patches/skip-blas-imports.patch
+0
-104
packages/scipy/patches/skip-fortran-fails-to-link.patch
packages/scipy/patches/skip-fortran-fails-to-link.patch
+17
-3
test/packages/test_scipy.py
test/packages/test_scipy.py
+26
-15
No files found.
packages/scipy/meta.yaml
View file @
3747c6db
...
@@ -23,6 +23,7 @@ source:
...
@@ -23,6 +23,7 @@ source:
-
patches/dummy_threading.patch
-
patches/dummy_threading.patch
-
patches/skip_ellip_harm_2_pyx_ctypes.patch
-
patches/skip_ellip_harm_2_pyx_ctypes.patch
-
patches/skip_optimize_cobyla_import.patch
-
patches/skip_optimize_cobyla_import.patch
-
patches/fix_mmap.patch
build
:
build
:
cflags
:
-I../../CLAPACK-WA/INCLUDE -Wno-implicit-function-declaration
cflags
:
-I../../CLAPACK-WA/INCLUDE -Wno-implicit-function-declaration
...
...
packages/scipy/patches/skip-blas-imports.patch
deleted
100644 → 0
View file @
7358049b
commit 3f9694b956a2c900f92b635e28ea0eed4baed2fa
Author: Roman Yurchak <rth.yurchak@pm.me>
Date: Fri Oct 19 17:16:05 2018 +0200
Workaround for missing BLAS/LAPACK imports
diff --git a/scipy/linalg/blas.py b/scipy/linalg/blas.py
index e4bd57aa4..b88d2f7ea 100644
--- a/scipy/linalg/blas.py
+++ b/scipy/linalg/blas.py
@@ -152,7 +152,10 @@
__all__ = ['get_blas_funcs', 'find_best_blas_type']
import numpy as _np
-from scipy.linalg import _fblas
+try:
+ from scipy.linalg import _fblas
+except ImportError:
+ _fblas = None
try:
from scipy.linalg import _cblas
except ImportError:
@@ -160,7 +163,10 @@
except ImportError:
# Expose all functions (only fblas --- cblas is an implementation detail)
empty_module = None
-from scipy.linalg._fblas import *
+try:
+ from scipy.linalg._fblas import *
+except ImportError:
+ pass
del empty_module
# 'd' will be default for 'i',..
diff --git a/scipy/linalg/lapack.py b/scipy/linalg/lapack.py
index bc712c4ea..29d59085d 100644
--- a/scipy/linalg/lapack.py
+++ b/scipy/linalg/lapack.py
@@ -359,7 +359,10 @@
from .blas import _get_funcs
# Backward compatibility:
from .blas import find_best_blas_type as find_best_lapack_type
-from scipy.linalg import _flapack
+try:
+ from scipy.linalg import _flapack
+except ImportError:
+ _flapack = None
try:
from scipy.linalg import _clapack
except ImportError:
@@ -367,12 +370,18 @@
except ImportError:
# Backward compatibility
from scipy._lib._util import DeprecatedImport as _DeprecatedImport
-clapack = _DeprecatedImport("scipy.linalg.blas.clapack", "scipy.linalg.lapack")
-flapack = _DeprecatedImport("scipy.linalg.blas.flapack", "scipy.linalg.lapack")
+try:
+ clapack = _DeprecatedImport("scipy.linalg.blas.clapack", "scipy.linalg.lapack")
+ flapack = _DeprecatedImport("scipy.linalg.blas.flapack", "scipy.linalg.lapack")
+except ImportError:
+ pass
# Expose all functions (only flapack --- clapack is an implementation detail)
empty_module = None
-from scipy.linalg._flapack import *
+try:
+ from scipy.linalg._flapack import *
+except ImportError:
+ pass
del empty_module
_dep_message = """The `*gegv` family of routines has been deprecated in
@@ -380,17 +389,20 @@
LAPACK 3.6.0 in favor of the `*ggev` family of routines.
The corresponding wrappers will be removed from SciPy in
a future release."""
-cgegv = _np.deprecate(cgegv, old_name='cgegv', message=_dep_message)
-dgegv = _np.deprecate(dgegv, old_name='dgegv', message=_dep_message)
-sgegv = _np.deprecate(sgegv, old_name='sgegv', message=_dep_message)
-zgegv = _np.deprecate(zgegv, old_name='zgegv', message=_dep_message)
-
-# Modyfy _flapack in this scope so the deprecation warnings apply to
-# functions returned by get_lapack_funcs.
-_flapack.cgegv = cgegv
-_flapack.dgegv = dgegv
-_flapack.sgegv = sgegv
-_flapack.zgegv = zgegv
+try:
+ cgegv = _np.deprecate(cgegv, old_name='cgegv', message=_dep_message)
+ dgegv = _np.deprecate(dgegv, old_name='dgegv', message=_dep_message)
+ sgegv = _np.deprecate(sgegv, old_name='sgegv', message=_dep_message)
+ zgegv = _np.deprecate(zgegv, old_name='zgegv', message=_dep_message)
+
+ # Modyfy _flapack in this scope so the deprecation warnings apply to
+ # functions returned by get_lapack_funcs.
+ _flapack.cgegv = cgegv
+ _flapack.dgegv = dgegv
+ _flapack.sgegv = sgegv
+ _flapack.zgegv = zgegv
+except Exception:
+ pass
# some convenience alias for complex functions
_lapack_alias = {
packages/scipy/patches/skip-fortran-fails-to-link.patch
View file @
3747c6db
commit
0822e53ae255433469257625e8f292abd13ae562
commit
e85d4402a802160b13e49d34728f4358e5337848
Author: Roman Yurchak <rth.yurchak@pm.me>
Author: Roman Yurchak <rth.yurchak@pm.me>
Date: Thu Oct 11 17:10:36 2018 +0200
Date: Thu Oct 11 17:10:36 2018 +0200
...
@@ -6,8 +6,22 @@ Date: Thu Oct 11 17:10:36 2018 +0200
...
@@ -6,8 +6,22 @@ Date: Thu Oct 11 17:10:36 2018 +0200
scipy.integrate.odepack
scipy.integrate.odepack
diff --git a/scipy/integrate/odepack.py b/scipy/integrate/odepack.py
index eee2b04a3..17224f54e 100644
--- a/scipy/integrate/odepack.py
+++ b/scipy/integrate/odepack.py
@@ -3,7 +3,8 @@
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
-from . import _odepack
+# from . import _odepack
+_odepack = None
from copy import copy
import warnings
diff --git a/scipy/integrate/setup.py b/scipy/integrate/setup.py
diff --git a/scipy/integrate/setup.py b/scipy/integrate/setup.py
index
9d607af8d..2be454c70
100755
index
4725eb1c0..0545dc759
100755
--- a/scipy/integrate/setup.py
--- a/scipy/integrate/setup.py
+++ b/scipy/integrate/setup.py
+++ b/scipy/integrate/setup.py
@@ -27,7 +27,7 @@
def configuration(parent_package='',top_path=None):
@@ -27,7 +27,7 @@
def configuration(parent_package='',top_path=None):
...
@@ -63,7 +77,7 @@ index 9d607af8d..2be454c70 100755
...
@@ -63,7 +77,7 @@ index 9d607af8d..2be454c70 100755
+ # **lapack_opt)
+ # **lapack_opt)
# dop
# dop
config.add_extension('_dop',
#
config.add_extension('_dop',
@@ -76,11 +76,11 @@
def configuration(parent_package='',top_path=None):
@@ -76,11 +76,11 @@
def configuration(parent_package='',top_path=None):
sources=quadpack_test_src)
sources=quadpack_test_src)
...
...
test/packages/test_scipy.py
View file @
3747c6db
from
pathlib
import
Path
import
subprocess
import
sys
from
textwrap
import
dedent
from
textwrap
import
dedent
import
pytest
import
pytest
sys
.
path
.
append
(
str
(
Path
(
__file__
).
parents
[
2
]))
from
pyodide_build.common
import
HOSTPYTHON
# noqa: E402
def
test_scipy_import
(
selenium_standalone
,
request
):
def
test_scipy_import
(
selenium_standalone
,
request
):
from
selenium.common.exceptions
import
JavascriptException
from
selenium.common.exceptions
import
JavascriptException
...
@@ -41,6 +34,32 @@ def test_scipy_import(selenium_standalone, request):
...
@@ -41,6 +34,32 @@ def test_scipy_import(selenium_standalone, request):
print
(
selenium
.
logs
)
print
(
selenium
.
logs
)
def
test_scipy_linalg
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
.
load_package
(
"scipy"
)
cmd
=
dedent
(
r"""
import numpy as np
import scipy as sp
import scipy.linalg
from numpy.testing import assert_allclose
N = 10
X = np.random.RandomState(42).rand(N, N)
X_inv = scipy.linalg.inv(X)
res = X.dot(X_inv)
assert_allclose(res, np.identity(N),
rtol=1e-07, atol=1e-9)
"""
)
selenium
.
run
(
cmd
)
print
(
selenium
.
logs
)
@
pytest
.
mark
.
skip
def
test_built_so
(
selenium_standalone
):
def
test_built_so
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
=
selenium_standalone
selenium
.
load_package
(
"scipy"
)
selenium
.
load_package
(
"scipy"
)
...
@@ -61,19 +80,11 @@ def test_built_so(selenium_standalone):
...
@@ -61,19 +80,11 @@ def test_built_so(selenium_standalone):
out
out
"""
)
"""
)
out
=
subprocess
.
check_output
(
[
HOSTPYTHON
/
'bin'
/
'python3'
,
'-c'
,
cmd
])
modules_host
=
out
.
decode
(
'utf-8'
).
split
(
'
\
n
'
)
def
_get_modules_name
(
modules
):
def
_get_modules_name
(
modules
):
return
set
([
path
.
split
(
'.'
)[
0
]
for
path
in
modules
if
path
])
return
set
([
path
.
split
(
'.'
)[
0
]
for
path
in
modules
if
path
])
modules_host
=
_get_modules_name
(
modules_host
)
modules_target
=
selenium
.
run
(
cmd
)
modules_target
=
selenium
.
run
(
cmd
)
modules_target
=
_get_modules_name
(
modules_target
)
modules_target
=
_get_modules_name
(
modules_target
)
print
(
f'Included modules:
{
len
(
modules_target
)
}
'
)
print
(
f'Included modules:
{
len
(
modules_target
)
}
'
)
print
(
f'
{
modules_target
}
'
)
print
(
f'
{
modules_target
}
'
)
print
(
f'
\
n
Missing modules:
{
len
(
modules_host
.
difference
(
modules_target
))
}
'
)
print
(
f'
{
modules_host
.
difference
(
modules_target
)
}
'
)
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