#6494: sage should *never* ever import numpy by default on startup. Yet again
it
does!
------------------------+---------------------------------------------------
Reporter: was | Owner: mabshoff
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.7.2
Component: packages | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author: Mike Hansen
Merged: | Dependencies:
------------------------+---------------------------------------------------
Changes (by jdemeyer):
* status: needs_review => needs_work
Old description:
> {{{
> .bash-3.2$ ./sage -startuptime |grep numpy
> decorators_numpy: 0.000 (IPython.testing)
> numpy: 0.073 (complex_plot)
> numpy.__config__: 0.000 (numpy)
> version: 0.000 (numpy)
> _import_tools: 0.000 (numpy)
> add_newdocs: 0.047 (numpy)
> numpy.version: 0.000 (lib)
> numpy.core.numeric: 0.018 (type_check)
> multiarray: 0.002 (numpy.core.numeric)
> umath: 0.001 (numpy.core.numeric)
> numpy.core.multiarray: 0.000 (umath)
> _internal: 0.001 (numpy.core.numeric)
> numerictypes: 0.002 (numpy.core.numeric)
> _sort: 0.000 (numpy.core.numeric)
> numeric: 0.004 (numpy.core.numeric)
> defmatrix: 0.001 (numpy.core.numeric)
> defchararray: 0.000 (numpy.core.numeric)
> records: 0.001 (numpy.core.numeric)
> memmap: 0.000 (numpy.core.numeric)
> scalarmath: 0.001 (numpy.core.numeric)
> numpy.core.umath: 0.000 (scalarmath)
> numpy.testing: 0.004 (numpy.core.numeric)
> decorators: 0.000 (numpy.testing)
> utils: 0.003 (numpy.testing)
> numpytest: 0.000 (numpy.testing)
> numpy.core.numerictypes: 0.000 (index_tricks)
> numpy.core.fromnumeric: 0.000 (function_base)
> numpy.lib.shape_base: 0.000 (function_base)
> numpy.lib.twodim_base: 0.000 (function_base)
> numpy.core.defmatrix: 0.000 (index_tricks)
> numpy.lib.type_check: 0.000 (scimath)
> numpy.core: 0.000 (polynomial)
> numpy.lib.getlimits: 0.001 (polynomial)
> machar: 0.000 (numpy.lib.getlimits)
> numpy.lib.function_base: 0.000 (polynomial)
> numpy.linalg: 0.002 (polynomial)
> linalg: 0.001 (numpy.linalg)
> numpy.lib: 0.000 (linalg)
> numpy.lib.utils: 0.000 (format)
> numpy.lib._compiled_base: 0.000 (add_newdocs)
> numpy.lib.index_tricks: 0.000 (add_newdocs)
> testing: 0.000 (numpy)
> core: 0.000 (numpy)
> fft: 0.002 (numpy)
> mtrand: 0.015 (numpy)
> ctypeslib: 0.001 (numpy)
> numpy.core._internal: 0.000 (ctypeslib)
> ma: 0.006 (numpy)
> 0.073 numpy (complex_plot)
> }}}
>
> I think this is because of the new complex_plot module, which I think I
> positively reviewed, so this is my fault. To resolve this ticket, make
> that import sufficiently lazy. Also, make a doctest that verifies that
> numpy is not imported when Sage starts up.
New description:
{{{
$ ./sage -startuptime |grep numpy
decorators_numpy: 0.000 (IPython.testing)
numpy: 0.056 (complex_plot)
numpy.__config__: 0.000 (numpy)
version: 0.000 (numpy)
_import_tools: 0.000 (numpy)
add_newdocs: 0.035 (numpy)
numpy.lib: 0.026 (add_newdocs)
info: 0.000 (numpy.lib)
numpy.version: 0.000 (numpy.lib)
type_check: 0.016 (numpy.lib)
numpy.core.numeric: 0.015 (type_check)
multiarray: 0.001 (numpy.core.numeric)
umath: 0.001 (numpy.core.numeric)
numpy.core.multiarray: 0.000 (umath)
_internal: 0.002 (numpy.core.numeric)
numpy.compat: 0.000 (_internal)
_inspect: 0.000 (numpy.compat)
py3k: 0.000 (numpy.compat)
numerictypes: 0.001 (numpy.core.numeric)
_sort: 0.000 (numpy.core.numeric)
numeric: 0.002 (numpy.core.numeric)
defchararray: 0.001 (numpy.core.numeric)
records: 0.000 (numpy.core.numeric)
memmap: 0.000 (numpy.core.numeric)
scalarmath: 0.000 (numpy.core.numeric)
numpy.core.umath: 0.000 (scalarmath)
function_base: 0.000 (numpy.core.numeric)
machar: 0.000 (numpy.core.numeric)
numpy.core.fromnumeric: 0.000 (machar)
getlimits: 0.000 (numpy.core.numeric)
shape_base: 0.000 (numpy.core.numeric)
numpy.testing: 0.005 (numpy.core.numeric)
numpy.testing.utils: 0.004 (numpy.testing)
nosetester: 0.003 (numpy.testing.utils)
utils: 0.000 (numpy.testing)
numpytest: 0.000 (numpy.testing)
index_tricks: 0.004 (numpy.lib)
numpy.core.numerictypes: 0.000 (index_tricks)
numpy.core: 0.000 (index_tricks)
numpy.lib.twodim_base: 0.000 (index_tricks)
numpy.lib.utils: 0.001 (arraysetops)
numpy.matrixlib: 0.001 (index_tricks)
defmatrix: 0.001 (numpy.matrixlib)
stride_tricks: 0.000 (numpy.lib)
twodim_base: 0.000 (numpy.lib)
scimath: 0.000 (numpy.lib)
numpy.lib.type_check: 0.000 (scimath)
numpy.lib.function_base: 0.000 (numpy.lib)
numpy.linalg: 0.003 (numpy.lib)
linalg: 0.003 (numpy.linalg)
numpy.matrixlib.defmatrix: 0.000 (linalg)
npyio: 0.002 (numpy.lib)
financial: 0.000 (numpy.lib)
arrayterator: 0.000 (numpy.lib)
numpy.lib._compiled_base: 0.000 (add_newdocs)
numpy.lib.index_tricks: 0.000 (add_newdocs)
testing: 0.000 (numpy)
core: 0.000 (numpy)
compat: 0.000 (numpy)
lib: 0.000 (numpy)
fft: 0.001 (numpy)
polyutils: 0.000 (numpy)
polytemplate: 0.000 (numpy)
chebyshev: 0.005 (numpy)
mtrand: 0.002 (numpy)
ctypeslib: 0.001 (numpy)
numpy.core._internal: 0.000 (ctypeslib)
ma: 0.005 (numpy)
matrixlib: 0.000 (numpy)
0.056 numpy (complex_plot)
0.035 add_newdocs (numpy)
}}}
I think this is because of the new complex_plot module, which I think I
positively reviewed, so this is my fault. To resolve this ticket, make
that import sufficiently lazy. Also, make a doctest that verifies that
numpy is not imported when Sage starts up.
--
Comment:
I'm not going to judge whether numpy imports are still an issue or not,
but in any case the patch needs to be rebased:
{{{
patching file sage/calculus/all.py
Hunk #2 succeeded at 16 (offset 1 line).
patching file sage/finance/all.py
patching file sage/interfaces/gnuplot.py
patching file sage/plot/all.py
Hunk #2 FAILED at 21.
1 out of 2 hunks FAILED -- saving rejects to file sage/plot/all.py.rej
patching file sage/plot/plot3d/implicit_plot3d.py
Hunk #2 succeeded at 255 (offset 10 lines).
patching file sage/stats/all.py
patching file sage/stats/hmm/all.py
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6494#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.