From 02d72241778b6c7d40140ef8cba91ea93297ceb7 Mon Sep 17 00:00:00 2001 From: Andrey Bychkov Date: Tue, 3 Mar 2020 16:37:46 +0300 Subject: [PATCH] port --- pygsl/pygsl/_block.py | 4 +-- pygsl/pygsl/_callback.py | 4 +-- pygsl/pygsl/_poly.py | 4 +-- pygsl/pygsl/block.py | 6 ++-- pygsl/pygsl/bspline.py | 4 +-- pygsl/pygsl/gslwrap.py | 46 ++++++++++++++--------------- pygsl/pygsl/hankel.py | 4 +-- pygsl/pygsl/interpolation2d_wrap.py | 4 +-- pygsl/pygsl/linalg.py | 2 +- pygsl/pygsl/multifit_robust.py | 4 +-- pygsl/pygsl/odeiv2.py | 4 +-- pygsl/pygsl/statistics/__init__.py | 2 +- pygsl/pygsl/sum.py | 4 +-- pygsl/pygsl/testing/complex.py | 2 +- 14 files changed, 47 insertions(+), 47 deletions(-) diff --git a/pygsl/pygsl/_block.py b/pygsl/pygsl/_block.py index 2dd1a01..b4b1206 100644 --- a/pygsl/pygsl/_block.py +++ b/pygsl/pygsl/_block.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/_callback.py b/pygsl/pygsl/_callback.py index 9e836ee..9b8d853 100644 --- a/pygsl/pygsl/_callback.py +++ b/pygsl/pygsl/_callback.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/_poly.py b/pygsl/pygsl/_poly.py index 7856395..5c06815 100644 --- a/pygsl/pygsl/_poly.py +++ b/pygsl/pygsl/_poly.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/block.py b/pygsl/pygsl/block.py index 3c02bd1..9c1eb39 100644 --- a/pygsl/pygsl/block.py +++ b/pygsl/pygsl/block.py @@ -36,7 +36,7 @@ class _generic: input: file, size of the vector output: flag, the vector """ - return apply(self._fread, args) + return self._fread(*args) def fwrite(self, *args): """ @@ -44,7 +44,7 @@ class _generic: input: file, vector output: flag if sucessful """ - return apply(self._fwrite , args) + return self._fwrite(*args) def fscanf(self, *args): """ @@ -52,7 +52,7 @@ class _generic: input: file, length of the vector to be read output: flag, the vector """ - return apply(self._fscanf , args) + return self._fscanf(*args) def fprintf(self, file, vector, format): """ diff --git a/pygsl/pygsl/bspline.py b/pygsl/pygsl/bspline.py index 4f10fa8..82381e2 100644 --- a/pygsl/pygsl/bspline.py +++ b/pygsl/pygsl/bspline.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/gslwrap.py b/pygsl/pygsl/gslwrap.py index 0bc9273..61b26d9 100644 --- a/pygsl/pygsl/gslwrap.py +++ b/pygsl/pygsl/gslwrap.py @@ -46,7 +46,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -83,14 +83,14 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 -except __builtin__.Exception: +except builtins.Exception: class _object: pass _newclass = 0 @@ -122,7 +122,7 @@ class Permutation(_object): this = _gslwrap.new_Permutation(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_Permutation __del__ = lambda self: None @@ -200,7 +200,7 @@ class Permutation(_object): return _gslwrap.Permutation_reverse(self) - def next(self): + def __next__(self): """ next(Permutation self) -> int @@ -2514,7 +2514,7 @@ class Combination(_object): this = _gslwrap.new_Combination(n, k) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_Combination __del__ = lambda self: None @@ -2549,7 +2549,7 @@ class Combination(_object): return _gslwrap.Combination_valid(self) - def next(self): + def __next__(self): """next(Combination self) -> int""" return _gslwrap.Combination_next(self) @@ -3119,7 +3119,7 @@ class gsl_eigen_symm_workspace(_object): this = _gslwrap.new_gsl_eigen_symm_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_symm_workspace __del__ = lambda self: None @@ -3161,7 +3161,7 @@ class gsl_eigen_symmv_workspace(_object): this = _gslwrap.new_gsl_eigen_symmv_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_symmv_workspace __del__ = lambda self: None @@ -3209,7 +3209,7 @@ class gsl_eigen_herm_workspace(_object): this = _gslwrap.new_gsl_eigen_herm_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_herm_workspace __del__ = lambda self: None @@ -3254,7 +3254,7 @@ class gsl_eigen_hermv_workspace(_object): this = _gslwrap.new_gsl_eigen_hermv_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_hermv_workspace __del__ = lambda self: None @@ -3305,7 +3305,7 @@ class gsl_eigen_francis_workspace(_object): this = _gslwrap.new_gsl_eigen_francis_workspace() try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_francis_workspace __del__ = lambda self: None @@ -3367,7 +3367,7 @@ class gsl_eigen_nonsymm_workspace(_object): this = _gslwrap.new_gsl_eigen_nonsymm_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_nonsymm_workspace __del__ = lambda self: None @@ -3452,7 +3452,7 @@ class gsl_eigen_nonsymmv_workspace(_object): this = _gslwrap.new_gsl_eigen_nonsymmv_workspace() try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_nonsymmv_workspace __del__ = lambda self: None @@ -3495,7 +3495,7 @@ class gsl_eigen_gensymm_workspace(_object): this = _gslwrap.new_gsl_eigen_gensymm_workspace() try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_gensymm_workspace __del__ = lambda self: None @@ -3538,7 +3538,7 @@ class gsl_eigen_gensymmv_workspace(_object): this = _gslwrap.new_gsl_eigen_gensymmv_workspace() try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_gensymmv_workspace __del__ = lambda self: None @@ -3571,7 +3571,7 @@ class gsl_eigen_genherm_workspace(_object): this = _gslwrap.new_gsl_eigen_genherm_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_genherm_workspace __del__ = lambda self: None @@ -3614,7 +3614,7 @@ class gsl_eigen_genhermv_workspace(_object): this = _gslwrap.new_gsl_eigen_genhermv_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_genhermv_workspace __del__ = lambda self: None @@ -3653,7 +3653,7 @@ class gsl_eigen_gen_workspace(_object): this = _gslwrap.new_gsl_eigen_gen_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_gen_workspace __del__ = lambda self: None @@ -3745,7 +3745,7 @@ class gsl_eigen_genv_workspace(_object): this = _gslwrap.new_gsl_eigen_genv_workspace(n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_eigen_genv_workspace __del__ = lambda self: None @@ -3860,7 +3860,7 @@ class gsl_interp_accel(_object): this = _gslwrap.new_gsl_interp_accel() try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_gsl_interp_accel __del__ = lambda self: None @@ -3896,7 +3896,7 @@ class pygsl_spline(_object): this = _gslwrap.new_pygsl_spline(T, n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_pygsl_spline __del__ = lambda self: None @@ -4027,7 +4027,7 @@ class pygsl_interp(_object): this = _gslwrap.new_pygsl_interp(T, n) try: self.this.append(this) - except __builtin__.Exception: + except builtins.Exception: self.this = this __swig_destroy__ = _gslwrap.delete_pygsl_interp __del__ = lambda self: None diff --git a/pygsl/pygsl/hankel.py b/pygsl/pygsl/hankel.py index 1199032..fd42768 100644 --- a/pygsl/pygsl/hankel.py +++ b/pygsl/pygsl/hankel.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/interpolation2d_wrap.py b/pygsl/pygsl/interpolation2d_wrap.py index f231c16..457c48a 100644 --- a/pygsl/pygsl/interpolation2d_wrap.py +++ b/pygsl/pygsl/interpolation2d_wrap.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/linalg.py b/pygsl/pygsl/linalg.py index 296910d..beb0d04 100644 --- a/pygsl/pygsl/linalg.py +++ b/pygsl/pygsl/linalg.py @@ -11,7 +11,7 @@ routines found in LAPACK. The Fortran version of LAPACK is recommended as the standard package for linear algebra. It supports blocked algorithms, specialized data representations and other optimizations. """ -from __future__ import print_function + import pygsl from . import _gslwrap from .permutation import Permutation diff --git a/pygsl/pygsl/multifit_robust.py b/pygsl/pygsl/multifit_robust.py index 430283b..4697e96 100644 --- a/pygsl/pygsl/multifit_robust.py +++ b/pygsl/pygsl/multifit_robust.py @@ -57,7 +57,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -91,7 +91,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/odeiv2.py b/pygsl/pygsl/odeiv2.py index c2d9c76..6082aa2 100644 --- a/pygsl/pygsl/odeiv2.py +++ b/pygsl/pygsl/odeiv2.py @@ -60,7 +60,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -94,7 +94,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/statistics/__init__.py b/pygsl/pygsl/statistics/__init__.py index adccf09..a3976cb 100644 --- a/pygsl/pygsl/statistics/__init__.py +++ b/pygsl/pygsl/statistics/__init__.py @@ -5,7 +5,7 @@ from pygsl.statistics.double import * -__all__ = filter(lambda s:s[0:2]!="__" or s=="double",dir()) +__all__ = [s for s in dir() if s[0:2]!="__" or s=="double"] diff --git a/pygsl/pygsl/sum.py b/pygsl/pygsl/sum.py index 2659fe0..a359331 100644 --- a/pygsl/pygsl/sum.py +++ b/pygsl/pygsl/sum.py @@ -69,7 +69,7 @@ except NameError: try: import builtins as __builtin__ except ImportError: - import __builtin__ + import builtins def _swig_setattr_nondynamic(self, class_type, name, value, static=1): if (name == "thisown"): @@ -103,7 +103,7 @@ def _swig_getattr(self, class_type, name): def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: + except builtins.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) diff --git a/pygsl/pygsl/testing/complex.py b/pygsl/pygsl/testing/complex.py index fc19caf..04b353d 100644 --- a/pygsl/pygsl/testing/complex.py +++ b/pygsl/pygsl/testing/complex.py @@ -1,4 +1,4 @@ -from __future__ import print_function + from . import _ufuncs _token = "complex_" _tokl = len(_token) -- 2.24.1