From ba5b0d91877a461e2634248116574c3363718eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 14 Mar 2024 17:10:28 +0100 Subject: [PATCH 01/36] Try out numpy 2 beta release --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 70b7d0a62..8d129558c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=64", "setuptools_scm>=7", - "oldest-supported-numpy", + "numpy==2.0.0b1", "Cython>=3.0", "extension-helpers>=1", ] @@ -48,7 +48,7 @@ dependencies = [ "emcee>=3.0.0", "hankel>=1.0.0", "meshio>=5.1.0", - "numpy>=1.14.5", + "numpy==2.0.0b1", "pyevtk>=1.1.1", "scipy>=1.1.0", ] From 3ad422aef80ead8d2d67a6c1cbcf31b6ba53b474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 4 Apr 2024 13:15:24 +0200 Subject: [PATCH 02/36] Remove py38; use np 2 rc --- .github/workflows/main.yml | 4 ++-- pyproject.toml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e116c4832..dec16dda4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: fetch-depth: '0' - name: Build wheels - uses: pypa/cibuildwheel@v2.16.2 + uses: pypa/cibuildwheel@v2.17.0 env: CIBW_ARCHS: ${{ matrix.cfg.arch }} with: @@ -88,7 +88,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index 8d129558c..1c23cb010 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,14 +2,14 @@ requires = [ "setuptools>=64", "setuptools_scm>=7", - "numpy==2.0.0b1", + "numpy>=2.0.0rc1", "Cython>=3.0", "extension-helpers>=1", ] build-backend = "setuptools.build_meta" [project] -requires-python = ">=3.8" +requires-python = ">=3.9" name = "gstools" description = "GSTools: A geostatistical toolbox." authors = [ @@ -48,7 +48,7 @@ dependencies = [ "emcee>=3.0.0", "hankel>=1.0.0", "meshio>=5.1.0", - "numpy==2.0.0b1", + "numpy>=1.19.3", "pyevtk>=1.1.1", "scipy>=1.1.0", ] @@ -161,7 +161,7 @@ target-version = [ # Switch to using build build-frontend = "build" # Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12, musllinux builds, py3.6/7 -skip = ["cp36-*", "cp37-*", "pp*", "cp31*-win32", "cp31*-manylinux_i686", "*-musllinux_*"] +skip = ["cp36-*", "cp37-*", "cp38-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"] # Run the package tests using `pytest` test-extras = "test" test-command = "pytest -v {package}/tests" From 8c52b9a804c9adc091b48df3ce7bab69f9726dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 4 Apr 2024 13:23:43 +0200 Subject: [PATCH 03/36] try running with np 2; remove 32bit wheels --- .github/workflows/main.yml | 2 -- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dec16dda4..f3bec88ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,9 +58,7 @@ jobs: matrix: cfg: - { os: ubuntu-latest, arch: x86_64 } - - { os: ubuntu-latest, arch: i686 } - { os: windows-latest, arch: AMD64 } - - { os: windows-latest, arch: x86 } - { os: macos-latest, arch: x86_64 } - { os: macos-latest, arch: arm64 } - { os: macos-latest, arch: universal2 } diff --git a/pyproject.toml b/pyproject.toml index 1c23cb010..c00f1fb89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ dependencies = [ "emcee>=3.0.0", "hankel>=1.0.0", "meshio>=5.1.0", - "numpy>=1.19.3", + "numpy>=2.0.0rc1", "pyevtk>=1.1.1", "scipy>=1.1.0", ] From 7e51f1ed018be92e297fe3d2a181668ca46fb816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 4 Apr 2024 13:24:45 +0200 Subject: [PATCH 04/36] cap black version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c00f1fb89..02cadee80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ plotting = [ rust = ["gstools_core>=0.2.0,<1"] test = ["pytest-cov>=3"] lint = [ - "black", + "black>=23,<24", "pylint", "isort[colors]", "cython-lint", From 9618c1c37cec9b89ccbdbca3ef70298275b552fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 5 Apr 2024 10:58:43 +0200 Subject: [PATCH 05/36] project: sphinx version fix; black min py version fix --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 02cadee80..3929eee6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,9 +61,9 @@ doc = [ "numpydoc>=1.1", "pykrige>=1.5,<2", "pyvista>=0.29", - "sphinx>=4", + "sphinx>=7", "sphinx-gallery>=0.8", - "sphinx-rtd-theme>=1,<1.1", + "sphinx-rtd-theme>=1,<2", "sphinxcontrib-youtube>=1.1", ] plotting = [ @@ -104,7 +104,6 @@ line_length = 79 [tool.black] line-length = 79 target-version = [ - "py38", "py39", "py310", "py311", From 4de1557881731c9a66c2ddea1d4a10b88a4f350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 5 Apr 2024 10:59:01 +0200 Subject: [PATCH 06/36] estimator: use int instead of long --- src/gstools/variogram/estimator.pyx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gstools/variogram/estimator.pyx b/src/gstools/variogram/estimator.pyx index ab418e32c..b97732e84 100644 --- a/src/gstools/variogram/estimator.pyx +++ b/src/gstools/variogram/estimator.pyx @@ -116,7 +116,7 @@ ctypedef double (*_estimator_func)(const double) nogil cdef inline void normalization_matheron( double[:] variogram, - long[:] counts, + int[:] counts, ): cdef int i for i in range(variogram.shape[0]): @@ -125,10 +125,10 @@ cdef inline void normalization_matheron( cdef inline void normalization_cressie( double[:] variogram, - long[:] counts, + int[:] counts, ): cdef int i - cdef long cnt + cdef int cnt for i in range(variogram.shape[0]): # avoid division by zero cnt = max(counts[i], 1) @@ -139,12 +139,12 @@ cdef inline void normalization_cressie( ctypedef void (*_normalization_func)( double[:], - long[:], + int[:], ) cdef inline void normalization_matheron_vec( double[:, :] variogram, - long[:, :] counts, + int[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -152,7 +152,7 @@ cdef inline void normalization_matheron_vec( cdef inline void normalization_cressie_vec( double[:, :] variogram, - long[:, :] counts, + int[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -160,7 +160,7 @@ cdef inline void normalization_cressie_vec( ctypedef void (*_normalization_func_vec)( double[:, :], - long[:, :], + int[:, :], ) cdef _estimator_func choose_estimator_func(str estimator_type): @@ -221,7 +221,7 @@ def directional( cdef int f_max = f.shape[0] cdef double[:, :] variogram = np.zeros((d_max, len(bin_edges)-1)) - cdef long[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=long) + cdef int[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=int) cdef int i, j, k, m, d cdef double dist @@ -287,7 +287,7 @@ def unstructured( cdef int f_max = f.shape[0] cdef double[:] variogram = np.zeros(len(bin_edges)-1) - cdef long[:] counts = np.zeros(len(bin_edges)-1, dtype=long) + cdef int[:] counts = np.zeros(len(bin_edges)-1, dtype=int) cdef int i, j, k, m cdef double dist @@ -324,7 +324,7 @@ def structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef long[:] counts = np.zeros(k_max, dtype=long) + cdef int[:] counts = np.zeros(k_max, dtype=int) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) @@ -356,7 +356,7 @@ def ma_structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef long[:] counts = np.zeros(k_max, dtype=long) + cdef int[:] counts = np.zeros(k_max, dtype=int) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) From 79712618628863f25dd2bf43dec73204ec8ba9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 5 Apr 2024 10:59:47 +0200 Subject: [PATCH 07/36] np: use asarray where possible with atleast_Xd to mimic ndmin feature --- src/gstools/krige/base.py | 4 +--- src/gstools/tools/geometric.py | 6 +++--- src/gstools/variogram/variogram.py | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gstools/krige/base.py b/src/gstools/krige/base.py index 336f4cc0e..75bb7b108 100755 --- a/src/gstools/krige/base.py +++ b/src/gstools/krige/base.py @@ -383,9 +383,7 @@ def _pre_ext_drift(self, pnt_cnt, ext_drift=None, set_cond=False): the drift values at the given positions """ if ext_drift is not None: - ext_drift = np.array( - ext_drift, dtype=np.double, ndmin=2, copy=False - ) + ext_drift = np.atleast_2d(np.asarray(ext_drift, dtype=np.double)) if ext_drift.size == 0: # treat empty array as no ext_drift return np.array([]) if set_cond: diff --git a/src/gstools/tools/geometric.py b/src/gstools/tools/geometric.py index 7f2ea10ed..57604fbb5 100644 --- a/src/gstools/tools/geometric.py +++ b/src/gstools/tools/geometric.py @@ -383,7 +383,7 @@ def generate_st_grid(pos, time, mesh_type="unstructured"): if mesh_type != "unstructured": pos = generate_grid(pos) else: - pos = np.array(pos, dtype=np.double, ndmin=2, copy=False) + pos = np.atleast_2d(np.asarray(pos, dtype=np.double)) out = [np.repeat(p.reshape(-1), np.size(time)) for p in pos] out.append(np.tile(time, np.size(pos[0]))) return np.asarray(out, dtype=np.double) @@ -552,7 +552,7 @@ def format_unstruct_pos_shape(pos, shape, check_stacked_shape=False): # now we try to be smart pre_len = len(np.atleast_1d(pos)) # care about 1D: pos can be given as 1D array here -> convert to 2D array - pos = np.array(pos, dtype=np.double, ndmin=2, copy=False) + pos = np.atleast_2d(np.asarray(pos, dtype=np.double)) post_len = len(pos) # first array dimension should be spatial dimension (1D is special case) dim = post_len if pre_len == post_len else 1 @@ -606,7 +606,7 @@ def ang2dir(angles, dtype=np.double, dim=None): the array of direction vectors """ pre_dim = np.asanyarray(angles).ndim - angles = np.array(angles, ndmin=2, dtype=dtype, copy=False) + angles = np.atleast_2d(np.asarray(angles, dtype=dtype)) if len(angles.shape) > 2: raise ValueError(f"Can't interpret angles array {angles}") dim = angles.shape[1] + 1 if dim is None else dim diff --git a/src/gstools/variogram/variogram.py b/src/gstools/variogram/variogram.py index 31e29191f..a08f1fbf2 100644 --- a/src/gstools/variogram/variogram.py +++ b/src/gstools/variogram/variogram.py @@ -262,7 +262,7 @@ def vario_estimate( John Wiley & Sons. (2007) """ if bin_edges is not None: - bin_edges = np.array(bin_edges, ndmin=1, dtype=np.double, copy=False) + bin_edges = np.atleast_1d(np.asarray(bin_edges, dtype=np.double)) bin_centers = (bin_edges[:-1] + bin_edges[1:]) / 2.0 # allow multiple fields at same positions (ndmin=2: first axis -> field ID) # need to convert to ma.array, since list of ma.array is not recognised @@ -315,7 +315,7 @@ def vario_estimate( # set directions dir_no = 0 if direction is not None and dim > 1: - direction = np.array(direction, ndmin=2, dtype=np.double, copy=False) + direction = np.atleast_2d(np.asarray(direction, dtype=np.double)) if len(direction.shape) > 2: raise ValueError(f"Can't interpret directions: {direction}") if direction.shape[1] != dim: @@ -473,7 +473,7 @@ def vario_estimate_axis( if not config.USE_RUST: mask = np.asarray(mask, dtype=np.int32) else: - field = np.array(field, ndmin=1, dtype=np.double, copy=False) + field = np.atleast_1d(np.asarray(field, dtype=np.double)) missing_mask = None # free space axis_to_swap = AXIS_DIR[direction] if direction in AXIS else int(direction) From 3b35caabf6da160a2c96620f09633ab55aa15603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 5 Apr 2024 12:38:56 +0200 Subject: [PATCH 08/36] cython: always use 64-bit integers for counts --- src/gstools/variogram/estimator.pyx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gstools/variogram/estimator.pyx b/src/gstools/variogram/estimator.pyx index b97732e84..b82ce580b 100644 --- a/src/gstools/variogram/estimator.pyx +++ b/src/gstools/variogram/estimator.pyx @@ -12,6 +12,7 @@ IF OPENMP: cimport numpy as np from libc.math cimport M_PI, acos, atan2, cos, fabs, isnan, pow, sin, sqrt +from libc.stdint cimport int64_t def set_num_threads(num_threads): @@ -116,7 +117,7 @@ ctypedef double (*_estimator_func)(const double) nogil cdef inline void normalization_matheron( double[:] variogram, - int[:] counts, + int64_t[:] counts, ): cdef int i for i in range(variogram.shape[0]): @@ -125,10 +126,10 @@ cdef inline void normalization_matheron( cdef inline void normalization_cressie( double[:] variogram, - int[:] counts, + int64_t[:] counts, ): cdef int i - cdef int cnt + cdef int64_t cnt for i in range(variogram.shape[0]): # avoid division by zero cnt = max(counts[i], 1) @@ -139,12 +140,12 @@ cdef inline void normalization_cressie( ctypedef void (*_normalization_func)( double[:], - int[:], + int64_t[:], ) cdef inline void normalization_matheron_vec( double[:, :] variogram, - int[:, :] counts, + int64_t[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -152,7 +153,7 @@ cdef inline void normalization_matheron_vec( cdef inline void normalization_cressie_vec( double[:, :] variogram, - int[:, :] counts, + int64_t[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -160,7 +161,7 @@ cdef inline void normalization_cressie_vec( ctypedef void (*_normalization_func_vec)( double[:, :], - int[:, :], + int64_t[:, :], ) cdef _estimator_func choose_estimator_func(str estimator_type): @@ -221,7 +222,7 @@ def directional( cdef int f_max = f.shape[0] cdef double[:, :] variogram = np.zeros((d_max, len(bin_edges)-1)) - cdef int[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=int) + cdef int64_t[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=np.int64) cdef int i, j, k, m, d cdef double dist @@ -287,7 +288,7 @@ def unstructured( cdef int f_max = f.shape[0] cdef double[:] variogram = np.zeros(len(bin_edges)-1) - cdef int[:] counts = np.zeros(len(bin_edges)-1, dtype=int) + cdef int64_t[:] counts = np.zeros(len(bin_edges)-1, dtype=np.int64) cdef int i, j, k, m cdef double dist @@ -324,7 +325,7 @@ def structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef int[:] counts = np.zeros(k_max, dtype=int) + cdef int64_t[:] counts = np.zeros(k_max, dtype=np.int64) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) @@ -356,7 +357,7 @@ def ma_structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef int[:] counts = np.zeros(k_max, dtype=int) + cdef int64_t[:] counts = np.zeros(k_max, dtype=np.int64) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) From bcf22c0e1097bf3844fc40bb8323afa4fc910bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 5 Apr 2024 13:14:16 +0200 Subject: [PATCH 09/36] deps: emcee try patch version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3929eee6b..a99337a24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ classifiers = [ "Topic :: Utilities", ] dependencies = [ - "emcee>=3.0.0", + "emcee @ git+https://github.com/MuellerSeb/emcee.git@patch-np2", "hankel>=1.0.0", "meshio>=5.1.0", "numpy>=2.0.0rc1", From f3549999a9778bb26dbc8b403843868d34214f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sat, 6 Apr 2024 16:08:45 +0200 Subject: [PATCH 10/36] re-enable py38; np2 to build extensions for py>=3.9; check np2 in CI --- .github/workflows/main.yml | 23 +++++++++++++++-------- pyproject.toml | 13 ++++++------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3bec88ef..4df0d64f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,30 +80,37 @@ jobs: path: ./dist/*.whl build_sdist: - name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }} + name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} and numpy ${{ matrix.ver.np }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.9', '3.10', '3.11', '3.12'] - + ver: [{py: '3.8', np: '1' }, {py: '3.9', np: '1'}, {py: '3.10', np: '1'}, {py: '3.11', np: '1'}, {py: '3.12', np: '1'}, {py: '3.12', np: '2'}] steps: - uses: actions/checkout@v2 with: fetch-depth: '0' - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.ver.py }} uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.ver.py }} - name: Install dependencies - env: - GSTOOLS_BUILD_PARALLEL: 1 run: | python -m pip install --upgrade pip pip install build coveralls>=3.0.0 + + - name: bleeding edge + if: matrix.ver.np == '2' + run: | + python -m pip install "numpy>=2.0.0rc1" git+https://github.com/dfm/emcee.git + + - name: Install GSTools + env: + GSTOOLS_BUILD_PARALLEL: 1 + run: | pip install -v --editable .[test] - name: Run tests @@ -119,7 +126,7 @@ jobs: python -m build --sdist --outdir dist . - uses: actions/upload-artifact@v2 - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' + if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.9' with: path: dist/*.tar.gz diff --git a/pyproject.toml b/pyproject.toml index a99337a24..fc7f1fdb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,14 +2,15 @@ requires = [ "setuptools>=64", "setuptools_scm>=7", - "numpy>=2.0.0rc1", + "numpy>=2.0.0rc1; python_version >= '3.9'", + "numpy==1.19.3; python_version < '3.9'", "Cython>=3.0", "extension-helpers>=1", ] build-backend = "setuptools.build_meta" [project] -requires-python = ">=3.9" +requires-python = ">=3.8" name = "gstools" description = "GSTools: A geostatistical toolbox." authors = [ @@ -45,10 +46,10 @@ classifiers = [ "Topic :: Utilities", ] dependencies = [ - "emcee @ git+https://github.com/MuellerSeb/emcee.git@patch-np2", + "emcee>=3.0.0", "hankel>=1.0.0", "meshio>=5.1.0", - "numpy>=2.0.0rc1", + "numpy>=1.19.3", "pyevtk>=1.1.1", "scipy>=1.1.0", ] @@ -160,11 +161,9 @@ target-version = [ # Switch to using build build-frontend = "build" # Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12, musllinux builds, py3.6/7 -skip = ["cp36-*", "cp37-*", "cp38-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"] +skip = ["cp36-*", "cp37-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"] # Run the package tests using `pytest` test-extras = "test" test-command = "pytest -v {package}/tests" # Skip trying to test arm64 builds on Intel Macs test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" -# no wheels for linux-32bit anymore for numpy>=1.22 -environment = "PIP_PREFER_BINARY=1" From e52cc9bdd5962f80eedf3037510b584cca807949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 22:58:37 +0200 Subject: [PATCH 11/36] CI: check several versions of numpy --- .github/workflows/main.yml | 17 ++++++++++++----- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4df0d64f6..9fe324499 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,13 +80,20 @@ jobs: path: ./dist/*.whl build_sdist: - name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} and numpy ${{ matrix.ver.np }} + name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} and numpy${{ matrix.ver.np }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - ver: [{py: '3.8', np: '1' }, {py: '3.9', np: '1'}, {py: '3.10', np: '1'}, {py: '3.11', np: '1'}, {py: '3.12', np: '1'}, {py: '3.12', np: '2'}] + # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg + ver: + - {py: '3.8', np: '==1.19.3' } + - {py: '3.9', np: '==1.19.3'} + - {py: '3.10', np: '==1.21.6'} + - {py: '3.11', np: '==1.23.2'} + - {py: '3.12', np: '==1.26.2'} + - {py: '3.12', np: '>=2.0.0rc1'} steps: - uses: actions/checkout@v2 with: @@ -100,12 +107,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build coveralls>=3.0.0 + pip install build coveralls>=3.0.0 "numpy${{ matrix.ver.np }}" - name: bleeding edge - if: matrix.ver.np == '2' + if: matrix.ver.np == '>=2.0.0rc1' run: | - python -m pip install "numpy>=2.0.0rc1" git+https://github.com/dfm/emcee.git + python -m pip install git+https://github.com/dfm/emcee.git - name: Install GSTools env: diff --git a/pyproject.toml b/pyproject.toml index fc7f1fdb2..cdc28b52d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools_scm>=7", "numpy>=2.0.0rc1; python_version >= '3.9'", "numpy==1.19.3; python_version < '3.9'", - "Cython>=3.0", + "Cython>=3.0.10", "extension-helpers>=1", ] build-backend = "setuptools.build_meta" From 70a59fb8f2b1cb241d38e49f7ed592ac2d5095c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:03:55 +0200 Subject: [PATCH 12/36] Doc: fix pyvista issue with renaming UniformGrid->ImageData --- examples/01_random_field/06_pyvista_support.py | 2 +- examples/04_vector_field/01_3d_vector_field.py | 2 +- pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/01_random_field/06_pyvista_support.py b/examples/01_random_field/06_pyvista_support.py index 4cc371dd0..d9eb9b917 100644 --- a/examples/01_random_field/06_pyvista_support.py +++ b/examples/01_random_field/06_pyvista_support.py @@ -22,7 +22,7 @@ # axes each with a length of 2 (whatever unit). dim, spacing = (50, 50, 50), (2, 2, 2) -grid = pv.UniformGrid(dim, spacing) +grid = pv.ImageData(dim, spacing) ############################################################################### # Now we set up the SRF class as always. We'll use an anisotropic model. diff --git a/examples/04_vector_field/01_3d_vector_field.py b/examples/04_vector_field/01_3d_vector_field.py index 13d76e879..86ca730cd 100755 --- a/examples/04_vector_field/01_3d_vector_field.py +++ b/examples/04_vector_field/01_3d_vector_field.py @@ -17,7 +17,7 @@ ############################################################################### # create a uniform grid with PyVista dims, spacing, origin = (40, 30, 10), (1, 1, 1), (-10, 0, 0) -mesh = pv.UniformGrid(dims=dims, spacing=spacing, origin=origin) +mesh = pv.ImageData(dims=dims, spacing=spacing, origin=origin) ############################################################################### # create an incompressible random 3d velocity field on the given mesh diff --git a/pyproject.toml b/pyproject.toml index cdc28b52d..14d59b19b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ doc = [ "meshzoo>=0.7", "numpydoc>=1.1", "pykrige>=1.5,<2", - "pyvista>=0.29", + "pyvista>=0.40", "sphinx>=7", "sphinx-gallery>=0.8", "sphinx-rtd-theme>=1,<2", @@ -69,7 +69,7 @@ doc = [ ] plotting = [ "matplotlib>=3", - "pyvista>=0.29", + "pyvista>=0.40", ] rust = ["gstools_core>=0.2.0,<1"] test = ["pytest-cov>=3"] From 7b8aab398e719bc04fd4957dd92fdf2fe9950092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:07:01 +0200 Subject: [PATCH 13/36] Doc: use rtd theme >v2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 14d59b19b..e1cbdd23a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ doc = [ "pyvista>=0.40", "sphinx>=7", "sphinx-gallery>=0.8", - "sphinx-rtd-theme>=1,<2", + "sphinx-rtd-theme>=2", "sphinxcontrib-youtube>=1.1", ] plotting = [ From b3b4fb50ca45657d235db3aeeef280f5d803b3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:18:30 +0200 Subject: [PATCH 14/36] Doc: fix ref issues --- .gitignore | 1 + src/gstools/field/base.py | 2 +- src/gstools/transform/field.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 872d3f40b..bcdc980be 100644 --- a/.gitignore +++ b/.gitignore @@ -117,6 +117,7 @@ src/gstools/_version.py # generated docs docs/source/examples/ docs/source/api/ +docs/source/sg_execution_times.rst # other settings .vscode/ diff --git a/src/gstools/field/base.py b/src/gstools/field/base.py index bb5141413..b0e5efeba 100755 --- a/src/gstools/field/base.py +++ b/src/gstools/field/base.py @@ -362,7 +362,7 @@ def transform( ---------- method : :class:`str` Method to use. - See :any:`gstools.transform` for available transformations. + See :py:mod:`gstools.transform` for available transformations. field : :class:`str`, optional Name of field to be transformed. The default is "field". store : :class:`str` or :class:`bool`, optional diff --git a/src/gstools/transform/field.py b/src/gstools/transform/field.py index 5d204407d..110232f68 100644 --- a/src/gstools/transform/field.py +++ b/src/gstools/transform/field.py @@ -111,7 +111,7 @@ def apply(fld, method, field="field", store=True, process=False, **kwargs): Field class containing a generated field. method : :class:`str` Method to use. - See :any:`gstools.transform` for available transformations. + See :py:mod:`gstools.transform` for available transformations. field : :class:`str`, optional Name of field to be transformed. The default is "field". store : :class:`str` or :class:`bool`, optional From a13968ef96d97ab70e63810bf08c045e47be7b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:24:56 +0200 Subject: [PATCH 15/36] CI: try fix missing pip step --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fe324499..13d58ad45 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,7 +107,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build coveralls>=3.0.0 "numpy${{ matrix.ver.np }}" + python -m pip install build coveralls>=3.0.0 numpy${{ matrix.ver.np }} - name: bleeding edge if: matrix.ver.np == '>=2.0.0rc1' From 74b130a32ab159530bf8f51310f39b752fd7feee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:32:12 +0200 Subject: [PATCH 16/36] CI: try fix missing pip step by separate job step --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13d58ad45..7859de0fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,9 +104,12 @@ jobs: with: python-version: ${{ matrix.ver.py }} - - name: Install dependencies + - name: Update pip run: | python -m pip install --upgrade pip + + - name: Install dependencies + run: | python -m pip install build coveralls>=3.0.0 numpy${{ matrix.ver.np }} - name: bleeding edge From 5f37aee37fd86a18ae26440504f9446aae74f60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:35:56 +0200 Subject: [PATCH 17/36] CI: try fix missing pip step by using env var for version --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7859de0fa..56d78b43a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,8 +109,10 @@ jobs: python -m pip install --upgrade pip - name: Install dependencies + env: + NP_VER: ${{ matrix.ver.np }} run: | - python -m pip install build coveralls>=3.0.0 numpy${{ matrix.ver.np }} + python -m pip install build coveralls>=3.0.0 numpy${NP_VER} - name: bleeding edge if: matrix.ver.np == '>=2.0.0rc1' From ea00a482f774d685f67ca680a6b2f77befced566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:42:42 +0200 Subject: [PATCH 18/36] CI: try fix missing pip step by using oldest-supported-numpy package --- .github/workflows/main.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56d78b43a..a4a1aae7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,14 +86,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg - ver: - - {py: '3.8', np: '==1.19.3' } - - {py: '3.9', np: '==1.19.3'} - - {py: '3.10', np: '==1.21.6'} - - {py: '3.11', np: '==1.23.2'} - - {py: '3.12', np: '==1.26.2'} - - {py: '3.12', np: '>=2.0.0rc1'} + ver: [{py: '3.8', np: '1' }, {py: '3.9', np: '1'}, {py: '3.10', np: '1'}, {py: '3.11', np: '1'}, {py: '3.12', np: '1'}, {py: '3.12', np: '2'}] steps: - uses: actions/checkout@v2 with: @@ -104,20 +97,15 @@ jobs: with: python-version: ${{ matrix.ver.py }} - - name: Update pip - run: | - python -m pip install --upgrade pip - - name: Install dependencies - env: - NP_VER: ${{ matrix.ver.np }} run: | - python -m pip install build coveralls>=3.0.0 numpy${NP_VER} + python -m pip install --upgrade pip + pip install build coveralls>=3.0.0 oldest-supported-numpy - name: bleeding edge - if: matrix.ver.np == '>=2.0.0rc1' + if: matrix.ver.np == '2' run: | - python -m pip install git+https://github.com/dfm/emcee.git + python -m pip install "numpy>=2.0.0rc1" git+https://github.com/dfm/emcee.git - name: Install GSTools env: From ebe8ef6654307fb586d74ba0cfcc5351ef386f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:50:32 +0200 Subject: [PATCH 19/36] CI: fix missing pip step by using quotes (>= is evil) --- .github/workflows/main.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4a1aae7e..4cb768cca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - ver: [{py: '3.8', np: '1' }, {py: '3.9', np: '1'}, {py: '3.10', np: '1'}, {py: '3.11', np: '1'}, {py: '3.12', np: '1'}, {py: '3.12', np: '2'}] + # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg + ver: + - {py: '3.8', np: '==1.19.3' } + - {py: '3.9', np: '==1.19.3'} + - {py: '3.10', np: '==1.21.6'} + - {py: '3.11', np: '==1.23.2'} + - {py: '3.12', np: '==1.26.2'} + - {py: '3.12', np: '>=2.0.0rc1'} steps: - uses: actions/checkout@v2 with: @@ -100,12 +107,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build coveralls>=3.0.0 oldest-supported-numpy + pip install build "coveralls>=3.0.0" "numpy${{ matrix.ver.np }}" - name: bleeding edge - if: matrix.ver.np == '2' + if: matrix.ver.np == '>=2.0.0rc1' run: | - python -m pip install "numpy>=2.0.0rc1" git+https://github.com/dfm/emcee.git + python -m pip install git+https://github.com/dfm/emcee.git - name: Install GSTools env: From 9074056f3b1eb9474c8051108a9c06c100176188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sun, 7 Apr 2024 23:55:29 +0200 Subject: [PATCH 20/36] CI: install numpy in test stage to ensure version --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4cb768cca..481e0df0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,7 +107,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build "coveralls>=3.0.0" "numpy${{ matrix.ver.np }}" + pip install build "coveralls>=3.0.0" - name: bleeding edge if: matrix.ver.np == '>=2.0.0rc1' @@ -124,6 +124,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + pip install "numpy${{ matrix.ver.np }}" python -m pytest --cov gstools --cov-report term-missing -v tests/ python -m coveralls --service=github From dacc89a730976dd66f8171cb8c9cca7ac37bf97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:05:06 +0200 Subject: [PATCH 21/36] deps: bump min np ver to 1.20 (meshio needs np.typing) --- .github/workflows/main.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 481e0df0e..408c6a359 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,8 +88,8 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg ver: - - {py: '3.8', np: '==1.19.3' } - - {py: '3.9', np: '==1.19.3'} + - {py: '3.8', np: '==1.20.0' } + - {py: '3.9', np: '==1.20.0'} - {py: '3.10', np: '==1.21.6'} - {py: '3.11', np: '==1.23.2'} - {py: '3.12', np: '==1.26.2'} diff --git a/pyproject.toml b/pyproject.toml index e1cbdd23a..94379ec94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dependencies = [ "emcee>=3.0.0", "hankel>=1.0.0", "meshio>=5.1.0", - "numpy>=1.19.3", + "numpy>=1.20.0", "pyevtk>=1.1.1", "scipy>=1.1.0", ] From 4353f6e9f54961ad201c92cbf4ca9b8a0b7e1d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:13:15 +0200 Subject: [PATCH 22/36] build: use build dep caps from scipy --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 94379ec94..944aa572c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,9 @@ requires = [ "setuptools>=64", "setuptools_scm>=7", - "numpy>=2.0.0rc1; python_version >= '3.9'", + "numpy>=2.0.0rc1,<2.3; python_version >= '3.9'", "numpy==1.19.3; python_version < '3.9'", - "Cython>=3.0.10", + "Cython>=3.0.10,<3.1.0", "extension-helpers>=1", ] build-backend = "setuptools.build_meta" @@ -53,7 +53,7 @@ dependencies = [ "pyevtk>=1.1.1", "scipy>=1.1.0", ] - +g [project.optional-dependencies] doc = [ "m2r2>=0.2.8", From d221248e7cc43904f4c142918cafbb40685c974a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:27:16 +0200 Subject: [PATCH 23/36] CI: also fix scipy version --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 408c6a359..75881fdec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: path: ./dist/*.whl build_sdist: - name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} and numpy${{ matrix.ver.np }} + name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }}, numpy${{ matrix.ver.np }}, scipy${{ matrix.ver.sp }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -88,12 +88,12 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg ver: - - {py: '3.8', np: '==1.20.0' } - - {py: '3.9', np: '==1.20.0'} - - {py: '3.10', np: '==1.21.6'} - - {py: '3.11', np: '==1.23.2'} - - {py: '3.12', np: '==1.26.2'} - - {py: '3.12', np: '>=2.0.0rc1'} + - {py: '3.8', np: '==1.20.0', sp: '==1.5.4'} + - {py: '3.9', np: '==1.20.0', sp: '==1.5.4'} + - {py: '3.10', np: '==1.21.6', sp: '==1.7.2'} + - {py: '3.11', np: '==1.23.2', sp: '==1.9.2'} + - {py: '3.12', np: '==1.26.2', sp: '==1.11.2'} + - {py: '3.12', np: '>=2.0.0rc1', sp: '>=1.13.0'} steps: - uses: actions/checkout@v2 with: @@ -108,6 +108,7 @@ jobs: run: | python -m pip install --upgrade pip pip install build "coveralls>=3.0.0" + pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}" - name: bleeding edge if: matrix.ver.np == '>=2.0.0rc1' @@ -124,7 +125,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - pip install "numpy${{ matrix.ver.np }}" python -m pytest --cov gstools --cov-report term-missing -v tests/ python -m coveralls --service=github From ba5bfb191c468e365a8c76c10fc492860b7a0ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:30:14 +0200 Subject: [PATCH 24/36] Doc: fix pyvista deprecation warnings --- examples/01_random_field/06_pyvista_support.py | 4 ++-- examples/04_vector_field/01_3d_vector_field.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/01_random_field/06_pyvista_support.py b/examples/01_random_field/06_pyvista_support.py index d9eb9b917..c2569f988 100644 --- a/examples/01_random_field/06_pyvista_support.py +++ b/examples/01_random_field/06_pyvista_support.py @@ -21,8 +21,8 @@ # We create a structured grid with PyVista containing 50 segments on all three # axes each with a length of 2 (whatever unit). -dim, spacing = (50, 50, 50), (2, 2, 2) -grid = pv.ImageData(dim, spacing) +dims, spacing = (50, 50, 50), (2, 2, 2) +grid = pv.ImageData(dimensions=dims, spacing=spacing) ############################################################################### # Now we set up the SRF class as always. We'll use an anisotropic model. diff --git a/examples/04_vector_field/01_3d_vector_field.py b/examples/04_vector_field/01_3d_vector_field.py index 86ca730cd..38a53f96d 100755 --- a/examples/04_vector_field/01_3d_vector_field.py +++ b/examples/04_vector_field/01_3d_vector_field.py @@ -17,7 +17,7 @@ ############################################################################### # create a uniform grid with PyVista dims, spacing, origin = (40, 30, 10), (1, 1, 1), (-10, 0, 0) -mesh = pv.ImageData(dims=dims, spacing=spacing, origin=origin) +mesh = pv.ImageData(dimensions=dims, spacing=spacing, origin=origin) ############################################################################### # create an incompressible random 3d velocity field on the given mesh From 552cb587b3e6f324d4b8e4e4db882e0de9e588ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:34:21 +0200 Subject: [PATCH 25/36] CI: fix config --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75881fdec..d41d32823 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: path: ./dist/*.whl build_sdist: - name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }}, numpy${{ matrix.ver.np }}, scipy${{ matrix.ver.sp }} + name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }} scipy${{ matrix.ver.sp }} runs-on: ${{ matrix.os }} strategy: fail-fast: false From 728adeede52fd7620d2c65bbb13f644bf41ada4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 00:41:20 +0200 Subject: [PATCH 26/36] fix typo --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 944aa572c..2389b54e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,6 @@ dependencies = [ "pyevtk>=1.1.1", "scipy>=1.1.0", ] -g [project.optional-dependencies] doc = [ "m2r2>=0.2.8", From 227efb6918b7b0c8db307d91e88a4c9c2722cec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 15:15:06 +0200 Subject: [PATCH 27/36] update changelog --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00513d23b..61601c72f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to **GSTools** will be documented in this file. +## [Unreleased] - ? + +### Enhancements + +- added global variable `config.NUM_THREADS` to select number of threads for parallel computation ([#336](https://github.com/GeoStat-Framework/GSTools/pull/336)) +- prepare numpy 2 support ([#340](https://github.com/GeoStat-Framework/GSTools/pull/340)) + - numpy 2.0.0rc1 for building extensions (for Python 3.9 and above) + - check multiple numpy and scipy versions in CI + - fixed minimal versions for numpy + - use `np.asarray` everywhere with `np.atleast_(n)d` + - fix long/longlong integer issue in cython on windows by always using 64bit integers + +### Bugfixes +- build docs with latest sphinx version ([#340](https://github.com/GeoStat-Framework/GSTools/pull/340)) + +### Changes +- require pyvista 0.40 at least ([#340](https://github.com/GeoStat-Framework/GSTools/pull/340)) + + ## [1.5.1] - Nifty Neon - 2023-11 ### Enhancements From 83f8594f1da59812976f7a9d57c02161b2b29b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 15:15:27 +0200 Subject: [PATCH 28/36] finalize pyproject.toml --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2389b54e1..da68d2ed5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools>=64", "setuptools_scm>=7", "numpy>=2.0.0rc1,<2.3; python_version >= '3.9'", - "numpy==1.19.3; python_version < '3.9'", + "oldest-supported-numpy; python_version < '3.9'", "Cython>=3.0.10,<3.1.0", "extension-helpers>=1", ] @@ -53,6 +53,7 @@ dependencies = [ "pyevtk>=1.1.1", "scipy>=1.1.0", ] + [project.optional-dependencies] doc = [ "m2r2>=0.2.8", @@ -104,6 +105,7 @@ line_length = 79 [tool.black] line-length = 79 target-version = [ + "py38", "py39", "py310", "py311", From 1124580f53232690bba5060fb3d9b2cbdeb51295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 15:15:58 +0200 Subject: [PATCH 29/36] CI: install scipy/numpy before test to really check compatibility --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d41d32823..5d70060a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,7 +108,6 @@ jobs: run: | python -m pip install --upgrade pip pip install build "coveralls>=3.0.0" - pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}" - name: bleeding edge if: matrix.ver.np == '>=2.0.0rc1' @@ -125,6 +124,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}" python -m pytest --cov gstools --cov-report term-missing -v tests/ python -m coveralls --service=github From 3bff873db2b974519be47664eef58a675e9da853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Mon, 8 Apr 2024 15:16:28 +0200 Subject: [PATCH 30/36] update docs with correct deps versions --- README.md | 4 ++-- docs/source/conf.py | 7 +++---- docs/source/index.rst | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 69f1f3ec1..6cb699019 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,7 @@ in memory for immediate 3D plotting in Python. ## Requirements: -- [NumPy >= 1.14.5](https://www.numpy.org) +- [NumPy >= 1.20.0](https://www.numpy.org) - [SciPy >= 1.1.0](https://www.scipy.org/scipylib) - [hankel >= 1.0.0](https://github.com/steven-murray/hankel) - [emcee >= 3.0.0](https://github.com/dfm/emcee) @@ -366,7 +366,7 @@ You can contact us via . ## License -[LGPLv3][license_link] © 2018-2021 +[LGPLv3][license_link] © 2018-2024 [pip_link]: https://pypi.org/project/gstools [conda_link]: https://docs.conda.io/en/latest/miniconda.html diff --git a/docs/source/conf.py b/docs/source/conf.py index eb5e5fae0..e89928fc9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -259,10 +259,9 @@ def setup(app): # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "Python": ("https://docs.python.org/", None), - "NumPy": ("http://docs.scipy.org/doc/numpy/", None), - "SciPy": ("http://docs.scipy.org/doc/scipy/reference", None), - "matplotlib": ("http://matplotlib.org", None), - "Sphinx": ("http://www.sphinx-doc.org/en/stable/", None), + "NumPy": ("https://numpy.org/doc/stable/", None), + "SciPy": ("https://docs.scipy.org/doc/scipy/", None), + "matplotlib": ("https://matplotlib.org/stable/", None), "hankel": ("https://hankel.readthedocs.io/en/latest/", None), "emcee": ("https://emcee.readthedocs.io/en/latest/", None), } diff --git a/docs/source/index.rst b/docs/source/index.rst index d71494acb..ecad05830 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -414,7 +414,7 @@ in memory for immediate 3D plotting in Python. Requirements ============ -- `Numpy >= 1.14.5 `_ +- `NumPy >= 1.20.0 `_ - `SciPy >= 1.1.0 `_ - `hankel >= 1.0.0 `_ - `emcee >= 3.0.0 `_ From 24fd5cad33c7758503068a3b44ef5bcd339aff36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 11 Apr 2024 12:57:57 +0200 Subject: [PATCH 31/36] update actions versions --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d70060a7..86f89e892 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,12 +20,12 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 @@ -64,7 +64,7 @@ jobs: - { os: macos-latest, arch: universal2 } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' @@ -75,7 +75,7 @@ jobs: with: output-dir: dist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: path: ./dist/*.whl @@ -95,12 +95,12 @@ jobs: - {py: '3.12', np: '==1.26.2', sp: '==1.11.2'} - {py: '3.12', np: '>=2.0.0rc1', sp: '>=1.13.0'} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' - name: Set up Python ${{ matrix.ver.py }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.ver.py }} @@ -133,7 +133,7 @@ jobs: # PEP 517 package builder from pypa python -m build --sdist --outdir dist . - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.9' with: path: dist/*.tar.gz @@ -143,7 +143,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: artifact path: dist From 9a754fa529cc7ee7a7966a9a498537ab77c72e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 12 Apr 2024 21:59:17 +0200 Subject: [PATCH 32/36] cython: use np.int64_t --- src/gstools/variogram/estimator.pyx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gstools/variogram/estimator.pyx b/src/gstools/variogram/estimator.pyx index b82ce580b..e00824be7 100644 --- a/src/gstools/variogram/estimator.pyx +++ b/src/gstools/variogram/estimator.pyx @@ -12,7 +12,6 @@ IF OPENMP: cimport numpy as np from libc.math cimport M_PI, acos, atan2, cos, fabs, isnan, pow, sin, sqrt -from libc.stdint cimport int64_t def set_num_threads(num_threads): @@ -117,7 +116,7 @@ ctypedef double (*_estimator_func)(const double) nogil cdef inline void normalization_matheron( double[:] variogram, - int64_t[:] counts, + np.int64_t[:] counts, ): cdef int i for i in range(variogram.shape[0]): @@ -126,10 +125,10 @@ cdef inline void normalization_matheron( cdef inline void normalization_cressie( double[:] variogram, - int64_t[:] counts, + np.int64_t[:] counts, ): cdef int i - cdef int64_t cnt + cdef np.int64_t cnt for i in range(variogram.shape[0]): # avoid division by zero cnt = max(counts[i], 1) @@ -140,12 +139,12 @@ cdef inline void normalization_cressie( ctypedef void (*_normalization_func)( double[:], - int64_t[:], + np.int64_t[:], ) cdef inline void normalization_matheron_vec( double[:, :] variogram, - int64_t[:, :] counts, + np.int64_t[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -153,7 +152,7 @@ cdef inline void normalization_matheron_vec( cdef inline void normalization_cressie_vec( double[:, :] variogram, - int64_t[:, :] counts, + np.int64_t[:, :] counts, ): cdef int d for d in range(variogram.shape[0]): @@ -161,7 +160,7 @@ cdef inline void normalization_cressie_vec( ctypedef void (*_normalization_func_vec)( double[:, :], - int64_t[:, :], + np.int64_t[:, :], ) cdef _estimator_func choose_estimator_func(str estimator_type): @@ -222,7 +221,7 @@ def directional( cdef int f_max = f.shape[0] cdef double[:, :] variogram = np.zeros((d_max, len(bin_edges)-1)) - cdef int64_t[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=np.int64) + cdef np.int64_t[:, :] counts = np.zeros((d_max, len(bin_edges)-1), dtype=np.int64) cdef int i, j, k, m, d cdef double dist @@ -288,7 +287,7 @@ def unstructured( cdef int f_max = f.shape[0] cdef double[:] variogram = np.zeros(len(bin_edges)-1) - cdef int64_t[:] counts = np.zeros(len(bin_edges)-1, dtype=np.int64) + cdef np.int64_t[:] counts = np.zeros(len(bin_edges)-1, dtype=np.int64) cdef int i, j, k, m cdef double dist @@ -325,7 +324,7 @@ def structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef int64_t[:] counts = np.zeros(k_max, dtype=np.int64) + cdef np.int64_t[:] counts = np.zeros(k_max, dtype=np.int64) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) @@ -357,7 +356,7 @@ def ma_structured( cdef int k_max = i_max + 1 cdef double[:] variogram = np.zeros(k_max) - cdef int64_t[:] counts = np.zeros(k_max, dtype=np.int64) + cdef np.int64_t[:] counts = np.zeros(k_max, dtype=np.int64) cdef int i, j, k cdef int num_threads_c = set_num_threads(num_threads) From 7b1fd1eb14f2bb860ea5b7e91c8f60215bf5730b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 12 Apr 2024 23:38:21 +0200 Subject: [PATCH 33/36] use black 24 and add black preview job to CI --- .github/workflows/main.yml | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86f89e892..5fa462980 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,6 @@ jobs: source_check: name: source check runs-on: ubuntu-latest - strategy: - fail-fast: false steps: - uses: actions/checkout@v4 @@ -38,6 +36,10 @@ jobs: run: | python -m black --check --diff --color . + - name: black preview + run: | + python -m black --preview --diff --color . + - name: isort check run: | python -m isort --check --diff --color . diff --git a/pyproject.toml b/pyproject.toml index da68d2ed5..17bcb2469 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ plotting = [ rust = ["gstools_core>=0.2.0,<1"] test = ["pytest-cov>=3"] lint = [ - "black>=23,<24", + "black>=24", "pylint", "isort[colors]", "cython-lint", From 062caa8390800904c3b358b63f862601da49914b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 12 Apr 2024 23:38:32 +0200 Subject: [PATCH 34/36] apply black 24 --- examples/00_misc/00_tpl_stable.py | 1 + examples/00_misc/01_export.py | 1 + examples/00_misc/02_check_rand_meth_sampling.py | 1 + examples/00_misc/04_herten.py | 1 + examples/00_misc/05_standalone_field.py | 1 + examples/01_random_field/03_unstr_srf_export.py | 1 + examples/01_random_field/04_srf_merge.py | 1 + examples/01_random_field/06_pyvista_support.py | 1 + examples/02_cov_model/01_basic_methods.py | 1 + examples/02_cov_model/02_aniso_rotation.py | 1 + examples/02_cov_model/03_spectral_methods.py | 1 + examples/02_cov_model/04_different_scales.py | 1 + examples/02_cov_model/05_additional_para.py | 1 + examples/02_cov_model/06_fitting_para_ranges.py | 1 + examples/03_variogram/00_fit_variogram.py | 1 + examples/03_variogram/01_find_best_model.py | 1 + examples/03_variogram/02_multi_vario.py | 1 + examples/03_variogram/03_directional_2d.py | 1 + examples/03_variogram/04_directional_3d.py | 1 + examples/03_variogram/05_auto_fit_variogram.py | 1 + examples/03_variogram/06_auto_bin_latlon.py | 1 + examples/04_vector_field/00_2d_vector_field.py | 1 + examples/04_vector_field/01_3d_vector_field.py | 1 + examples/05_kriging/00_simple_kriging.py | 1 + examples/05_kriging/01_ordinary_kriging.py | 1 + examples/05_kriging/02_pykrige_interface.py | 1 + examples/05_kriging/03_compare_kriging.py | 1 + examples/05_kriging/04_extdrift_kriging.py | 1 + examples/05_kriging/05_universal_kriging.py | 1 + examples/05_kriging/06_detrended_kriging.py | 1 + examples/05_kriging/07_detrended_ordinary_kriging.py | 1 + examples/05_kriging/09_pseudo_inverse.py | 1 + examples/06_conditioned_fields/00_condition_ensemble.py | 1 + .../06_conditioned_fields/01_2D_condition_ensemble.py | 1 + examples/07_transformations/00_log_normal.py | 1 + examples/07_transformations/01_binary.py | 1 + examples/07_transformations/02_discrete.py | 1 + examples/07_transformations/03_zinn_harvey.py | 1 + examples/07_transformations/04_bimodal.py | 1 + examples/07_transformations/05_combinations.py | 1 + examples/08_geo_coordinates/00_field_generation.py | 1 + examples/08_geo_coordinates/01_dwd_krige.py | 1 + examples/09_spatio_temporal/03_geographic_coordinates.py | 1 + examples/10_normalizer/00_lognormal_kriging.py | 1 + examples/10_normalizer/01_auto_fit.py | 1 + examples/10_normalizer/02_compare.py | 1 + setup.py | 1 + src/gstools/__init__.py | 1 + src/gstools/config.py | 1 + src/gstools/covmodel/base.py | 1 + src/gstools/covmodel/fit.py | 9 ++++++--- src/gstools/covmodel/models.py | 1 + src/gstools/covmodel/plot.py | 1 + src/gstools/covmodel/tpl_models.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/tools.py | 1 + src/gstools/field/upscaling.py | 1 + src/gstools/krige/__init__.py | 1 + src/gstools/krige/base.py | 1 + src/gstools/krige/methods.py | 1 + src/gstools/krige/tools.py | 1 + src/gstools/normalizer/base.py | 1 + src/gstools/normalizer/methods.py | 1 + src/gstools/normalizer/tools.py | 1 + src/gstools/random/rng.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/array.py | 1 + src/gstools/transform/field.py | 1 + src/gstools/variogram/binning.py | 1 + src/gstools/variogram/variogram.py | 1 + tests/test_condition.py | 1 + tests/test_covmodel.py | 1 + tests/test_export.py | 1 + tests/test_transform.py | 1 + 81 files changed, 86 insertions(+), 3 deletions(-) diff --git a/examples/00_misc/00_tpl_stable.py b/examples/00_misc/00_tpl_stable.py index 4d1a89d8a..474b0f558 100644 --- a/examples/00_misc/00_tpl_stable.py +++ b/examples/00_misc/00_tpl_stable.py @@ -40,6 +40,7 @@ \sigma^2_{\ell_{\mathrm{up}}} &= C\cdot\frac{\ell_{\mathrm{up}}^{2H}}{2H} """ + import numpy as np import gstools as gs diff --git a/examples/00_misc/01_export.py b/examples/00_misc/01_export.py index ad754abf0..e38294fe6 100644 --- a/examples/00_misc/01_export.py +++ b/examples/00_misc/01_export.py @@ -7,6 +7,7 @@ These can be viewed for example with `Paraview `__. """ + # sphinx_gallery_thumbnail_path = 'pics/paraview.png' import gstools as gs diff --git a/examples/00_misc/02_check_rand_meth_sampling.py b/examples/00_misc/02_check_rand_meth_sampling.py index 0b23a9293..58d998b4d 100644 --- a/examples/00_misc/02_check_rand_meth_sampling.py +++ b/examples/00_misc/02_check_rand_meth_sampling.py @@ -2,6 +2,7 @@ Check Random Sampling --------------------- """ + import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D diff --git a/examples/00_misc/04_herten.py b/examples/00_misc/04_herten.py index d9e1b16e7..1e1b8a23f 100644 --- a/examples/00_misc/04_herten.py +++ b/examples/00_misc/04_herten.py @@ -30,6 +30,7 @@ functions, since the only produce the ``herten_transmissivity.gz`` and ``grid_dim_origin_spacing.txt``, which are already present. """ + import os import matplotlib.pyplot as plt diff --git a/examples/00_misc/05_standalone_field.py b/examples/00_misc/05_standalone_field.py index fb0c20828..e467f0431 100644 --- a/examples/00_misc/05_standalone_field.py +++ b/examples/00_misc/05_standalone_field.py @@ -7,6 +7,7 @@ In the following example we will produce 10000 random points in 4D with random values and plot them. """ + import numpy as np import gstools as gs diff --git a/examples/01_random_field/03_unstr_srf_export.py b/examples/01_random_field/03_unstr_srf_export.py index e86e6f3e8..94d009525 100644 --- a/examples/01_random_field/03_unstr_srf_export.py +++ b/examples/01_random_field/03_unstr_srf_export.py @@ -6,6 +6,7 @@ Normally, such a grid would be read in, but we can simply generate one and then create a random field at those coordinates. """ + import numpy as np import gstools as gs diff --git a/examples/01_random_field/04_srf_merge.py b/examples/01_random_field/04_srf_merge.py index 00aa65116..241ed0793 100644 --- a/examples/01_random_field/04_srf_merge.py +++ b/examples/01_random_field/04_srf_merge.py @@ -6,6 +6,7 @@ to merge two unstructured rectangular fields. """ + # sphinx_gallery_thumbnail_number = 2 import numpy as np diff --git a/examples/01_random_field/06_pyvista_support.py b/examples/01_random_field/06_pyvista_support.py index c2569f988..29de8dd7a 100644 --- a/examples/01_random_field/06_pyvista_support.py +++ b/examples/01_random_field/06_pyvista_support.py @@ -12,6 +12,7 @@ The :any:`Field.mesh` method enables easy field creation on PyVista meshes used by the :any:`SRF` or :any:`Krige` class. """ + # sphinx_gallery_thumbnail_path = 'pics/GS_pyvista_cut.png' import pyvista as pv diff --git a/examples/02_cov_model/01_basic_methods.py b/examples/02_cov_model/01_basic_methods.py index fb9bfe7ac..4c97fba85 100755 --- a/examples/02_cov_model/01_basic_methods.py +++ b/examples/02_cov_model/01_basic_methods.py @@ -36,6 +36,7 @@ correlation function as demonstrated in the introductory example. If one of the above functions is given, the others will be determined: """ + import gstools as gs model = gs.Exponential(dim=3, var=2.0, len_scale=10, nugget=0.5) diff --git a/examples/02_cov_model/02_aniso_rotation.py b/examples/02_cov_model/02_aniso_rotation.py index 2a8bac788..b7459e396 100755 --- a/examples/02_cov_model/02_aniso_rotation.py +++ b/examples/02_cov_model/02_aniso_rotation.py @@ -6,6 +6,7 @@ represents the isotropic case for the model. Nevertheless, you can provide anisotropy ratios by: """ + import gstools as gs model = gs.Gaussian(dim=3, var=2.0, len_scale=10, anis=0.5) diff --git a/examples/02_cov_model/03_spectral_methods.py b/examples/02_cov_model/03_spectral_methods.py index 677811a9c..61c7e49b0 100755 --- a/examples/02_cov_model/03_spectral_methods.py +++ b/examples/02_cov_model/03_spectral_methods.py @@ -23,6 +23,7 @@ You can access these methods by: """ + import gstools as gs model = gs.Gaussian(dim=3, var=2.0, len_scale=10) diff --git a/examples/02_cov_model/04_different_scales.py b/examples/02_cov_model/04_different_scales.py index cd6f4deed..0e2e1991b 100755 --- a/examples/02_cov_model/04_different_scales.py +++ b/examples/02_cov_model/04_different_scales.py @@ -16,6 +16,7 @@ You can access it by: """ + import gstools as gs model = gs.Stable(dim=3, var=2.0, len_scale=10) diff --git a/examples/02_cov_model/05_additional_para.py b/examples/02_cov_model/05_additional_para.py index 02507d961..3264cec47 100755 --- a/examples/02_cov_model/05_additional_para.py +++ b/examples/02_cov_model/05_additional_para.py @@ -10,6 +10,7 @@ This leads to the so called **stable** covariance model and we can define it by """ + import numpy as np import gstools as gs diff --git a/examples/02_cov_model/06_fitting_para_ranges.py b/examples/02_cov_model/06_fitting_para_ranges.py index bd3d11960..7c8f083ed 100755 --- a/examples/02_cov_model/06_fitting_para_ranges.py +++ b/examples/02_cov_model/06_fitting_para_ranges.py @@ -6,6 +6,7 @@ variogram data. In the following we will use the self defined stable model from a previous example. """ + import numpy as np import gstools as gs diff --git a/examples/03_variogram/00_fit_variogram.py b/examples/03_variogram/00_fit_variogram.py index 9dc1b305f..7334ed2c8 100644 --- a/examples/03_variogram/00_fit_variogram.py +++ b/examples/03_variogram/00_fit_variogram.py @@ -2,6 +2,7 @@ Fit Variogram ------------- """ + import numpy as np import gstools as gs diff --git a/examples/03_variogram/01_find_best_model.py b/examples/03_variogram/01_find_best_model.py index c0fc383f9..eab031cf6 100755 --- a/examples/03_variogram/01_find_best_model.py +++ b/examples/03_variogram/01_find_best_model.py @@ -2,6 +2,7 @@ Finding the best fitting variogram model ---------------------------------------- """ + import numpy as np from matplotlib import pyplot as plt diff --git a/examples/03_variogram/02_multi_vario.py b/examples/03_variogram/02_multi_vario.py index f893e4527..71048849d 100755 --- a/examples/03_variogram/02_multi_vario.py +++ b/examples/03_variogram/02_multi_vario.py @@ -5,6 +5,7 @@ In this example, we demonstrate how to estimate a variogram from multiple fields on the same point-set that should have the same statistical properties. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/03_variogram/03_directional_2d.py b/examples/03_variogram/03_directional_2d.py index e5744cb22..460c75131 100755 --- a/examples/03_variogram/03_directional_2d.py +++ b/examples/03_variogram/03_directional_2d.py @@ -7,6 +7,7 @@ Afterwards we will fit a model to this estimated variogram and show the result. """ + import numpy as np from matplotlib import pyplot as plt diff --git a/examples/03_variogram/04_directional_3d.py b/examples/03_variogram/04_directional_3d.py index 22ee7e9fa..6a8b6ddfa 100755 --- a/examples/03_variogram/04_directional_3d.py +++ b/examples/03_variogram/04_directional_3d.py @@ -7,6 +7,7 @@ Afterwards we will fit a model to this estimated variogram and show the result. """ + import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D diff --git a/examples/03_variogram/05_auto_fit_variogram.py b/examples/03_variogram/05_auto_fit_variogram.py index 9c1cf2f92..2fcc7fbd6 100644 --- a/examples/03_variogram/05_auto_fit_variogram.py +++ b/examples/03_variogram/05_auto_fit_variogram.py @@ -2,6 +2,7 @@ Fit Variogram with automatic binning ------------------------------------ """ + import numpy as np import gstools as gs diff --git a/examples/03_variogram/06_auto_bin_latlon.py b/examples/03_variogram/06_auto_bin_latlon.py index 20f6f9bc1..cc248ea16 100644 --- a/examples/03_variogram/06_auto_bin_latlon.py +++ b/examples/03_variogram/06_auto_bin_latlon.py @@ -8,6 +8,7 @@ We use a data set from 20 meteo-stations choosen randomly. """ + import numpy as np import gstools as gs diff --git a/examples/04_vector_field/00_2d_vector_field.py b/examples/04_vector_field/00_2d_vector_field.py index 6a6c71ac3..2e7227642 100644 --- a/examples/04_vector_field/00_2d_vector_field.py +++ b/examples/04_vector_field/00_2d_vector_field.py @@ -5,6 +5,7 @@ As a first example we are going to generate a 2d vector field with a Gaussian covariance model on a structured grid: """ + import numpy as np import gstools as gs diff --git a/examples/04_vector_field/01_3d_vector_field.py b/examples/04_vector_field/01_3d_vector_field.py index 38a53f96d..5b1872bd4 100755 --- a/examples/04_vector_field/01_3d_vector_field.py +++ b/examples/04_vector_field/01_3d_vector_field.py @@ -6,6 +6,7 @@ Gaussian covariance model. The mesh on which we generate the field will be externally defined and it will be generated by PyVista. """ + # sphinx_gallery_thumbnail_path = 'pics/GS_3d_vector_field.png' import pyvista as pv diff --git a/examples/05_kriging/00_simple_kriging.py b/examples/05_kriging/00_simple_kriging.py index bb83a32c7..1a245b6c3 100755 --- a/examples/05_kriging/00_simple_kriging.py +++ b/examples/05_kriging/00_simple_kriging.py @@ -27,6 +27,7 @@ The mean of the field has to be given beforehand. """ + import numpy as np from gstools import Gaussian, krige diff --git a/examples/05_kriging/01_ordinary_kriging.py b/examples/05_kriging/01_ordinary_kriging.py index 3bc54bd91..d26254ef2 100644 --- a/examples/05_kriging/01_ordinary_kriging.py +++ b/examples/05_kriging/01_ordinary_kriging.py @@ -27,6 +27,7 @@ Here we use ordinary kriging in 1D (for plotting reasons) with 5 given observations/conditions. The estimated mean can be accessed by ``krig.mean``. """ + import numpy as np from gstools import Gaussian, krige diff --git a/examples/05_kriging/02_pykrige_interface.py b/examples/05_kriging/02_pykrige_interface.py index bb166d292..a6fbf03e1 100755 --- a/examples/05_kriging/02_pykrige_interface.py +++ b/examples/05_kriging/02_pykrige_interface.py @@ -11,6 +11,7 @@ To demonstrate the general workflow, we compare ordinary kriging of PyKrige with the corresponding GSTools routine in 2D: """ + import numpy as np from matplotlib import pyplot as plt from pykrige.ok import OrdinaryKriging diff --git a/examples/05_kriging/03_compare_kriging.py b/examples/05_kriging/03_compare_kriging.py index 12f5c43b3..463faa0a6 100755 --- a/examples/05_kriging/03_compare_kriging.py +++ b/examples/05_kriging/03_compare_kriging.py @@ -2,6 +2,7 @@ Compare Kriging --------------- """ + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/05_kriging/04_extdrift_kriging.py b/examples/05_kriging/04_extdrift_kriging.py index b9bbb54ae..2e6a168a5 100755 --- a/examples/05_kriging/04_extdrift_kriging.py +++ b/examples/05_kriging/04_extdrift_kriging.py @@ -2,6 +2,7 @@ External Drift Kriging ---------------------- """ + import numpy as np from gstools import SRF, Gaussian, krige diff --git a/examples/05_kriging/05_universal_kriging.py b/examples/05_kriging/05_universal_kriging.py index d3cf28805..5501694ad 100755 --- a/examples/05_kriging/05_universal_kriging.py +++ b/examples/05_kriging/05_universal_kriging.py @@ -13,6 +13,7 @@ To access only the estimated mean/drift, we provide a switch `only_mean` in the call routine. """ + import numpy as np from gstools import SRF, Gaussian, krige diff --git a/examples/05_kriging/06_detrended_kriging.py b/examples/05_kriging/06_detrended_kriging.py index b68e65021..6d20cf1db 100755 --- a/examples/05_kriging/06_detrended_kriging.py +++ b/examples/05_kriging/06_detrended_kriging.py @@ -2,6 +2,7 @@ Detrended Kriging ----------------- """ + import numpy as np from gstools import SRF, Gaussian, krige diff --git a/examples/05_kriging/07_detrended_ordinary_kriging.py b/examples/05_kriging/07_detrended_ordinary_kriging.py index 9a59fc336..81d017447 100755 --- a/examples/05_kriging/07_detrended_ordinary_kriging.py +++ b/examples/05_kriging/07_detrended_ordinary_kriging.py @@ -2,6 +2,7 @@ Detrended Ordinary Kriging -------------------------- """ + import numpy as np from gstools import SRF, Gaussian, krige diff --git a/examples/05_kriging/09_pseudo_inverse.py b/examples/05_kriging/09_pseudo_inverse.py index 9920a956e..7615d8886 100755 --- a/examples/05_kriging/09_pseudo_inverse.py +++ b/examples/05_kriging/09_pseudo_inverse.py @@ -17,6 +17,7 @@ In the following we have two different values at the same location. The resulting kriging field will hold the average at this point. """ + import numpy as np from gstools import Gaussian, krige diff --git a/examples/06_conditioned_fields/00_condition_ensemble.py b/examples/06_conditioned_fields/00_condition_ensemble.py index 716edd200..5cc07eedf 100644 --- a/examples/06_conditioned_fields/00_condition_ensemble.py +++ b/examples/06_conditioned_fields/00_condition_ensemble.py @@ -6,6 +6,7 @@ with 5 given observations/conditions, to generate an ensemble of conditioned random fields. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/06_conditioned_fields/01_2D_condition_ensemble.py b/examples/06_conditioned_fields/01_2D_condition_ensemble.py index 4a03e66b0..81f514647 100644 --- a/examples/06_conditioned_fields/01_2D_condition_ensemble.py +++ b/examples/06_conditioned_fields/01_2D_condition_ensemble.py @@ -4,6 +4,7 @@ Let's create an ensemble of conditioned random fields in 2D. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/07_transformations/00_log_normal.py b/examples/07_transformations/00_log_normal.py index 3d2f45325..d44c16270 100755 --- a/examples/07_transformations/00_log_normal.py +++ b/examples/07_transformations/00_log_normal.py @@ -6,6 +6,7 @@ See :any:`transform.normal_to_lognormal` """ + import gstools as gs # structured field with a size of 100x100 and a grid-size of 1x1 diff --git a/examples/07_transformations/01_binary.py b/examples/07_transformations/01_binary.py index a403abb7f..125e29d06 100755 --- a/examples/07_transformations/01_binary.py +++ b/examples/07_transformations/01_binary.py @@ -8,6 +8,7 @@ See :any:`transform.binary` """ + import gstools as gs # structured field with a size of 100x100 and a grid-size of 1x1 diff --git a/examples/07_transformations/02_discrete.py b/examples/07_transformations/02_discrete.py index 268cc9608..48f67a2d7 100755 --- a/examples/07_transformations/02_discrete.py +++ b/examples/07_transformations/02_discrete.py @@ -9,6 +9,7 @@ See :any:`transform.discrete` """ + import numpy as np import gstools as gs diff --git a/examples/07_transformations/03_zinn_harvey.py b/examples/07_transformations/03_zinn_harvey.py index 01e65790c..fad1fb64e 100755 --- a/examples/07_transformations/03_zinn_harvey.py +++ b/examples/07_transformations/03_zinn_harvey.py @@ -9,6 +9,7 @@ See :any:`transform.zinnharvey` """ + import gstools as gs # structured field with a size of 100x100 and a grid-size of 1x1 diff --git a/examples/07_transformations/04_bimodal.py b/examples/07_transformations/04_bimodal.py index 8234a486a..4dd6fb298 100755 --- a/examples/07_transformations/04_bimodal.py +++ b/examples/07_transformations/04_bimodal.py @@ -11,6 +11,7 @@ See: :any:`transform.normal_to_arcsin` and :any:`transform.normal_to_uquad` """ + import gstools as gs # structured field with a size of 100x100 and a grid-size of 1x1 diff --git a/examples/07_transformations/05_combinations.py b/examples/07_transformations/05_combinations.py index fb27c5e69..1fbe367e4 100755 --- a/examples/07_transformations/05_combinations.py +++ b/examples/07_transformations/05_combinations.py @@ -15,6 +15,7 @@ If you don't specify `field` and `store` everything happens inplace. """ + # sphinx_gallery_thumbnail_number = 1 import gstools as gs diff --git a/examples/08_geo_coordinates/00_field_generation.py b/examples/08_geo_coordinates/00_field_generation.py index b7b3748ad..5b1a6fca9 100755 --- a/examples/08_geo_coordinates/00_field_generation.py +++ b/examples/08_geo_coordinates/00_field_generation.py @@ -16,6 +16,7 @@ To generate the field, we simply pass ``(lat, lon)`` as the position tuple to the :any:`SRF` class. """ + import numpy as np import gstools as gs diff --git a/examples/08_geo_coordinates/01_dwd_krige.py b/examples/08_geo_coordinates/01_dwd_krige.py index 44b9f28ca..3c17fb7e0 100755 --- a/examples/08_geo_coordinates/01_dwd_krige.py +++ b/examples/08_geo_coordinates/01_dwd_krige.py @@ -15,6 +15,7 @@ In order to keep the number of dependecies low, the calls of both functions shown beneath are commented out. """ + # sphinx_gallery_thumbnail_number = 2 import matplotlib.pyplot as plt import numpy as np diff --git a/examples/09_spatio_temporal/03_geographic_coordinates.py b/examples/09_spatio_temporal/03_geographic_coordinates.py index 56684a94b..b1cfbff64 100644 --- a/examples/09_spatio_temporal/03_geographic_coordinates.py +++ b/examples/09_spatio_temporal/03_geographic_coordinates.py @@ -18,6 +18,7 @@ We will set a spatial length-scale of `1000` and a time length-scale of `100` days. """ + import numpy as np import gstools as gs diff --git a/examples/10_normalizer/00_lognormal_kriging.py b/examples/10_normalizer/00_lognormal_kriging.py index b7bf4a8a1..9880bc37a 100644 --- a/examples/10_normalizer/00_lognormal_kriging.py +++ b/examples/10_normalizer/00_lognormal_kriging.py @@ -14,6 +14,7 @@ In this example we will use ordinary kriging. """ + import numpy as np import gstools as gs diff --git a/examples/10_normalizer/01_auto_fit.py b/examples/10_normalizer/01_auto_fit.py index 80a495699..71ad13851 100644 --- a/examples/10_normalizer/01_auto_fit.py +++ b/examples/10_normalizer/01_auto_fit.py @@ -18,6 +18,7 @@ We will generate the "original" field on a 60x60 mesh, from which we will take samples in order to pretend a situation of data-scarcity. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/examples/10_normalizer/02_compare.py b/examples/10_normalizer/02_compare.py index 24f7c9f86..2dd74488c 100644 --- a/examples/10_normalizer/02_compare.py +++ b/examples/10_normalizer/02_compare.py @@ -6,6 +6,7 @@ But first, we define a convenience routine and make some imports as always. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/setup.py b/setup.py index f465ffd40..b27548a94 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """GSTools: A geostatistical toolbox.""" + import os import numpy as np diff --git a/src/gstools/__init__.py b/src/gstools/__init__.py index 6d62d5584..11e63a2b3 100644 --- a/src/gstools/__init__.py +++ b/src/gstools/__init__.py @@ -129,6 +129,7 @@ DEGREE_SCALE RADIAN_SCALE """ + # Hooray! from gstools import ( config, diff --git a/src/gstools/config.py b/src/gstools/config.py index f0a87bb65..24ce20c7e 100644 --- a/src/gstools/config.py +++ b/src/gstools/config.py @@ -4,6 +4,7 @@ .. currentmodule:: gstools.config """ + NUM_THREADS = None # pylint: disable=W0611 diff --git a/src/gstools/covmodel/base.py b/src/gstools/covmodel/base.py index be530075d..23e198812 100644 --- a/src/gstools/covmodel/base.py +++ b/src/gstools/covmodel/base.py @@ -8,6 +8,7 @@ .. autosummary:: CovModel """ + # pylint: disable=C0103, R0201, E1101, C0302, W0613 import copy diff --git a/src/gstools/covmodel/fit.py b/src/gstools/covmodel/fit.py index dc2d5a3a6..b420be709 100755 --- a/src/gstools/covmodel/fit.py +++ b/src/gstools/covmodel/fit.py @@ -8,6 +8,7 @@ .. autosummary:: fit_variogram """ + # pylint: disable=C0103, W0632 import numpy as np from scipy.optimize import curve_fit @@ -308,9 +309,11 @@ def _pre_init_guess(model, init_guess, mean_x=1.0, mean_y=1.0): for opt in model.opt_arg: init_guess.setdefault( opt, - default_arg_from_bounds(bnd[opt]) - if default - else getattr(model, opt), + ( + default_arg_from_bounds(bnd[opt]) + if default + else getattr(model, opt) + ), ) # convert all init guesses to float (except "anis") for arg in model.iso_arg: diff --git a/src/gstools/covmodel/models.py b/src/gstools/covmodel/models.py index a2aaf6a33..ab94e2794 100644 --- a/src/gstools/covmodel/models.py +++ b/src/gstools/covmodel/models.py @@ -20,6 +20,7 @@ SuperSpherical JBessel """ + # pylint: disable=C0103, E1101, R0201 import warnings diff --git a/src/gstools/covmodel/plot.py b/src/gstools/covmodel/plot.py index 334ccbe23..32148c14a 100644 --- a/src/gstools/covmodel/plot.py +++ b/src/gstools/covmodel/plot.py @@ -24,6 +24,7 @@ plot_spectral_density plot_spectral_rad_pdf """ + # pylint: disable=C0103, C0415, E1130 import numpy as np diff --git a/src/gstools/covmodel/tpl_models.py b/src/gstools/covmodel/tpl_models.py index 5e980760b..b728e7b98 100644 --- a/src/gstools/covmodel/tpl_models.py +++ b/src/gstools/covmodel/tpl_models.py @@ -11,6 +11,7 @@ TPLStable TPLSimple """ + # pylint: disable=C0103, E1101 import warnings diff --git a/src/gstools/field/base.py b/src/gstools/field/base.py index b0e5efeba..2006b8587 100755 --- a/src/gstools/field/base.py +++ b/src/gstools/field/base.py @@ -8,6 +8,7 @@ .. autosummary:: Field """ + # pylint: disable=C0103, C0415 from collections.abc import Iterable from copy import copy diff --git a/src/gstools/field/cond_srf.py b/src/gstools/field/cond_srf.py index 385216ba1..c3e03fe29 100644 --- a/src/gstools/field/cond_srf.py +++ b/src/gstools/field/cond_srf.py @@ -8,6 +8,7 @@ .. autosummary:: CondSRF """ + # pylint: disable=C0103, W0231, W0221, W0222, E1102 import numpy as np diff --git a/src/gstools/field/generator.py b/src/gstools/field/generator.py index 571c97335..5beab10db 100644 --- a/src/gstools/field/generator.py +++ b/src/gstools/field/generator.py @@ -12,6 +12,7 @@ RandMeth IncomprRandMeth """ + # pylint: disable=C0103, W0222, C0412, W0231 import warnings from abc import ABC, abstractmethod diff --git a/src/gstools/field/plot.py b/src/gstools/field/plot.py index d06a22a13..ab28c9745 100644 --- a/src/gstools/field/plot.py +++ b/src/gstools/field/plot.py @@ -9,6 +9,7 @@ plot_field plot_vec_field """ + # pylint: disable=C0103, W0613, E1101 import numpy as np from scipy import interpolate as inter diff --git a/src/gstools/field/srf.py b/src/gstools/field/srf.py index a8a1e575f..d88e46c09 100644 --- a/src/gstools/field/srf.py +++ b/src/gstools/field/srf.py @@ -8,6 +8,7 @@ .. autosummary:: SRF """ + # pylint: disable=C0103, W0221, E1102 import numpy as np diff --git a/src/gstools/field/tools.py b/src/gstools/field/tools.py index 4b128d8a1..dfa2e3c65 100644 --- a/src/gstools/field/tools.py +++ b/src/gstools/field/tools.py @@ -10,6 +10,7 @@ to_vtk_helper generate_on_mesh """ + # pylint: disable=W0212, C0415 import meshio import numpy as np diff --git a/src/gstools/field/upscaling.py b/src/gstools/field/upscaling.py index 6dcbaa7bb..857bfc454 100644 --- a/src/gstools/field/upscaling.py +++ b/src/gstools/field/upscaling.py @@ -11,6 +11,7 @@ var_coarse_graining var_no_scaling """ + # pylint: disable=W0613 import warnings diff --git a/src/gstools/krige/__init__.py b/src/gstools/krige/__init__.py index bb3ef6990..66d032464 100644 --- a/src/gstools/krige/__init__.py +++ b/src/gstools/krige/__init__.py @@ -16,6 +16,7 @@ ExtDrift Detrended """ + from gstools.krige.base import Krige from gstools.krige.methods import ( Detrended, diff --git a/src/gstools/krige/base.py b/src/gstools/krige/base.py index 75bb7b108..49a4f62fb 100755 --- a/src/gstools/krige/base.py +++ b/src/gstools/krige/base.py @@ -8,6 +8,7 @@ .. autosummary:: Krige """ + # pylint: disable=C0103, W0221, E1102, R0201, C0412 import collections diff --git a/src/gstools/krige/methods.py b/src/gstools/krige/methods.py index b258a02d5..19ffed56d 100644 --- a/src/gstools/krige/methods.py +++ b/src/gstools/krige/methods.py @@ -12,6 +12,7 @@ ExtDrift Detrended """ + # pylint: disable=C0103 from gstools.krige.base import Krige diff --git a/src/gstools/krige/tools.py b/src/gstools/krige/tools.py index e3112ae47..629265957 100644 --- a/src/gstools/krige/tools.py +++ b/src/gstools/krige/tools.py @@ -9,6 +9,7 @@ set_condition get_drift_functions """ + # pylint: disable=C0103 from itertools import combinations_with_replacement diff --git a/src/gstools/normalizer/base.py b/src/gstools/normalizer/base.py index 0072d6a92..4a8477c60 100644 --- a/src/gstools/normalizer/base.py +++ b/src/gstools/normalizer/base.py @@ -8,6 +8,7 @@ .. autosummary:: Normalizer """ + # pylint: disable=R0201 import warnings diff --git a/src/gstools/normalizer/methods.py b/src/gstools/normalizer/methods.py index f66cfd192..a46dc2306 100644 --- a/src/gstools/normalizer/methods.py +++ b/src/gstools/normalizer/methods.py @@ -13,6 +13,7 @@ Modulus Manly """ + # pylint: disable=E1101 import numpy as np diff --git a/src/gstools/normalizer/tools.py b/src/gstools/normalizer/tools.py index 7a5237b71..3e395d290 100644 --- a/src/gstools/normalizer/tools.py +++ b/src/gstools/normalizer/tools.py @@ -9,6 +9,7 @@ apply_mean_norm_trend remove_trend_norm_mean """ + import numpy as np from gstools.normalizer.base import Normalizer diff --git a/src/gstools/random/rng.py b/src/gstools/random/rng.py index 4f6985571..ad78a0c6c 100644 --- a/src/gstools/random/rng.py +++ b/src/gstools/random/rng.py @@ -8,6 +8,7 @@ .. autosummary:: RNG """ + # pylint: disable=E1101 import emcee as mc import numpy as np diff --git a/src/gstools/tools/export.py b/src/gstools/tools/export.py index 3e522c92d..38254cebe 100644 --- a/src/gstools/tools/export.py +++ b/src/gstools/tools/export.py @@ -13,6 +13,7 @@ to_vtk_structured to_vtk_unstructured """ + # pylint: disable=C0103, E1101 import numpy as np from pyevtk.hl import gridToVTK, pointsToVTK diff --git a/src/gstools/tools/geometric.py b/src/gstools/tools/geometric.py index 57604fbb5..55408965e 100644 --- a/src/gstools/tools/geometric.py +++ b/src/gstools/tools/geometric.py @@ -29,6 +29,7 @@ chordal_to_great_circle great_circle_to_chordal """ + # pylint: disable=C0103 import numpy as np diff --git a/src/gstools/tools/misc.py b/src/gstools/tools/misc.py index 068200b7a..aaba1501e 100755 --- a/src/gstools/tools/misc.py +++ b/src/gstools/tools/misc.py @@ -10,6 +10,7 @@ list_format eval_func """ + # pylint: disable=C0103, C0415 import numpy as np diff --git a/src/gstools/tools/special.py b/src/gstools/tools/special.py index c48887ea0..1457b736e 100644 --- a/src/gstools/tools/special.py +++ b/src/gstools/tools/special.py @@ -14,6 +14,7 @@ tpl_exp_spec_dens tpl_gau_spec_dens """ + # pylint: disable=C0103, E1101 import numpy as np from scipy import special as sps diff --git a/src/gstools/transform/array.py b/src/gstools/transform/array.py index 30c92bb61..87564edf0 100644 --- a/src/gstools/transform/array.py +++ b/src/gstools/transform/array.py @@ -18,6 +18,7 @@ array_to_arcsin array_to_uquad """ + # pylint: disable=C0103, C0123, R0911 from warnings import warn diff --git a/src/gstools/transform/field.py b/src/gstools/transform/field.py index 110232f68..4a2815647 100644 --- a/src/gstools/transform/field.py +++ b/src/gstools/transform/field.py @@ -26,6 +26,7 @@ normal_to_arcsin normal_to_uquad """ + # pylint: disable=C0103, C0123, R0911, R1735 import numpy as np diff --git a/src/gstools/variogram/binning.py b/src/gstools/variogram/binning.py index e8e42f38d..86d4fdc27 100644 --- a/src/gstools/variogram/binning.py +++ b/src/gstools/variogram/binning.py @@ -8,6 +8,7 @@ .. autosummary:: standard_bins """ + import numpy as np from gstools.tools import RADIAN_SCALE diff --git a/src/gstools/variogram/variogram.py b/src/gstools/variogram/variogram.py index a08f1fbf2..afcf336f4 100644 --- a/src/gstools/variogram/variogram.py +++ b/src/gstools/variogram/variogram.py @@ -9,6 +9,7 @@ vario_estimate vario_estimate_axis """ + # pylint: disable=C0412 import numpy as np diff --git a/tests/test_condition.py b/tests/test_condition.py index e6b0c0cce..8d5d0535e 100644 --- a/tests/test_condition.py +++ b/tests/test_condition.py @@ -1,4 +1,5 @@ """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 b4344cc20..a2729dd68 100644 --- a/tests/test_covmodel.py +++ b/tests/test_covmodel.py @@ -1,6 +1,7 @@ """ This is the unittest of CovModel class. """ + import unittest import numpy as np diff --git a/tests/test_export.py b/tests/test_export.py index 9bd6dd41d..a3efdede3 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -1,5 +1,6 @@ """Test the PyVista/VTK export methods """ + import os import shutil import tempfile diff --git a/tests/test_transform.py b/tests/test_transform.py index eb2980e2a..abc5505b0 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -1,4 +1,5 @@ """This is the unittest of the transform submodule.""" + import unittest import numpy as np From 50e6672403c5475a433ef16ce511f7b10dac0983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 12 Apr 2024 23:44:27 +0200 Subject: [PATCH 35/36] fix black preview complain --- tests/test_export.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_export.py b/tests/test_export.py index a3efdede3..b32898f45 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -1,5 +1,4 @@ -"""Test the PyVista/VTK export methods -""" +"""Test the PyVista/VTK export methods""" import os import shutil From 25e002e8032bf43073e1e4adb2bc064df44c81c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Tue, 16 Apr 2024 18:02:06 +0200 Subject: [PATCH 36/36] CI: emcee 3.1.5 with numpy 2 support was released --- .github/workflows/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5fa462980..f8dc74cdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -111,11 +111,6 @@ jobs: python -m pip install --upgrade pip pip install build "coveralls>=3.0.0" - - name: bleeding edge - if: matrix.ver.np == '>=2.0.0rc1' - run: | - python -m pip install git+https://github.com/dfm/emcee.git - - name: Install GSTools env: GSTOOLS_BUILD_PARALLEL: 1