Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Eunjong Kim
kwant
Commits
5b42232b
Commit
5b42232b
authored
Feb 27, 2016
by
Anton Akhmerov
Browse files
bump mpl version
parent
b6cb7dd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
INSTALL.rst
View file @
5b42232b
...
...
@@ -32,7 +32,7 @@ Building Kwant requires
C++.
The following software is highly recommended though not strictly required:
* `matplotlib <http://matplotlib.sourceforge.net/>`_ 1.
1
or newer, for Kwant's
* `matplotlib <http://matplotlib.sourceforge.net/>`_ 1.
5
or newer, for Kwant's
plotting module and the tutorial,
* `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
that will in many cases speed up Kwant several times and reduce the memory
...
...
kwant/plotter.py
View file @
5b42232b
...
...
@@ -48,24 +48,6 @@ __all__ = ['plot', 'map', 'bands', 'sys_leads_sites', 'sys_leads_hoppings',
'sys_leads_pos'
,
'sys_leads_hopping_pos'
,
'mask_interpolate'
]
# TODO: Remove the following once we depend on matplotlib >= 1.4.1.
def
matplotlib_chores
():
global
pre_1_4_matplotlib
ver
=
matplotlib
.
__version__
if
ver
==
"1.4.0"
:
warnings
.
warn
(
"Matplotlib 1.4.0 has a bug that makes 3D plotting "
"unusable (2D plotting is not affected). Please "
"consider using a different version of matplotlib."
,
RuntimeWarning
)
pre_1_4_matplotlib
=
[
int
(
x
)
for
x
in
ver
.
split
(
'.'
)[:
2
]]
<
[
1
,
4
]
if
mpl_enabled
:
matplotlib_chores
()
# Collections that allow for symbols and linewiths to be given in data space
# (not for general use, only implement what's needed for plotter)
def
isarray
(
var
):
...
...
@@ -109,13 +91,9 @@ if mpl_enabled:
self
.
reflen
=
reflen
self
.
linewidths_orig
=
nparray_if_array
(
self
.
get_linewidths
())
if
pre_1_4_matplotlib
:
self
.
transforms
=
[
matplotlib
.
transforms
.
Affine2D
().
scale
(
x
)
for
x
in
sizes
]
else
:
self
.
transforms
=
np
.
array
(
[
matplotlib
.
transforms
.
Affine2D
().
scale
(
x
).
get_matrix
()
for
x
in
sizes
])
self
.
transforms
=
np
.
array
(
[
matplotlib
.
transforms
.
Affine2D
().
scale
(
x
).
get_matrix
()
for
x
in
sizes
])
def
get_transforms
(
self
):
return
self
.
transforms
...
...
@@ -236,12 +214,8 @@ if mpl_enabled:
self
.
edgecolors_orig
=
nparray_if_array
(
self
.
get_edgecolors
())
Affine2D
=
matplotlib
.
transforms
.
Affine2D
if
pre_1_4_matplotlib
:
self
.
orig_transforms
=
np
.
array
(
[
Affine2D
().
scale
(
x
)
for
x
in
sizes
],
dtype
=
'object'
)
else
:
self
.
orig_transforms
=
np
.
array
(
[
Affine2D
().
scale
(
x
).
get_matrix
()
for
x
in
sizes
])
self
.
orig_transforms
=
np
.
array
(
[
Affine2D
().
scale
(
x
).
get_matrix
()
for
x
in
sizes
])
self
.
transforms
=
self
.
orig_transforms
def
set_array
(
self
,
array
):
...
...
setup.py
View file @
5b42232b
...
...
@@ -489,7 +489,7 @@ def main():
include_dirs
=
include_dirs
,
setup_requires
=
[
'numpy > 1.6.1'
,
'nose >= 1.0'
],
install_requires
=
[
'numpy > 1.6.1'
,
'scipy >= 0.9'
,
'tinyarray'
],
extras_require
=
{
'plotting'
:
'matplotlib >= 1.
2
'
},
extras_require
=
{
'plotting'
:
'matplotlib >= 1.
5
'
},
classifiers
=
[
c
.
strip
()
for
c
in
CLASSIFIERS
.
split
(
'
\n
'
)])
if
__name__
==
'__main__'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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