From ebf3a8b78e4837b357f2da43317d05dc67ad5bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 15 Dec 2021 14:35:11 +0100 Subject: [PATCH 01/13] Field: make Field.mesh compatible with meshio v5.1+ --- gstools/field/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gstools/field/tools.py b/gstools/field/tools.py index a650f841..ad954402 100644 --- a/gstools/field/tools.py +++ b/gstools/field/tools.py @@ -22,6 +22,9 @@ __all__ = ["fmt_mean_norm_trend", "to_vtk_helper", "generate_on_mesh"] +MESHIO_VERSION = list(map(int, meshio.__version__.split(".")[:2])) + + def _fmt_func_val(f_cls, func_val): # pragma: no cover if func_val is None: return str(None) @@ -190,7 +193,8 @@ def generate_on_mesh( raise ValueError("Field.mesh: mesh dimension too low!") pnts = np.empty((0, mesh_dim), dtype=np.double) for cell in mesh.cells: - pnt = np.mean(mesh.points[cell[1]], axis=1) + cell_points = cell[1] if MESHIO_VERSION < [5, 1] else cell.data + pnt = np.mean(mesh.points[cell_points], axis=1) offset.append(pnts.shape[0]) length.append(pnt.shape[0]) pnts = np.vstack((pnts, pnt)) From 4299e91220c381679e0d111e171bdd75e5344f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 15 Dec 2021 14:41:11 +0100 Subject: [PATCH 02/13] Docs: fix version pinning info of meshio --- README.md | 2 +- docs/source/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f68e49a9..9f4b9432 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ in memory for immediate 3D plotting in Python. - [hankel >= 1.0.2](https://github.com/steven-murray/hankel) - [emcee >= 3.0.0](https://github.com/dfm/emcee) - [pyevtk >= 1.1.1](https://github.com/pyscience-projects/pyevtk) -- [meshio>=4.0.3, <5.0](https://github.com/nschloe/meshio) +- [meshio>=4.0.3, <6.0](https://github.com/nschloe/meshio) ### Optional diff --git a/docs/source/index.rst b/docs/source/index.rst index 8ead5056..fee3989f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -410,7 +410,7 @@ Requirements - `hankel >= 1.0.2 `_ - `emcee >= 3.0.0 `_ - `pyevtk >= 1.1.1 `_ -- `meshio>=4.0.3, <5.0 `_ +- `meshio>=4.0.3, <6.0 `_ Optional From debec6546062a7965a797de64ea44a0bfce816a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 15 Dec 2021 14:44:27 +0100 Subject: [PATCH 03/13] Update changelog for v1.3.5 --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f017a28..850dd2e0 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to **GSTools** will be documented in this file. +## [1.3.5] - Pure Pink - ? + +### Bugfixes +- `Field.mesh` was not compatible with [meshio](https://github.com/nschloe/meshio) v5.1+ [#227](https://github.com/GeoStat-Framework/GSTools/pull/227) + + ## [1.3.4] - Pure Pink - 2021-11 ### Enhancements @@ -321,7 +327,7 @@ See: [#197](https://github.com/GeoStat-Framework/GSTools/issues/197) First release of GSTools. -[Unreleased]: https://github.com/GeoStat-Framework/gstools/compare/v1.3.4...HEAD +[1.3.5]: https://github.com/GeoStat-Framework/gstools/compare/v1.3.4...HEAD [1.3.4]: https://github.com/GeoStat-Framework/gstools/compare/v1.3.3...v1.3.4 [1.3.3]: https://github.com/GeoStat-Framework/gstools/compare/v1.3.2...v1.3.3 [1.3.2]: https://github.com/GeoStat-Framework/gstools/compare/v1.3.1...v1.3.2 From e20ec975439773bec6ef9217f6a0d7926f3a950e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 09:51:40 +0100 Subject: [PATCH 04/13] require meshio >5.1 --- README.md | 2 +- docs/source/index.rst | 2 +- gstools/field/tools.py | 6 +----- setup.cfg | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9f4b9432..be643e27 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ in memory for immediate 3D plotting in Python. - [hankel >= 1.0.2](https://github.com/steven-murray/hankel) - [emcee >= 3.0.0](https://github.com/dfm/emcee) - [pyevtk >= 1.1.1](https://github.com/pyscience-projects/pyevtk) -- [meshio>=4.0.3, <6.0](https://github.com/nschloe/meshio) +- [meshio >= 5.1](https://github.com/nschloe/meshio) ### Optional diff --git a/docs/source/index.rst b/docs/source/index.rst index fee3989f..931f9ed9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -410,7 +410,7 @@ Requirements - `hankel >= 1.0.2 `_ - `emcee >= 3.0.0 `_ - `pyevtk >= 1.1.1 `_ -- `meshio>=4.0.3, <6.0 `_ +- `meshio >= 5.1 `_ Optional diff --git a/gstools/field/tools.py b/gstools/field/tools.py index ad954402..86f3fee1 100644 --- a/gstools/field/tools.py +++ b/gstools/field/tools.py @@ -22,9 +22,6 @@ __all__ = ["fmt_mean_norm_trend", "to_vtk_helper", "generate_on_mesh"] -MESHIO_VERSION = list(map(int, meshio.__version__.split(".")[:2])) - - def _fmt_func_val(f_cls, func_val): # pragma: no cover if func_val is None: return str(None) @@ -193,8 +190,7 @@ def generate_on_mesh( raise ValueError("Field.mesh: mesh dimension too low!") pnts = np.empty((0, mesh_dim), dtype=np.double) for cell in mesh.cells: - cell_points = cell[1] if MESHIO_VERSION < [5, 1] else cell.data - pnt = np.mean(mesh.points[cell_points], axis=1) + pnt = np.mean(mesh.points[cell.data], axis=1) offset.append(pnts.shape[0]) length.append(pnt.shape[0]) pnts = np.vstack((pnts, pnt)) diff --git a/setup.cfg b/setup.cfg index eade3901..677cf450 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,7 +49,7 @@ packages = find: install_requires = emcee>=3.0.0,<4 hankel>=1.0.2,<2 - meshio>=4.0.3,<6 + meshio>=5.1 numpy>=1.14.5,<2 pyevtk>=1.1.1,<2 scipy>=1.1.0,<2 From ea3d7d8f97df4bb5ae0bf086c080dc37191f5d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 09:52:30 +0100 Subject: [PATCH 05/13] examples: minor update --- examples/03_variogram/01_find_best_model.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/03_variogram/01_find_best_model.py b/examples/03_variogram/01_find_best_model.py index a8c62717..c0fc383f 100755 --- a/examples/03_variogram/01_find_best_model.py +++ b/examples/03_variogram/01_find_best_model.py @@ -55,12 +55,9 @@ ############################################################################### # Create a ranking based on the score and determine the best models -ranking = [ - (k, v) - for k, v in sorted(scores.items(), key=lambda item: item[1], reverse=True) -] -print("RANKING") +ranking = sorted(scores.items(), key=lambda item: item[1], reverse=True) +print("RANKING by Pseudo-r2 score") for i, (model, score) in enumerate(ranking, 1): - print(i, model, score) + print(f"{i:>6}. {model:>15}: {score:.5}") plt.show() From f770481f4d1a8e71880a412d7fcfadb0a2a67c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 13:28:09 +0100 Subject: [PATCH 06/13] setup: remove upper caps (bad practice); set meshio to >=4 again --- setup.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index 677cf450..711a3a03 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,12 +47,12 @@ project_urls = [options] packages = find: install_requires = - emcee>=3.0.0,<4 - hankel>=1.0.2,<2 - meshio>=5.1 - numpy>=1.14.5,<2 - pyevtk>=1.1.1,<2 - scipy>=1.1.0,<2 + emcee>=3.0.0 + hankel>=1.0.0 + meshio>=4.0.0 + numpy>=1.14.5 + pyevtk>=1.1.1 + scipy>=1.1.0 python_requires = >=3.6 zip_safe = False From 40c236cdb2dbf2559858bfe0458b00cfb69a13ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 13:28:59 +0100 Subject: [PATCH 07/13] field.tools: check for meshio version since ~4 is needed for py36 --- gstools/field/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gstools/field/tools.py b/gstools/field/tools.py index 86f3fee1..ad954402 100644 --- a/gstools/field/tools.py +++ b/gstools/field/tools.py @@ -22,6 +22,9 @@ __all__ = ["fmt_mean_norm_trend", "to_vtk_helper", "generate_on_mesh"] +MESHIO_VERSION = list(map(int, meshio.__version__.split(".")[:2])) + + def _fmt_func_val(f_cls, func_val): # pragma: no cover if func_val is None: return str(None) @@ -190,7 +193,8 @@ def generate_on_mesh( raise ValueError("Field.mesh: mesh dimension too low!") pnts = np.empty((0, mesh_dim), dtype=np.double) for cell in mesh.cells: - pnt = np.mean(mesh.points[cell.data], axis=1) + cell_points = cell[1] if MESHIO_VERSION < [5, 1] else cell.data + pnt = np.mean(mesh.points[cell_points], axis=1) offset.append(pnts.shape[0]) length.append(pnt.shape[0]) pnts = np.vstack((pnts, pnt)) From be84d5754bee632396d4d1bc78637600a1a77507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 13:29:19 +0100 Subject: [PATCH 08/13] update docs for meshio version again --- README.md | 4 ++-- docs/source/index.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index be643e27..24e06991 100644 --- a/README.md +++ b/README.md @@ -338,10 +338,10 @@ in memory for immediate 3D plotting in Python. - [NumPy >= 1.14.5](https://www.numpy.org) - [SciPy >= 1.1.0](https://www.scipy.org/scipylib) -- [hankel >= 1.0.2](https://github.com/steven-murray/hankel) +- [hankel >= 1.0.0](https://github.com/steven-murray/hankel) - [emcee >= 3.0.0](https://github.com/dfm/emcee) - [pyevtk >= 1.1.1](https://github.com/pyscience-projects/pyevtk) -- [meshio >= 5.1](https://github.com/nschloe/meshio) +- [meshio >= 4.0.0](https://github.com/nschloe/meshio) ### Optional diff --git a/docs/source/index.rst b/docs/source/index.rst index 931f9ed9..f3b4827b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -407,10 +407,10 @@ Requirements - `Numpy >= 1.14.5 `_ - `SciPy >= 1.1.0 `_ -- `hankel >= 1.0.2 `_ +- `hankel >= 1.0.0 `_ - `emcee >= 3.0.0 `_ - `pyevtk >= 1.1.1 `_ -- `meshio >= 5.1 `_ +- `meshio >= 4.0.0 `_ Optional From fe4cd6dc733c43a658df17dbfc24b692718e75d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 12 Jan 2022 16:13:16 +0100 Subject: [PATCH 09/13] Examples: use keyword arguments with pyvista calls --- examples/04_vector_field/01_3d_vector_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/04_vector_field/01_3d_vector_field.py b/examples/04_vector_field/01_3d_vector_field.py index ef1425ad..13d76e87 100755 --- a/examples/04_vector_field/01_3d_vector_field.py +++ b/examples/04_vector_field/01_3d_vector_field.py @@ -16,8 +16,8 @@ ############################################################################### # create a uniform grid with PyVista -dim, spacing, origin = (40, 30, 10), (1, 1, 1), (-10, 0, 0) -mesh = pv.UniformGrid(dim, spacing, origin) +dims, spacing, origin = (40, 30, 10), (1, 1, 1), (-10, 0, 0) +mesh = pv.UniformGrid(dims=dims, spacing=spacing, origin=origin) ############################################################################### # create an incompressible random 3d velocity field on the given mesh From 994379ec05d991e91be9e8a4fc3b0d8ecf84efbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 14 Jan 2022 20:38:29 +0100 Subject: [PATCH 10/13] update cibw to 2.3.1 --- .github/workflows/main.yml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 760d97bf..2501cc9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: fetch-depth: '0' - name: Build wheels - uses: pypa/cibuildwheel@v2.2.2 + uses: pypa/cibuildwheel@v2.3.1 env: CIBW_ARCHS: ${{ matrix.cfg.arch }} with: diff --git a/pyproject.toml b/pyproject.toml index 219f0bb7..d68e4e9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,7 @@ test-command = "pytest -v {package}/tests" # Skip trying to test arm64 builds on Intel Macs test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" -[[tool.cibuildwheel.overrides]] +# [[tool.cibuildwheel.overrides]] # use manylinux2014 for py3.10 -select = "cp310-*" -manylinux-x86_64-image = "manylinux2014" +# select = "cp310-*" +# manylinux-x86_64-image = "manylinux2014" From d6e8831a8573d4de089b8d028b041869caa37da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 14 Jan 2022 22:36:57 +0100 Subject: [PATCH 11/13] CI: try to cap numpy version for wheel tests on ubuntu32bit --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d68e4e9d..45134e35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,7 @@ test-command = "pytest -v {package}/tests" # Skip trying to test arm64 builds on Intel Macs test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" -# [[tool.cibuildwheel.overrides]] -# use manylinux2014 for py3.10 -# select = "cp310-*" -# manylinux-x86_64-image = "manylinux2014" +[[tool.cibuildwheel.overrides]] +select = "*manylinux_i686" +# no wheels for 32 bit anymore +test-requires = "numpy<1.22" From c722882c3d566056bfa2dd5374358596218709f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sat, 15 Jan 2022 15:20:59 +0100 Subject: [PATCH 12/13] CI: try installing numpy<1.22 before testing ubuntu-i686 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 45134e35..4cbceef0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,4 +83,4 @@ test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" [[tool.cibuildwheel.overrides]] select = "*manylinux_i686" # no wheels for 32 bit anymore -test-requires = "numpy<1.22" +before-test = "pip install numpy<1.22" From 73c0de770f6fcf364ac130ffc5ca9337f5903cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Sat, 15 Jan 2022 15:24:13 +0100 Subject: [PATCH 13/13] CI: bugfix pip command --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4cbceef0..4846554b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,4 +83,4 @@ test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" [[tool.cibuildwheel.overrides]] select = "*manylinux_i686" # no wheels for 32 bit anymore -before-test = "pip install numpy<1.22" +before-test = "pip install 'numpy<1.22'"