diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 2d1c20ed..1ccdb95c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -23,7 +23,7 @@ jobs: environment-file: ./environment.yml environment-name: ocsmesh-env extra-specs: | - python=3.9 + python=3.* - name: Install dependencies shell: bash -l {0} run: | diff --git a/.github/workflows/functional_test.yml b/.github/workflows/functional_test.yml index b4095c63..064f967a 100644 --- a/.github/workflows/functional_test.yml +++ b/.github/workflows/functional_test.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - python-version: [ '3.7', '3.8', '3.9' ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - uses: actions/checkout@v2 @@ -28,6 +28,7 @@ jobs: - name: Install other dependencies shell: bash -l {0} run: | + pip install packaging # jigsaw dependency in its setup.py python ./setup.py install_jigsaw pip install . diff --git a/.github/workflows/functional_test_2.yml b/.github/workflows/functional_test_2.yml index 1039f8ba..324cbdbb 100644 --- a/.github/workflows/functional_test_2.yml +++ b/.github/workflows/functional_test_2.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - python-version: [ '3.8', '3.9' ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - name: Checkout @@ -31,6 +31,7 @@ jobs: - name: Install packages shell: bash -l {0} run: | + pip install packaging # jigsaw dependency in its setup.py python ./setup.py install_jigsaw pip install . diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 744654eb..ace1b048 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -15,7 +15,7 @@ jobs: environment-file: ./environment.yml environment-name: ocsmesh-env extra-specs: | - python=3.9 + python=3.* - name: Install dependencies shell: bash -l {0} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d69a172..57749ff2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ '3.7', '3.8', '3.9' ] + python-version: [ '3.10' ] steps: - name: checkout repository uses: actions/checkout@v2 diff --git a/environment.yml b/environment.yml index 1ef5fb06..a0c2d3a0 100644 --- a/environment.yml +++ b/environment.yml @@ -2,22 +2,22 @@ name: ocsmesh channels: - conda-forge dependencies: - - python + - python>=3.8, <3.11 # 3.11 not supported by numba - gdal - geos - proj - netcdf4 - udunits2 - pyproj - - shapely>=1.8 + - shapely>=1.8, <2 - rasterio - fiona - pygeos - geopandas - utm - - scipy<1.8 + - scipy - numba - - numpy>=1.21,<1.23 # numpy.typing, scipy 1.7.x support + - numpy>=1.21 # numpy.typing - matplotlib - requests - tqdm diff --git a/ocsmesh/mesh/mesh.py b/ocsmesh/mesh/mesh.py index 7905160b..ea8e2e96 100644 --- a/ocsmesh/mesh/mesh.py +++ b/ocsmesh/mesh/mesh.py @@ -2078,7 +2078,7 @@ def _mesh_interpolate_worker( if method == 'spline': f = RectBivariateSpline( xi, - np.flip(yi), + np.ascontiguousarray(np.flip(yi)), np.flipud(zi).T, kx=3, ky=3, s=0, # bbox=[min(x), max(x), min(y), max(y)] # ?? @@ -2089,7 +2089,7 @@ def _mesh_interpolate_worker( # Inspired by StackOverflow 35807321 if np.any(zi.mask): m_interp = RegularGridInterpolator( - (xi, np.flip(yi)), + (xi, np.ascontiguousarray(np.flip(yi))), np.flipud(zi.mask).T.astype(bool), method=method ) @@ -2097,7 +2097,7 @@ def _mesh_interpolate_worker( interp_mask = m_interp(coords[_idxs]) > 0 f = RegularGridInterpolator( - (xi, np.flip(yi)), + (xi, np.ascontiguousarray(np.flip(yi))), np.flipud(zi).T, method=method ) diff --git a/pyproject.toml b/pyproject.toml index d5382878..f817bd04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,13 +19,12 @@ maintainers = [ description = "Package to generate computational unstructured meshes from planetary modeling." license = {file = "LICENSE"} readme = "README.md" -requires-python = '>=3.7, <3.10' +requires-python = '>=3.8, <3.11' # 3.11 no supported by numba dependencies = [ "colored-traceback", "fiona", "geoalchemy2", "geopandas", "jigsawpy", "matplotlib", "netCDF4", "numba", "numpy>=1.21", # introduce npt.NDArray - "pyarrow", "pygeos", "pyproj>=3.0", "rasterio", "requests", - "scipy<1.8", # dropping python 3.7 + "pyarrow", "pygeos", "pyproj>=3.0", "rasterio", "requests", "scipy", "shapely>=1.8, <2", "tqdm", "typing_extensions", "utm", ] dynamic = ["version"] diff --git a/tests/api/hfun.py b/tests/api/hfun.py index 98030d7f..900c8e4a 100755 --- a/tests/api/hfun.py +++ b/tests/api/hfun.py @@ -410,7 +410,7 @@ def test_hfun_coll_cfl_constraint(self): # Fast method is much less accurate! method_tolerance = { 'exact': 0.03, - 'fast': 0.1 + 'fast': 0.2 } for method, tol in method_tolerance.items(): @@ -565,7 +565,7 @@ def _check_applied_refinement(self, msh_t, refine_gdf, target_size): rest_msh_t.size_from_mesh() rest_avg = np.mean(rest_msh_t.msh_t().value) - self.assertTrue(np.isclose(refine_avg, target_size, rtol=1e-1)) + self.assertTrue(np.isclose(refine_avg, target_size, rtol=3e-1)) self.assertTrue(rest_avg > target_size * 10) def _is_refined_by_shape1(self, hfun, target_size): @@ -576,7 +576,7 @@ def _is_refined_by_shape1(self, hfun, target_size): gdf_feature = gpd.GeoDataFrame( geometry=[self.shape1], crs=4326 ) - gdf_clip = gdf_feature.to_crs(hfun_msh_t.crs).buffer(target_size) + gdf_clip = gdf_feature.to_crs(hfun_msh_t.crs).buffer(target_size*1.1) self._check_applied_refinement(hfun_msh_t, gdf_clip, target_size) @@ -586,7 +586,7 @@ def _is_refined_by_feat1(self, hfun, target_size): # Nodes close to the feature line must be small gdf_feature = gpd.read_file(self.feat1) - gdf_clip = gdf_feature.to_crs(hfun_msh_t.crs).buffer(target_size) + gdf_clip = gdf_feature.to_crs(hfun_msh_t.crs).buffer(target_size*1.1) self._check_applied_refinement(hfun_msh_t, gdf_clip, target_size) def _is_refined_by_feat2(self, hfun, target_size):