Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed May 6, 2024
1 parent 719ac1c commit 25f4225
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions xdem/dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,41 +259,42 @@ 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
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
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:
...
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 25f4225

Please sign in to comment.