From 38d56f5ef243485e12bb1ca10f33c1cb6cb5c7ed Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:33:04 +0200 Subject: [PATCH 1/7] updated meshkernel is_geometric to projection --- pyproject.toml | 2 +- xugrid/ugrid/ugrid1d.py | 2 +- xugrid/ugrid/ugrid2d.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 20dc71825..a84a6fd8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ all = [ 'geopandas', 'mapbox_earcut', 'matplotlib', - 'meshkernel', + 'meshkernel >= 3.0.0', 'netcdf4', 'pooch', 'shapely >= 2.0', diff --git a/xugrid/ugrid/ugrid1d.py b/xugrid/ugrid/ugrid1d.py index 60f7c4c65..87e715b7a 100644 --- a/xugrid/ugrid/ugrid1d.py +++ b/xugrid/ugrid/ugrid1d.py @@ -291,7 +291,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel(is_geographic=False) + self._meshkernel = mk.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) self._meshkernel.mesh1d_set(self.mesh) return self._meshkernel diff --git a/xugrid/ugrid/ugrid2d.py b/xugrid/ugrid/ugrid2d.py index ff11fba1f..92c68b390 100644 --- a/xugrid/ugrid/ugrid2d.py +++ b/xugrid/ugrid/ugrid2d.py @@ -702,7 +702,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel(is_geographic=False) + self._meshkernel = mk.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) self._meshkernel.mesh2d_set(self.mesh) return self._meshkernel From 10500f3de8f6bd30432e5e8e18e2aea5325080ed Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:24:27 +0200 Subject: [PATCH 2/7] updated is_geographic to projection in tests init --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index bf8a1ee2f..228585c66 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -10,7 +10,7 @@ def _importorskip(modname): # If the DLL/SO fails to load / be found, still skip. try: - meshkernel.MeshKernel(is_geographic=False) + meshkernel.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) has = True except OSError: has = False From e8e5b35ba8652ee54cd4bb91d03684c3d0a56f99 Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:27:17 +0200 Subject: [PATCH 3/7] fixed linting --- tests/__init__.py | 4 +++- xugrid/ugrid/ugrid1d.py | 4 +++- xugrid/ugrid/ugrid2d.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 228585c66..1fabe5ee2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -10,7 +10,9 @@ def _importorskip(modname): # If the DLL/SO fails to load / be found, still skip. try: - meshkernel.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) + meshkernel.MeshKernel( + projection=meshkernel.ProjectionType.CARTESIAN + ) has = True except OSError: has = False diff --git a/xugrid/ugrid/ugrid1d.py b/xugrid/ugrid/ugrid1d.py index 87e715b7a..6ad51b92c 100644 --- a/xugrid/ugrid/ugrid1d.py +++ b/xugrid/ugrid/ugrid1d.py @@ -291,7 +291,9 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) + self._meshkernel = mk.MeshKernel( + projection=meshkernel.ProjectionType.CARTESIAN + ) self._meshkernel.mesh1d_set(self.mesh) return self._meshkernel diff --git a/xugrid/ugrid/ugrid2d.py b/xugrid/ugrid/ugrid2d.py index 92c68b390..0f3da1dcc 100644 --- a/xugrid/ugrid/ugrid2d.py +++ b/xugrid/ugrid/ugrid2d.py @@ -702,7 +702,9 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) + self._meshkernel = mk.MeshKernel( + projection=meshkernel.ProjectionType.CARTESIAN + ) self._meshkernel.mesh2d_set(self.mesh) return self._meshkernel From 97fdcbea107b8e9bf8231f5c2f75913e1163d41c Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:34:52 +0200 Subject: [PATCH 4/7] undo --- tests/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 1fabe5ee2..228585c66 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -10,9 +10,7 @@ def _importorskip(modname): # If the DLL/SO fails to load / be found, still skip. try: - meshkernel.MeshKernel( - projection=meshkernel.ProjectionType.CARTESIAN - ) + meshkernel.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) has = True except OSError: has = False From 3bc3e34c341ee506f88f34e98a126fcb61bc7e7a Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:37:22 +0200 Subject: [PATCH 5/7] fixed import --- xugrid/ugrid/ugrid1d.py | 2 +- xugrid/ugrid/ugrid2d.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xugrid/ugrid/ugrid1d.py b/xugrid/ugrid/ugrid1d.py index 6ad51b92c..9b08b95b5 100644 --- a/xugrid/ugrid/ugrid1d.py +++ b/xugrid/ugrid/ugrid1d.py @@ -292,7 +292,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa if self._meshkernel is None: self._meshkernel = mk.MeshKernel( - projection=meshkernel.ProjectionType.CARTESIAN + projection=mk.ProjectionType.CARTESIAN ) self._meshkernel.mesh1d_set(self.mesh) return self._meshkernel diff --git a/xugrid/ugrid/ugrid2d.py b/xugrid/ugrid/ugrid2d.py index 0f3da1dcc..485635904 100644 --- a/xugrid/ugrid/ugrid2d.py +++ b/xugrid/ugrid/ugrid2d.py @@ -703,7 +703,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa if self._meshkernel is None: self._meshkernel = mk.MeshKernel( - projection=meshkernel.ProjectionType.CARTESIAN + projection=mk.ProjectionType.CARTESIAN ) self._meshkernel.mesh2d_set(self.mesh) return self._meshkernel From e378cf776b73c4caafaaa63d4068098ab813efba Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:39:28 +0200 Subject: [PATCH 6/7] linting --- xugrid/ugrid/ugrid1d.py | 4 +--- xugrid/ugrid/ugrid2d.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/xugrid/ugrid/ugrid1d.py b/xugrid/ugrid/ugrid1d.py index 9b08b95b5..463d90884 100644 --- a/xugrid/ugrid/ugrid1d.py +++ b/xugrid/ugrid/ugrid1d.py @@ -291,9 +291,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel( - projection=mk.ProjectionType.CARTESIAN - ) + self._meshkernel = mk.MeshKernel(projection=mk.ProjectionType.CARTESIAN) self._meshkernel.mesh1d_set(self.mesh) return self._meshkernel diff --git a/xugrid/ugrid/ugrid2d.py b/xugrid/ugrid/ugrid2d.py index 485635904..47940e7e7 100644 --- a/xugrid/ugrid/ugrid2d.py +++ b/xugrid/ugrid/ugrid2d.py @@ -702,9 +702,7 @@ def meshkernel(self) -> "mk.MeshKernel": # type: ignore # noqa import meshkernel as mk if self._meshkernel is None: - self._meshkernel = mk.MeshKernel( - projection=mk.ProjectionType.CARTESIAN - ) + self._meshkernel = mk.MeshKernel(projection=mk.ProjectionType.CARTESIAN) self._meshkernel.mesh2d_set(self.mesh) return self._meshkernel From ac199713829cf7bd470a703779cb48dc4619c864 Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:40:40 +0100 Subject: [PATCH 7/7] removed optional argument from meshkernel availability check --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 228585c66..f80bfbc49 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -10,7 +10,7 @@ def _importorskip(modname): # If the DLL/SO fails to load / be found, still skip. try: - meshkernel.MeshKernel(projection=meshkernel.ProjectionType.CARTESIAN) + meshkernel.MeshKernel() has = True except OSError: has = False