Skip to content

Commit

Permalink
if the Rasterizer gets chunks = None it will init the Loader with chu…
Browse files Browse the repository at this point in the history
…nks = auto and then load only the rasterized data into memory.
  • Loading branch information
bnb32 committed Nov 4, 2024
1 parent 3160ec6 commit ce930a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sup3r/preprocessing/rasterizers/extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ def __init__(
"""
self.raster_file = raster_file
self.max_delta = max_delta
preload = chunks is None
self.loader = Loader(
file_paths,
features=features,
res_kwargs=res_kwargs,
chunks=chunks,
chunks='auto' if preload else chunks,
BaseLoader=BaseLoader,
)
super().__init__(
Expand All @@ -108,6 +109,9 @@ def __init__(
):
self.save_raster_index()

if preload:
self.data.compute()

def rasterize_data(self):
"""Get rasterized data."""
if not self.loader.flattened:
Expand Down

0 comments on commit ce930a7

Please sign in to comment.