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

Drop Python 3.5 support and update CI #146

Merged
merged 17 commits into from
Mar 26, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
covmodel: use f-strings; add trailing commas for **kwargs
  • Loading branch information
MuellerSeb committed Mar 23, 2021
commit e619ca1f428aa9d982b0b0c8e69d3049490a4959
28 changes: 11 additions & 17 deletions gstools/covmodel/base.py
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ def __init__(
latlon=False,
var_raw=None,
hankel_kw=None,
**opt_arg
**opt_arg,
):
# assert, that we use a subclass
# this is the case, if __init_subclass__ is called, which creates
@@ -210,12 +210,8 @@ def __init_subclass__(cls):

# modify the docstrings: class docstring gets attributes added
if cls.__doc__ is None:
cls.__doc__ = (
"User defined GSTools Covariance-Model."
+ CovModel.__doc__[45:]
)
else:
cls.__doc__ += CovModel.__doc__[45:]
cls.__doc__ = "User defined GSTools Covariance-Model."
cls.__doc__ += CovModel.__doc__[45:]
# overridden functions get standard doc if no new doc was created
ignore = ["__", "variogram", "covariance", "cor"]
for attr in cls.__dict__:
@@ -571,7 +567,7 @@ def fit_variogram(
max_eval=None,
return_r2=False,
curve_fit_kwargs=None,
**para_select
**para_select,
):
"""
Fiting the variogram-model to an empirical variogram.
@@ -714,7 +710,7 @@ def fit_variogram(
max_eval=max_eval,
return_r2=return_r2,
curve_fit_kwargs=curve_fit_kwargs,
**para_select
**para_select,
)

# bounds setting and checks
@@ -771,7 +767,7 @@ def var_bounds(self):
def var_bounds(self, bounds):
if not check_bounds(bounds):
raise ValueError(
"Given bounds for 'var' are not valid, got: " + str(bounds)
f"Given bounds for 'var' are not valid, got: {bounds}"
)
self._var_bounds = bounds

@@ -791,8 +787,7 @@ def len_scale_bounds(self):
def len_scale_bounds(self, bounds):
if not check_bounds(bounds):
raise ValueError(
"Given bounds for 'len_scale' are not valid, got: "
+ str(bounds)
f"Given bounds for 'len_scale' are not valid, got: {bounds}"
)
self._len_scale_bounds = bounds

@@ -812,7 +807,7 @@ def nugget_bounds(self):
def nugget_bounds(self, bounds):
if not check_bounds(bounds):
raise ValueError(
"Given bounds for 'nugget' are not valid, got: " + str(bounds)
f"Given bounds for 'nugget' are not valid, got: {bounds}"
)
self._nugget_bounds = bounds

@@ -832,7 +827,7 @@ def anis_bounds(self):
def anis_bounds(self, bounds):
if not check_bounds(bounds):
raise ValueError(
"Given bounds for 'anis' are not valid, got: " + str(bounds)
f"Given bounds for 'anis' are not valid, got: {bounds}"
)
self._anis_bounds = bounds

@@ -1001,9 +996,8 @@ def integral_scale(self, integral_scale):
self.len_scale = integral_scale / int_tmp
if not np.isclose(self.integral_scale, integral_scale, rtol=1e-3):
raise ValueError(
self.name
+ ": Integral scale could not be set correctly!"
+ " Please just give a len_scale!"
f"{self.name}: Integral scale could not be set correctly! "
"Please just provide a 'len_scale'!"
)

@property