Skip to content
Snippets Groups Projects
Commit c88a578e authored by Alexander Blinne's avatar Alexander Blinne
Browse files

Fix wrapping for methods in python2

parent 0405b694
Branches
Tags
No related merge requests found
......@@ -41,7 +41,8 @@ o o o o o o grid_node (coordinates of grid cell boundaries)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import sys
import collections
import copy
import warnings
......@@ -56,6 +57,12 @@ import scipy.signal as sps
import numexpr as ne
from ._compat import tukey, meshgrid, broadcast_to, NDArrayOperatorsMixin
from . import helper
if sys.version[0] == '2':
import functools32 as functools
else:
import functools
try:
import psutil
......@@ -100,7 +107,6 @@ try:
except ImportError:
unwrap_phase = None
from . import helper
__all__ = ['Field', 'Axis']
......@@ -303,7 +309,6 @@ def _reducing_numpy_method(method):
This function produces methods that are suitable for the `Field` class
that reproduce the behaviour of the corresponding numpy `method`
"""
@functools.wraps(getattr(np.ndarray, method))
def new_method(self, axis=None, out=None, keepdims=None, **kwargs):
# we need to interpret the axis object and create an iterable axisiter
......
......@@ -38,7 +38,7 @@ setup(name='postpic',
license='GPLv3+',
setup_requires=['cython>=0.18'],
install_requires=['matplotlib', 'numpy>=1.8', 'scipy', 'future', 'urllib3', 'numexpr',
'cython>=0.18'],
'cython>=0.18', 'functools32;python_version<"3.0"'],
extras_require = {
'h5 reader for openPMD support': ['h5py'],
'sdf support for EPOCH reader': ['sdf']},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment