From 6453abe1f5e8fba2e32f706072e07e2b59908e4e Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Fri, 11 Nov 2022 22:35:57 +1300 Subject: [PATCH 1/2] Remove unnecessary coding, use a few f-strings --- docs/source/conf.py | 3 +-- examples/00_misc/02_check_rand_meth_sampling.py | 2 +- examples/01_random_field/00_gaussian.py | 2 +- examples/01_random_field/05_mesh_ensemble.py | 4 ++-- setup.py | 1 - src/gstools/__init__.py | 1 - src/gstools/config.py | 1 - src/gstools/covmodel/__init__.py | 1 - src/gstools/covmodel/base.py | 1 - src/gstools/covmodel/fit.py | 1 - src/gstools/covmodel/models.py | 1 - src/gstools/covmodel/plot.py | 1 - src/gstools/covmodel/tools.py | 1 - src/gstools/covmodel/tpl_models.py | 1 - src/gstools/field/__init__.py | 1 - src/gstools/field/base.py | 1 - src/gstools/field/cond_srf.py | 1 - src/gstools/field/generator.py | 1 - src/gstools/field/plot.py | 1 - src/gstools/field/srf.py | 1 - src/gstools/field/summator.pyx | 1 - src/gstools/field/tools.py | 1 - src/gstools/field/upscaling.py | 1 - src/gstools/krige/__init__.py | 1 - src/gstools/krige/base.py | 1 - src/gstools/krige/krigesum.pyx | 1 - src/gstools/krige/methods.py | 1 - src/gstools/krige/tools.py | 1 - src/gstools/normalizer/__init__.py | 1 - src/gstools/normalizer/base.py | 1 - src/gstools/normalizer/methods.py | 1 - src/gstools/normalizer/tools.py | 1 - src/gstools/random/__init__.py | 1 - src/gstools/random/rng.py | 1 - src/gstools/random/tools.py | 1 - src/gstools/tools/__init__.py | 1 - src/gstools/tools/export.py | 1 - src/gstools/tools/geometric.py | 1 - src/gstools/tools/misc.py | 1 - src/gstools/tools/special.py | 1 - src/gstools/transform/__init__.py | 1 - src/gstools/transform/array.py | 1 - src/gstools/transform/field.py | 1 - src/gstools/variogram/__init__.py | 1 - src/gstools/variogram/binning.py | 1 - src/gstools/variogram/estimator.pyx | 3 +-- src/gstools/variogram/variogram.py | 1 - tests/test_condition.py | 1 - tests/test_covmodel.py | 1 - tests/test_field.py | 1 - tests/test_incomprrandmeth.py | 1 - tests/test_krige.py | 1 - tests/test_latlon.py | 1 - tests/test_normalizer.py | 1 - tests/test_randmeth.py | 1 - tests/test_rng.py | 1 - tests/test_srf.py | 1 - tests/test_transform.py | 1 - tests/test_variogram_structured.py | 1 - tests/test_variogram_unstructured.py | 1 - 60 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index f197f6265..e1a99a2a6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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. @@ -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 diff --git a/examples/00_misc/02_check_rand_meth_sampling.py b/examples/00_misc/02_check_rand_meth_sampling.py index dfbfd7411..0b23a9293 100644 --- a/examples/00_misc/02_check_rand_meth_sampling.py +++ b/examples/00_misc/02_check_rand_meth_sampling.py @@ -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() diff --git a/examples/01_random_field/00_gaussian.py b/examples/01_random_field/00_gaussian.py index 726ad653f..b7bde5f9c 100644 --- a/examples/01_random_field/00_gaussian.py +++ b/examples/01_random_field/00_gaussian.py @@ -1,4 +1,4 @@ -""" +r""" A Very Simple Example --------------------- diff --git a/examples/01_random_field/05_mesh_ensemble.py b/examples/01_random_field/05_mesh_ensemble.py index 8ff13e4bd..1e2f0da86 100755 --- a/examples/01_random_field/05_mesh_ensemble.py +++ b/examples/01_random_field/05_mesh_ensemble.py @@ -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. diff --git a/setup.py b/setup.py index 4dd06ad7e..30fc704bf 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """GSTools: A geostatistical toolbox.""" import os diff --git a/src/gstools/__init__.py b/src/gstools/__init__.py index 970574ff0..6f5a2034b 100644 --- a/src/gstools/__init__.py +++ b/src/gstools/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Purpose ======= diff --git a/src/gstools/config.py b/src/gstools/config.py index 38f3e7faa..30ac45545 100644 --- a/src/gstools/config.py +++ b/src/gstools/config.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing global variables. diff --git a/src/gstools/covmodel/__init__.py b/src/gstools/covmodel/__init__.py index 38414a480..0c61d4041 100644 --- a/src/gstools/covmodel/__init__.py +++ b/src/gstools/covmodel/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a set of handy covariance models. diff --git a/src/gstools/covmodel/base.py b/src/gstools/covmodel/base.py index 2e366f947..686768fa4 100644 --- a/src/gstools/covmodel/base.py +++ b/src/gstools/covmodel/base.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing the base class for covariance models. diff --git a/src/gstools/covmodel/fit.py b/src/gstools/covmodel/fit.py index b50dad940..2ff5398b9 100755 --- a/src/gstools/covmodel/fit.py +++ b/src/gstools/covmodel/fit.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for the covariance-model. diff --git a/src/gstools/covmodel/models.py b/src/gstools/covmodel/models.py index 61243486f..a2aaf6a33 100644 --- a/src/gstools/covmodel/models.py +++ b/src/gstools/covmodel/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing different covariance models. diff --git a/src/gstools/covmodel/plot.py b/src/gstools/covmodel/plot.py index 574e0e20f..e6453a8d5 100644 --- a/src/gstools/covmodel/plot.py +++ b/src/gstools/covmodel/plot.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing plotting routines for the covariance models. diff --git a/src/gstools/covmodel/tools.py b/src/gstools/covmodel/tools.py index cfc586363..98ed3b8af 100644 --- a/src/gstools/covmodel/tools.py +++ b/src/gstools/covmodel/tools.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for the covariance-model. diff --git a/src/gstools/covmodel/tpl_models.py b/src/gstools/covmodel/tpl_models.py index c173d0067..5e980760b 100644 --- a/src/gstools/covmodel/tpl_models.py +++ b/src/gstools/covmodel/tpl_models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing truncated power law covariance models. diff --git a/src/gstools/field/__init__.py b/src/gstools/field/__init__.py index aa51bef4e..65718bc78 100644 --- a/src/gstools/field/__init__.py +++ b/src/gstools/field/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for spatial random fields. diff --git a/src/gstools/field/base.py b/src/gstools/field/base.py index 48fe7e25e..903f38939 100755 --- a/src/gstools/field/base.py +++ b/src/gstools/field/base.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a base class for spatial fields. diff --git a/src/gstools/field/cond_srf.py b/src/gstools/field/cond_srf.py index 70ef6cc6b..385216ba1 100644 --- a/src/gstools/field/cond_srf.py +++ b/src/gstools/field/cond_srf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a class for conditioned spatial random fields. diff --git a/src/gstools/field/generator.py b/src/gstools/field/generator.py index c2de58ff0..4e1719507 100644 --- a/src/gstools/field/generator.py +++ b/src/gstools/field/generator.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing generators for spatial random fields. diff --git a/src/gstools/field/plot.py b/src/gstools/field/plot.py index 009d901da..528cdcc3d 100644 --- a/src/gstools/field/plot.py +++ b/src/gstools/field/plot.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing plotting routines for spatial fields. diff --git a/src/gstools/field/srf.py b/src/gstools/field/srf.py index 068397798..a8a1e575f 100644 --- a/src/gstools/field/srf.py +++ b/src/gstools/field/srf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a class for standard spatial random fields. diff --git a/src/gstools/field/summator.pyx b/src/gstools/field/summator.pyx index ecd7ea58d..cad20e1d8 100644 --- a/src/gstools/field/summator.pyx +++ b/src/gstools/field/summator.pyx @@ -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. """ diff --git a/src/gstools/field/tools.py b/src/gstools/field/tools.py index 019f2e588..4b128d8a1 100644 --- a/src/gstools/field/tools.py +++ b/src/gstools/field/tools.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for Fields. diff --git a/src/gstools/field/upscaling.py b/src/gstools/field/upscaling.py index cf77892d9..ac5f49a93 100644 --- a/src/gstools/field/upscaling.py +++ b/src/gstools/field/upscaling.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing upscaling routines for the spatial random field. diff --git a/src/gstools/krige/__init__.py b/src/gstools/krige/__init__.py index cc2436cdb..9bb17faed 100644 --- a/src/gstools/krige/__init__.py +++ b/src/gstools/krige/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing kriging. diff --git a/src/gstools/krige/base.py b/src/gstools/krige/base.py index e48c8fcca..77c6832e3 100755 --- a/src/gstools/krige/base.py +++ b/src/gstools/krige/base.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a base class for kriging. diff --git a/src/gstools/krige/krigesum.pyx b/src/gstools/krige/krigesum.pyx index 41911cef3..de3a43b1e 100644 --- a/src/gstools/krige/krigesum.pyx +++ b/src/gstools/krige/krigesum.pyx @@ -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 """ diff --git a/src/gstools/krige/methods.py b/src/gstools/krige/methods.py index 280e68115..653785f80 100644 --- a/src/gstools/krige/methods.py +++ b/src/gstools/krige/methods.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing a class for simple kriging. diff --git a/src/gstools/krige/tools.py b/src/gstools/krige/tools.py index 183b918fc..e3112ae47 100644 --- a/src/gstools/krige/tools.py +++ b/src/gstools/krige/tools.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for Kriging. diff --git a/src/gstools/normalizer/__init__.py b/src/gstools/normalizer/__init__.py index f76a490ff..24933fc71 100644 --- a/src/gstools/normalizer/__init__.py +++ b/src/gstools/normalizer/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing normalization routines. diff --git a/src/gstools/normalizer/base.py b/src/gstools/normalizer/base.py index e8bb0a508..0072d6a92 100644 --- a/src/gstools/normalizer/base.py +++ b/src/gstools/normalizer/base.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing the base class for normalizers. diff --git a/src/gstools/normalizer/methods.py b/src/gstools/normalizer/methods.py index 3776ba1f8..f66cfd192 100644 --- a/src/gstools/normalizer/methods.py +++ b/src/gstools/normalizer/methods.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing different normalizer transformations. diff --git a/src/gstools/normalizer/tools.py b/src/gstools/normalizer/tools.py index 2d28bef96..7a5237b71 100644 --- a/src/gstools/normalizer/tools.py +++ b/src/gstools/normalizer/tools.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for Normalizers. diff --git a/src/gstools/random/__init__.py b/src/gstools/random/__init__.py index 6c02da31f..20fd9c450 100644 --- a/src/gstools/random/__init__.py +++ b/src/gstools/random/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage for random number generation. diff --git a/src/gstools/random/rng.py b/src/gstools/random/rng.py index 11caad84e..4f6985571 100644 --- a/src/gstools/random/rng.py +++ b/src/gstools/random/rng.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing the core of the spatial random field generation. diff --git a/src/gstools/random/tools.py b/src/gstools/random/tools.py index 831b1f6ad..d61327ea7 100644 --- a/src/gstools/random/tools.py +++ b/src/gstools/random/tools.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for random sampling. diff --git a/src/gstools/tools/__init__.py b/src/gstools/tools/__init__.py index 730026cf3..18892557f 100644 --- a/src/gstools/tools/__init__.py +++ b/src/gstools/tools/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing miscellaneous tools. diff --git a/src/gstools/tools/export.py b/src/gstools/tools/export.py index af6f61bd8..3e522c92d 100644 --- a/src/gstools/tools/export.py +++ b/src/gstools/tools/export.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing export routines. diff --git a/src/gstools/tools/geometric.py b/src/gstools/tools/geometric.py index 843114479..afdcacaf7 100644 --- a/src/gstools/tools/geometric.py +++ b/src/gstools/tools/geometric.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing geometric tools. diff --git a/src/gstools/tools/misc.py b/src/gstools/tools/misc.py index 301da0752..068200b7a 100755 --- a/src/gstools/tools/misc.py +++ b/src/gstools/tools/misc.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing miscellaneous tools. diff --git a/src/gstools/tools/special.py b/src/gstools/tools/special.py index b5cd6bd60..c48887ea0 100644 --- a/src/gstools/tools/special.py +++ b/src/gstools/tools/special.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing special functions. diff --git a/src/gstools/transform/__init__.py b/src/gstools/transform/__init__.py index cffe744fd..9f9344c1b 100644 --- a/src/gstools/transform/__init__.py +++ b/src/gstools/transform/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing transformations to post-process normal fields. diff --git a/src/gstools/transform/array.py b/src/gstools/transform/array.py index e1b88ac68..32005f002 100644 --- a/src/gstools/transform/array.py +++ b/src/gstools/transform/array.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing array transformations. diff --git a/src/gstools/transform/field.py b/src/gstools/transform/field.py index 795ed2a17..9ac33b6c5 100644 --- a/src/gstools/transform/field.py +++ b/src/gstools/transform/field.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing field transformations. diff --git a/src/gstools/variogram/__init__.py b/src/gstools/variogram/__init__.py index 62122ad0a..59e10f551 100644 --- a/src/gstools/variogram/__init__.py +++ b/src/gstools/variogram/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for estimating and fitting variograms. diff --git a/src/gstools/variogram/binning.py b/src/gstools/variogram/binning.py index b005d4660..be4901101 100644 --- a/src/gstools/variogram/binning.py +++ b/src/gstools/variogram/binning.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing binning routines. diff --git a/src/gstools/variogram/estimator.pyx b/src/gstools/variogram/estimator.pyx index a3f40b5e8..55e7b91ae 100644 --- a/src/gstools/variogram/estimator.pyx +++ b/src/gstools/variogram/estimator.pyx @@ -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. """ @@ -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)) if pos.shape[1] != f.shape[1]: raise ValueError('len(pos) = {0} != len(f) = {1} '. diff --git a/src/gstools/variogram/variogram.py b/src/gstools/variogram/variogram.py index fc65d8c97..b57e0354a 100644 --- a/src/gstools/variogram/variogram.py +++ b/src/gstools/variogram/variogram.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GStools subpackage providing tools for estimating and fitting variograms. diff --git a/tests/test_condition.py b/tests/test_condition.py index 2e70d9c2c..e6b0c0cce 100644 --- a/tests/test_condition.py +++ b/tests/test_condition.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """This is the unittest of CondSRF class.""" import unittest from copy import copy diff --git a/tests/test_covmodel.py b/tests/test_covmodel.py index 3b9b5eaaa..b4344cc20 100644 --- a/tests/test_covmodel.py +++ b/tests/test_covmodel.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of CovModel class. """ diff --git a/tests/test_field.py b/tests/test_field.py index c33a78c19..cdb0365d6 100644 --- a/tests/test_field.py +++ b/tests/test_field.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """ This is the unittest of SRF class. """ diff --git a/tests/test_incomprrandmeth.py b/tests/test_incomprrandmeth.py index 0403f90c4..9156b1b17 100644 --- a/tests/test_incomprrandmeth.py +++ b/tests/test_incomprrandmeth.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of the RandMeth class. """ diff --git a/tests/test_krige.py b/tests/test_krige.py index afcdf838b..a37bf1e1f 100644 --- a/tests/test_krige.py +++ b/tests/test_krige.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of the kriging module. """ diff --git a/tests/test_latlon.py b/tests/test_latlon.py index 6f035a3a5..10d9f6822 100644 --- a/tests/test_latlon.py +++ b/tests/test_latlon.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest for latlon related routines. """ diff --git a/tests/test_normalizer.py b/tests/test_normalizer.py index 03480da5d..9ab0f45e0 100644 --- a/tests/test_normalizer.py +++ b/tests/test_normalizer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of the Normalizer class. """ diff --git a/tests/test_randmeth.py b/tests/test_randmeth.py index 0930b0b6c..1ed6cc1f7 100644 --- a/tests/test_randmeth.py +++ b/tests/test_randmeth.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of the RandMeth class. """ diff --git a/tests/test_rng.py b/tests/test_rng.py index 231199214..8fe167281 100644 --- a/tests/test_rng.py +++ b/tests/test_rng.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is the unittest of the RNG class. """ diff --git a/tests/test_srf.py b/tests/test_srf.py index a96e0e6f5..eb9468ca4 100644 --- a/tests/test_srf.py +++ b/tests/test_srf.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """ This is the unittest of SRF class. """ diff --git a/tests/test_transform.py b/tests/test_transform.py index 630f9fcdf..eb2980e2a 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """This is the unittest of the transform submodule.""" import unittest diff --git a/tests/test_variogram_structured.py b/tests/test_variogram_structured.py index e1ad19086..e0a3525aa 100644 --- a/tests/test_variogram_structured.py +++ b/tests/test_variogram_structured.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is a unittest of the variogram module. """ diff --git a/tests/test_variogram_unstructured.py b/tests/test_variogram_unstructured.py index 2e8735373..10b085bf0 100644 --- a/tests/test_variogram_unstructured.py +++ b/tests/test_variogram_unstructured.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ This is a unittest of the variogram module. """ From b33797e82c2a00b7488f8e422af58cd5a23692a8 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Sun, 27 Nov 2022 22:26:50 +1300 Subject: [PATCH 2/2] Manually update f-strings for estimator.pyx --- src/gstools/variogram/estimator.pyx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gstools/variogram/estimator.pyx b/src/gstools/variogram/estimator.pyx index 55e7b91ae..528004feb 100644 --- a/src/gstools/variogram/estimator.pyx +++ b/src/gstools/variogram/estimator.pyx @@ -187,8 +187,7 @@ def directional( str estimator_type='m', ): if pos.shape[1] != f.shape[1]: - raise ValueError('len(pos) = {0} != len(f) = {1} '. - format(pos.shape[1], f.shape[1])) + raise ValueError(f'len(pos) = {pos.shape[1]} != len(f) = {f.shape[1])}') if bin_edges.shape[0] < 2: raise ValueError('len(bin_edges) too small') @@ -250,11 +249,10 @@ def unstructured( else: distance = dist_haversine if dim != 2: - raise ValueError('Haversine: dim = {} != 2'.format(dim)) + raise ValueError(f'Haversine: dim = {dim} != 2') if pos.shape[1] != f.shape[1]: - raise ValueError('len(pos) = {0} != len(f) = {1} '. - format(pos.shape[1], f.shape[1])) + raise ValueError(f'len(pos) = {pos.shape[1]} != len(f) = {f.shape[1])}') if bin_edges.shape[0] < 2: raise ValueError('len(bin_edges) too small')