Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clip block more. #126

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog of dask-geomodeling
2.5.4 (unreleased)
------------------

- Nothing changed yet.
- Fix clip block when start is None.


2.5.3 (2024-10-28)
Expand Down
4 changes: 3 additions & 1 deletion dask_geomodeling/raster/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def get_sources_and_requests(self, **request):
if period is None:
return [(None, None), (None, None)]

start = request.get("start", period[1])
start = request.get("start")
if start is None:
start = period[1]
stop = request.get("stop")

if stop is not None:
Expand Down
8 changes: 8 additions & 0 deletions dask_geomodeling/tests/test_raster_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ def test_clip_no_temporal_overlap(source, vals_request):
assert clip.get_data(**vals_request) is None


def test_clip_request_start_is_none(source, point_request):
clip = raster.Clip(source, source)
point_request["start"] = None
point_request["stop"] = None
result = clip.get_data(**point_request)["values"].item()
assert result == 255


def test_reclassify(source, vals_request):
view = raster.Reclassify(store=source, data=[[7, 1000]])
data = view.get_data(**vals_request)
Expand Down
Loading