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

Remove unnecessary coding, use a few f-strings #283

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# GeoStatTools documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 5 14:20:43 2018.
Expand Down Expand Up @@ -111,7 +110,7 @@ def setup(app):
# General information about the project.
curr_year = datetime.datetime.now().year
project = "GSTools"
copyright = "2018 - {}, Sebastian Müller, Lennart Schüler".format(curr_year)
copyright = f"2018 - {curr_year}, Sebastian Müller, Lennart Schüler"
author = "Sebastian Müller, Lennart Schüler"

# The version info for the project you're documenting, acts as replacement for
Expand Down
2 changes: 1 addition & 1 deletion examples/00_misc/02_check_rand_meth_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def plot_rand_meth_samples(generator):
sample_in = np.sum(rad <= np.max(x))
ax.hist(rad[rad <= np.max(x)], bins=sample_in // 50, density=True)
ax.set_xlim([0, np.max(x)])
ax.set_title("Radius samples shown {}/{}".format(sample_in, len(rad)))
ax.set_title(f"Radius samples shown {sample_in}/{len(rad)}")
ax.legend()
plt.show()

Expand Down
2 changes: 1 addition & 1 deletion examples/01_random_field/00_gaussian.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
A Very Simple Example
---------------------

Expand Down
4 changes: 2 additions & 2 deletions examples/01_random_field/05_mesh_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
# You can specify the field name by the keyword `name`.

for i in range(fields_no):
srf.mesh(mesh, points="centroids", name="c-field-{}".format(i), seed=i)
srf.mesh(mesh, points="centroids", name=f"c-field-{i}", seed=i)

###############################################################################
# Now we generate fields on the mesh-points again controlled by a seed.

for i in range(fields_no):
srf.mesh(mesh, points="points", name="p-field-{}".format(i), seed=i)
srf.mesh(mesh, points="points", name=f"p-field-{i}", seed=i)

###############################################################################
# To get an impression we now want to plot the generated fields.
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""GSTools: A geostatistical toolbox."""
import os

Expand Down
1 change: 0 additions & 1 deletion src/gstools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Purpose
=======
Expand Down
1 change: 0 additions & 1 deletion src/gstools/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing global variables.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a set of handy covariance models.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing the base class for covariance models.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/fit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for the covariance-model.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing different covariance models.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing plotting routines for the covariance models.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for the covariance-model.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/covmodel/tpl_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing truncated power law covariance models.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for spatial random fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a base class for spatial fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/cond_srf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a class for conditioned spatial random fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing generators for spatial random fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing plotting routines for spatial fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/srf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a class for standard spatial random fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/summator.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True
# -*- coding: utf-8 -*-
"""
This is the randomization method summator, implemented in cython.
"""
Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for Fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/field/upscaling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing upscaling routines for the spatial random field.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/krige/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing kriging.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/krige/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a base class for kriging.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/krige/krigesum.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True
# -*- coding: utf-8 -*-
"""
This is a summator for the kriging routines
"""
Expand Down
1 change: 0 additions & 1 deletion src/gstools/krige/methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing a class for simple kriging.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/krige/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for Kriging.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/normalizer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing normalization routines.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/normalizer/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing the base class for normalizers.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/normalizer/methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing different normalizer transformations.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/normalizer/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for Normalizers.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/random/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage for random number generation.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/random/rng.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing the core of the spatial random field generation.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/random/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for random sampling.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing miscellaneous tools.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/tools/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing export routines.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/tools/geometric.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing geometric tools.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/tools/misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing miscellaneous tools.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/tools/special.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing special functions.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/transform/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing transformations to post-process normal fields.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/transform/array.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing array transformations.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/transform/field.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing field transformations.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/variogram/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for estimating and fitting variograms.

Expand Down
1 change: 0 additions & 1 deletion src/gstools/variogram/binning.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing binning routines.

Expand Down
3 changes: 1 addition & 2 deletions src/gstools/variogram/estimator.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True
# distutils: language = c++
# -*- coding: utf-8 -*-
"""
This is the variogram estimater, implemented in cython.
"""
Expand Down Expand Up @@ -251,7 +250,7 @@ def unstructured(
else:
distance = dist_haversine
if dim != 2:
raise ValueError('Haversine: dim = {0} != 2'.format(dim))
raise ValueError('Haversine: dim = {} != 2'.format(dim))
mwtoews marked this conversation as resolved.
Show resolved Hide resolved

if pos.shape[1] != f.shape[1]:
raise ValueError('len(pos) = {0} != len(f) = {1} '.
Expand Down
1 change: 0 additions & 1 deletion src/gstools/variogram/variogram.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
GStools subpackage providing tools for estimating and fitting variograms.

Expand Down
1 change: 0 additions & 1 deletion tests/test_condition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""This is the unittest of CondSRF class."""
import unittest
from copy import copy
Expand Down
1 change: 0 additions & 1 deletion tests/test_covmodel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of CovModel class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_field.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the unittest of SRF class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_incomprrandmeth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of the RandMeth class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_krige.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of the kriging module.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_latlon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest for latlon related routines.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_normalizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of the Normalizer class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_randmeth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of the RandMeth class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_rng.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is the unittest of the RNG class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_srf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the unittest of SRF class.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_transform.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""This is the unittest of the transform submodule."""
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/test_variogram_structured.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is a unittest of the variogram module.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_variogram_unstructured.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
This is a unittest of the variogram module.
"""
Expand Down