Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only support Python >= 3.5 #43

Merged
merged 16 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to **GSTools** will be documented in this file.
### Enhancements

### Changes
- Python versions 2.7 and 3.4 are no longer supported #40 #43

### Bugfixes

Expand Down
2 changes: 0 additions & 2 deletions gstools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
vario_estimate_unstructured
"""

from __future__ import absolute_import

import sys

from gstools._version import __version__
Expand Down
1 change: 0 additions & 1 deletion gstools/covmodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
TPLExponential
TPLStable
"""
from __future__ import absolute_import

from gstools.covmodel.base import CovModel
from gstools.covmodel.models import (
Expand Down
4 changes: 1 addition & 3 deletions gstools/covmodel/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
CovModel
"""
# pylint: disable=C0103, R0201
from __future__ import print_function, division, absolute_import

import six
import numpy as np
from scipy.integrate import quad as integral
from scipy.optimize import curve_fit, root
Expand Down Expand Up @@ -41,7 +39,7 @@
# The CovModel Base-Class #####################################################


class CovModel(six.with_metaclass(InitSubclassMeta)):
class CovModel(metaclass=InitSubclassMeta):
r"""Base class for the GSTools covariance models.

Parameters
Expand Down
1 change: 0 additions & 1 deletion gstools/covmodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
Intersection
"""
# pylint: disable=C0103, E1101, E1137
from __future__ import print_function, division, absolute_import

import warnings
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion gstools/covmodel/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
plot_spectral_rad_pdf
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import
import numpy as np

import gstools
Expand Down
3 changes: 1 addition & 2 deletions gstools/covmodel/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
exp_int
inc_beta
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import

# pylint: disable=C0103
import numpy as np
from scipy import special as sps

Expand Down
1 change: 0 additions & 1 deletion gstools/covmodel/tpl_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
TPLStable
"""
# pylint: disable=C0103, E1101
from __future__ import print_function, division, absolute_import

import warnings
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion gstools/field/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

----
"""
from __future__ import absolute_import

from gstools.field.srf import SRF

Expand Down
3 changes: 1 addition & 2 deletions gstools/field/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Field
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function

from functools import partial

Expand All @@ -23,7 +22,7 @@
__all__ = ["Field"]


class Field(object):
class Field:
"""A field base class for random and kriging fields ect.

Parameters
Expand Down
7 changes: 2 additions & 5 deletions gstools/field/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
IncomprRandMeth
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function

from copy import deepcopy as dcp
import numpy as np
Expand All @@ -27,7 +26,7 @@
__all__ = ["RandMeth", "IncomprRandMeth"]


class RandMeth(object):
class RandMeth:
r"""Randomization method for calculating isotropic spatial random fields.

Parameters
Expand Down Expand Up @@ -363,9 +362,7 @@ def __init__(
"Only 2- and 3-dimensional incompressible fields "
+ "can be generated."
)
super(IncomprRandMeth, self).__init__(
model, mode_no, seed, verbose, **kwargs
)
super().__init__(model, mode_no, seed, verbose, **kwargs)

self.mean_u = mean_velocity
self._value_type = "vector"
Expand Down
1 change: 0 additions & 1 deletion gstools/field/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
plot_vec_field
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import
import numpy as np
from scipy import interpolate as inter
import matplotlib.pyplot as plt
Expand Down
3 changes: 1 addition & 2 deletions gstools/field/srf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
SRF
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function

import numpy as np
from gstools.field.generator import RandMeth, IncomprRandMeth
Expand Down Expand Up @@ -90,7 +89,7 @@ def __init__(
generator="RandMeth",
**generator_kwargs
):
super(SRF, self).__init__(model, mean)
super().__init__(model, mean)
# initialize private attributes
self._generator = None
self._upscaling = None
Expand Down
1 change: 0 additions & 1 deletion gstools/field/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
reshape_field_from_unstruct_to_struct
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import

import numpy as np
from gstools.tools.geometric import r3d_x, r3d_y, r3d_z
Expand Down
1 change: 0 additions & 1 deletion gstools/field/upscaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
var_coarse_graining
var_no_scaling
"""
from __future__ import print_function, division, absolute_import

import warnings
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion gstools/krige/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

----
"""
from __future__ import absolute_import
from gstools.krige.simple import Simple
from gstools.krige.ordinary import Ordinary

Expand Down
3 changes: 1 addition & 2 deletions gstools/krige/ordinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Ordinary
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function

import numpy as np
from scipy.linalg import inv
Expand Down Expand Up @@ -46,7 +45,7 @@ class Ordinary(Field):
"""

def __init__(self, model, cond_pos, cond_val):
super(Ordinary, self).__init__(model, mean=0.0)
super().__init__(model, mean=0.0)
self.krige_var = None
# initialize private attributes
self._value_type = "scalar"
Expand Down
4 changes: 1 addition & 3 deletions gstools/krige/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
Simple
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function


import numpy as np
from scipy.linalg import inv
Expand Down Expand Up @@ -49,7 +47,7 @@ class Simple(Field):
"""

def __init__(self, model, mean, cond_pos, cond_val):
super(Simple, self).__init__(model, mean)
super().__init__(model, mean)
self.krige_var = None
# initialize private attributes
self._value_type = "scalar"
Expand Down
1 change: 0 additions & 1 deletion gstools/krige/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
set_condition
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import

import numpy as np
from gstools.tools.geometric import pos2xyz, xyz2pos
Expand Down
1 change: 0 additions & 1 deletion gstools/random/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

----
"""
from __future__ import absolute_import

from gstools.random.rng import RNG
from gstools.random.tools import MasterRNG, dist_gen
Expand Down
3 changes: 1 addition & 2 deletions gstools/random/rng.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
RNG
"""
# pylint: disable=no-member
from __future__ import division, absolute_import, print_function

import numpy as np
import numpy.random as rand
Expand All @@ -21,7 +20,7 @@
__all__ = ["RNG"]


class RNG(object):
class RNG:
"""
A random number generator for different distributions and multiple streams.

Expand Down
15 changes: 7 additions & 8 deletions gstools/random/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
MasterRNG
dist_gen
"""
from __future__ import division, absolute_import, print_function

from scipy.stats import rv_continuous
import numpy.random as rand

__all__ = ["MasterRNG", "dist_gen"]


class MasterRNG(object):
class MasterRNG:
"""Master random number generator for generating seeds.

Parameters
Expand Down Expand Up @@ -108,7 +107,7 @@ class DistPdf(rv_continuous):

def __init__(self, pdf_in, **kwargs):
self.pdf_in = pdf_in
super(DistPdf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _pdf(self, x, *args):
return self.pdf_in(x)
Expand All @@ -119,7 +118,7 @@ class DistCdf(rv_continuous):

def __init__(self, cdf_in, **kwargs):
self.cdf_in = cdf_in
super(DistCdf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _cdf(self, x, *args):
return self.cdf_in(x)
Expand All @@ -131,7 +130,7 @@ class DistPdfCdf(rv_continuous):
def __init__(self, pdf_in, cdf_in, **kwargs):
self.pdf_in = pdf_in
self.cdf_in = cdf_in
super(DistPdfCdf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _pdf(self, x, *args):
return self.pdf_in(x)
Expand All @@ -146,7 +145,7 @@ class DistPdfPpf(rv_continuous):
def __init__(self, pdf_in, ppf_in, **kwargs):
self.pdf_in = pdf_in
self.ppf_in = ppf_in
super(DistPdfPpf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _pdf(self, x, *args):
return self.pdf_in(x)
Expand All @@ -161,7 +160,7 @@ class DistCdfPpf(rv_continuous):
def __init__(self, cdf_in, ppf_in, **kwargs):
self.cdf_in = cdf_in
self.ppf_in = ppf_in
super(DistCdfPpf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _cdf(self, x, *args):
return self.cdf_in(x)
Expand All @@ -177,7 +176,7 @@ def __init__(self, pdf_in, cdf_in, ppf_in, **kwargs):
self.pdf_in = pdf_in
self.cdf_in = cdf_in
self.ppf_in = ppf_in
super(DistPdfCdfPpf, self).__init__(**kwargs)
super().__init__(**kwargs)

def _pdf(self, x, *args):
return self.pdf_in(x)
Expand Down
1 change: 0 additions & 1 deletion gstools/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

----
"""
from __future__ import absolute_import

from gstools.tools.export import (
vtk_export_structured,
Expand Down
1 change: 0 additions & 1 deletion gstools/tools/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
vtk_export
"""
# pylint: disable=C0103, E1101
from __future__ import print_function, division, absolute_import

import numpy as np
from pyevtk.hl import gridToVTK, pointsToVTK
Expand Down
1 change: 0 additions & 1 deletion gstools/tools/geometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
xyz2pos
"""
# pylint: disable=C0103
from __future__ import print_function, division, absolute_import

import numpy as np

Expand Down
1 change: 0 additions & 1 deletion gstools/tools/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
tplstable_cor
"""
# pylint: disable=C0103, E1101
from __future__ import print_function, division, absolute_import

import numpy as np
from scipy import special as sps
Expand Down
1 change: 0 additions & 1 deletion gstools/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

----
"""
from __future__ import absolute_import

from gstools.transform.field import (
binary,
Expand Down
1 change: 0 additions & 1 deletion gstools/transform/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
normal_to_uquad
"""
# pylint: disable=C0103, E1101
from __future__ import print_function, division, absolute_import

from warnings import warn

Expand Down
1 change: 0 additions & 1 deletion gstools/variogram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

----
"""
from __future__ import absolute_import

from gstools.variogram.variogram import (
vario_estimate_structured,
Expand Down
1 change: 0 additions & 1 deletion gstools/variogram/variogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
vario_estimate_structured
"""
# pylint: disable=C0103
from __future__ import division, absolute_import, print_function

import numpy as np

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ scipy>=1.1.0
hankel>=0.3.6
emcee>=3.0.0
pyevtk
six
Loading