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/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 diff --git a/README.md b/README.md index f68e49a9..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>=4.0.3, <5.0](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 8ead5056..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>=4.0.3, <5.0 `_ +- `meshio >= 4.0.0 `_ Optional 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() 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 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)) diff --git a/pyproject.toml b/pyproject.toml index 219f0bb7..4846554b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,6 +81,6 @@ test-command = "pytest -v {package}/tests" test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" [[tool.cibuildwheel.overrides]] -# use manylinux2014 for py3.10 -select = "cp310-*" -manylinux-x86_64-image = "manylinux2014" +select = "*manylinux_i686" +# no wheels for 32 bit anymore +before-test = "pip install 'numpy<1.22'" diff --git a/setup.cfg b/setup.cfg index eade3901..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>=4.0.3,<6 - 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