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

COMPAT: fix compatibility with scipy 1.15 #221

Merged
merged 1 commit into from
Jan 14, 2025
Merged
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
7 changes: 4 additions & 3 deletions tobler/area_weighted/area_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

from tobler.util.util import _check_crs, _inf_check, _nan_check

__all__ = ['area_interpolate']
__all__ = ["area_interpolate"]

Check warning on line 15 in tobler/area_weighted/area_interpolate.py

View check run for this annotation

Codecov / codecov/patch

tobler/area_weighted/area_interpolate.py#L15

Added line #L15 was not covered by tests


def _chunk_dfs(geoms_to_chunk, geoms_full, n_jobs):
chunk_size = geoms_to_chunk.shape[0] // n_jobs + 1
Expand Down Expand Up @@ -250,7 +251,7 @@
- "source": build the spatial index on `source_df`
- "target": build the spatial index on `target_df`
- "auto": attempts to guess the most efficient alternative.

Currently, this option uses the largest table to build the
index, and performs a `bulk_query` on the shorter table.
This argument is ignored if n_jobs>1 (or n_jobs=-1).
Expand Down Expand Up @@ -370,7 +371,7 @@
for value in unique:
mask = source_df[variable] == value
categorical[f"{variable}_{value}"] = np.asarray(
table[mask].sum(axis=0)
table[mask.to_numpy()].sum(axis=0)
)[0]

categorical = pd.DataFrame(categorical)
Expand Down
Loading