From 25f422585bcd8db139784b13a0e8a63bec9872e7 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 5 May 2024 20:28:43 -0800 Subject: [PATCH] Linting --- xdem/dem.py | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/xdem/dem.py b/xdem/dem.py index e58fa456..c235b897 100644 --- a/xdem/dem.py +++ b/xdem/dem.py @@ -259,14 +259,14 @@ def to_vcrs( self, vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] | str | pathlib.Path | VerticalCRS | int, force_source_vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] - | str - | pathlib.Path - | VerticalCRS - | int - | None = None, + | str + | pathlib.Path + | VerticalCRS + | int + | None = None, *, inplace: Literal[False] = False, - ) -> DEM | None: + ) -> DEM: ... @overload @@ -274,14 +274,14 @@ def to_vcrs( self, vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] | str | pathlib.Path | VerticalCRS | int, force_source_vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] - | str - | pathlib.Path - | VerticalCRS - | int - | None = None, + | str + | pathlib.Path + | VerticalCRS + | int + | None = None, *, inplace: Literal[True], - ) -> DEM | None: + ) -> None: ... @overload @@ -289,11 +289,12 @@ def to_vcrs( self, vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] | str | pathlib.Path | VerticalCRS | int, force_source_vcrs: Literal["Ellipsoid", "EGM08", "EGM96"] - | str - | pathlib.Path - | VerticalCRS - | int - | None = None, + | str + | pathlib.Path + | VerticalCRS + | int + | None = None, + *, inplace: bool = False, ) -> DEM | None: ... @@ -359,10 +360,19 @@ def to_vcrs( if inplace: self._data = new_data self.set_vcrs(new_vcrs=vcrs) + return None # Otherwise, return new DEM else: - return DEM.from_array(data=new_data, transform=self.transform, crs=self.crs, nodata=self.nodata, - area_or_point=self.area_or_point, tags=self.tags, vcrs=vcrs, cast_nodata=False) + return DEM.from_array( + data=new_data, + transform=self.transform, + crs=self.crs, + nodata=self.nodata, + area_or_point=self.area_or_point, + tags=self.tags, + vcrs=vcrs, + cast_nodata=False, + ) @copy_doc(terrain, remove_dem_res_params=True) def slope(