Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Dec 6, 2024
1 parent eca4e76 commit e0ddb7b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
19 changes: 10 additions & 9 deletions geoutils/pointcloud/pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import geoutils as gu
from geoutils._typing import ArrayLike, NDArrayNum, Number
from geoutils.interface.gridding import _grid_pointcloud
from geoutils.raster.sampling import subsample_array

# from geoutils.raster.sampling import subsample_array

try:
import laspy
Expand Down Expand Up @@ -113,7 +114,7 @@ def __init__(
self._crs: CRS | None = None
self._bounds: BoundingBox
self._data_column: str
self._data: np.ndarray
self._data: NDArrayNum
self._nb_points: int
self._all_columns: pd.Index

Expand Down Expand Up @@ -377,13 +378,13 @@ def grid(

return gu.Raster.from_array(data=array, transform=transform, crs=self.crs, nodata=None)

def subsample(self, subsample: float | int, random_state: int | np.random.Generator | None = None) -> PointCloud:

indices = subsample_array(
array=self.ds[self.data_column].values, subsample=subsample, return_indices=True, random_state=random_state
)

return PointCloud(self.ds[indices])
# def subsample(self, subsample: float | int, random_state: int | np.random.Generator | None = None) -> PointCloud:
#
# indices = subsample_array(
# array=self.data, subsample=subsample, return_indices=True, random_state=random_state
# )
#
# return PointCloud(self.ds[indices])

# @classmethod
# def from_raster(cls, raster: gu.Raster) -> PointCloud:
Expand Down
21 changes: 11 additions & 10 deletions geoutils/raster/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3391,16 +3391,17 @@ def to_pointcloud(
"""

return _raster_to_pointcloud(
source_raster=self,
data_column_name=data_column_name,
data_band=data_band,
auxiliary_data_bands=auxiliary_data_bands,
auxiliary_column_names=auxiliary_column_names,
subsample=subsample,
skip_nodata=skip_nodata,
as_array=as_array,
random_state=random_state,
force_pixel_offset=force_pixel_offset)
source_raster=self,
data_column_name=data_column_name,
data_band=data_band,
auxiliary_data_bands=auxiliary_data_bands,
auxiliary_column_names=auxiliary_column_names,
subsample=subsample,
skip_nodata=skip_nodata,
as_array=as_array,
random_state=random_state,
force_pixel_offset=force_pixel_offset,
)

@classmethod
def from_pointcloud_regular(
Expand Down

0 comments on commit e0ddb7b

Please sign in to comment.