rastr 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rastr-0.7.0 → rastr-0.7.1}/PKG-INFO +2 -2
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/_version.py +2 -2
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/gis/smooth.py +6 -2
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/gis/test_smooth.py +15 -0
- {rastr-0.7.0 → rastr-0.7.1}/.copier-answers.yml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.github/ISSUE_TEMPLATE/enhancement.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.github/copilot-instructions.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.github/workflows/ci.yml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.github/workflows/release.yml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.gitignore +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.pre-commit-config.yaml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/.python-version +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/CONTRIBUTING.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/LICENSE +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/README.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/docs/index.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/docs/logo.svg +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/mkdocs.yml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/pyproject.toml +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/pyrightconfig.json +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/requirements.txt +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/archive/.gitkeep +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/notebooks/.gitkeep +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/__init__.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/arr/__init__.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/arr/fill.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/create.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/gis/__init__.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/gis/crs.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/gis/fishnet.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/gis/interpolate.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/io.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/meta.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/rastr/raster.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/scripts/.gitkeep +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/scripts/demo_point_cloud.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/src/scripts/demo_taper_border.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/ABOUT_TASKS.md +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/dev_sync.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/activate_venv.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/configure_project.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/dev_sync.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/install_backend.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/install_venv.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/recover_corrupt_venv.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/sh_runner.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/sync_requirements.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/scripts/sync_template.sh +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/activate_venv +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/activate_venv.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/activate_venv.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/configure_project +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/configure_project.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/configure_project.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/dev_sync +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/dev_sync.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/dev_sync.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_backend +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_backend.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_backend.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_venv +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_venv.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/install_venv.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/recover_corrupt_venv +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/recover_corrupt_venv.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/recover_corrupt_venv.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_requirements +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_requirements.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_requirements.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_template +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_template.cmd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/shims/sync_template.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tasks/sync_template.ps1 +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/assets/.gitkeep +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/assets/pga_g_clipped.grd +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/assets/pga_g_clipped.tif +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/conftest.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/.gitkeep +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/gis/test_crs.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/gis/test_fishnet.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/regression_test_data/test_plot_raster.png +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/regression_test_data/test_write_raster_to_file.tif +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/test_create.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/test_io.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/test_meta.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/tests/rastr/test_raster.py +0 -0
- {rastr-0.7.0 → rastr-0.7.1}/uv.lock +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rastr
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Geospatial Raster datatype library for Python.
|
|
5
5
|
Project-URL: Source Code, https://github.com/tonkintaylor/rastr
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/tonkintaylor/rastr/issues
|
|
7
7
|
Project-URL: Releases, https://github.com/tonkintaylor/rastr/releases
|
|
8
|
-
Project-URL: Source Archive, https://github.com/tonkintaylor/rastr/archive/
|
|
8
|
+
Project-URL: Source Archive, https://github.com/tonkintaylor/rastr/archive/f84ab299005d87e37339d53759e005e85c9e5ad2.zip
|
|
9
9
|
Author-email: Tonkin & Taylor Limited <Sub-DisciplineData+AnalyticsStaff@tonkintaylor.co.nz>, Nathan McDougall <nmcdougall@tonkintaylor.co.nz>, Ben Karl <bkarl@tonkintaylor.co.nz>
|
|
10
10
|
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.7.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 7,
|
|
31
|
+
__version__ = version = '0.7.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 7, 1)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -132,10 +132,14 @@ def _recursive_eval(slice4: NDArray, tangents: NDArray, ts: NDArray) -> NDArray:
|
|
|
132
132
|
for r in range(1, 4):
|
|
133
133
|
idx = max(r - 2, 0)
|
|
134
134
|
denom = tangents[r - idx : 4 - idx] - tangents[idx : 4 - r + idx]
|
|
135
|
-
denom = np.where(denom == 0, np.finfo(float).eps, denom) # avoid div 0
|
|
136
135
|
|
|
137
136
|
# Compute weights for all parameter values at once
|
|
138
|
-
|
|
137
|
+
with np.errstate(divide="ignore", invalid="ignore"):
|
|
138
|
+
left_w = (tangents[r - idx : 4 - idx][None, :] - ts[:, None]) / denom
|
|
139
|
+
|
|
140
|
+
left_w[:, denom == 0] = (
|
|
141
|
+
0.5 # Use 0.5 (midpoint) when points are identical (zero denominator)
|
|
142
|
+
)
|
|
139
143
|
right_w = 1 - left_w
|
|
140
144
|
|
|
141
145
|
# Weighted sums between consecutive points
|
|
@@ -174,3 +174,18 @@ class TestRecursiveEval:
|
|
|
174
174
|
# Assert
|
|
175
175
|
assert result.shape == (1, 2)
|
|
176
176
|
assert np.allclose(result, np.array([[0.0, 0.0]]))
|
|
177
|
+
|
|
178
|
+
def test_denom_zero_non_edge_point(self):
|
|
179
|
+
# To address regression in https://github.com/tonkintaylor/rastr/issues/276
|
|
180
|
+
|
|
181
|
+
# Arrange
|
|
182
|
+
coords = np.array([[0.0, 0.0], [1.0, 1.0], [1.0, 1.0], [2.0, 0.0]])
|
|
183
|
+
# This will force denom == 0 in _recursive_eval for the middle segment
|
|
184
|
+
|
|
185
|
+
# Act
|
|
186
|
+
result = _recursive_eval(
|
|
187
|
+
coords, np.asarray([0.0, 1.0, 1.0, 2.0]), np.array([0.5])
|
|
188
|
+
)
|
|
189
|
+
# Assert
|
|
190
|
+
assert result.shape == (1, 2)
|
|
191
|
+
assert np.allclose(result, np.array([[1.0, 0.75]]))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|