Skip to content
Open
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
3 changes: 2 additions & 1 deletion xrspatial/tests/test_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def test_natural_breaks_not_enough_unique_values():
agg = input_data()
n_uniques = np.isfinite(agg.data).sum()
k = n_uniques + 1
result_natural_breaks = natural_breaks(agg, k=k)
with pytest.warns(Warning):
result_natural_breaks = natural_breaks(agg, k=k)
n_uniques_result = np.isfinite(result_natural_breaks.data).sum()
np.testing.assert_allclose(n_uniques_result, n_uniques)

Expand Down
2 changes: 1 addition & 1 deletion xrspatial/tests/test_focal.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def data_hotspots():
def test_hotspots_zero_global_std():
data = np.zeros((10, 20))
agg = create_test_raster(data)
kernel = np.zeros((3, 3))
kernel = np.ones((3, 3))
msg = "Standard deviation of the input raster values is 0."
with pytest.raises(ZeroDivisionError, match=msg):
hotspots(agg, kernel)
Expand Down
4 changes: 4 additions & 0 deletions xrspatial/tests/test_pathfinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def test_a_star_search_no_barriers(input_data):
assert np.nanmin(path_agg) == 0


@pytest.mark.filterwarnings("ignore:Start at a non crossable location:Warning")
@pytest.mark.filterwarnings("ignore:End at a non crossable location:Warning")
def test_a_star_search_with_barriers(input_data):
agg = input_data
barriers = [1]
Expand All @@ -92,6 +94,8 @@ def test_a_star_search_with_barriers(input_data):
general_output_checks(agg, path_agg, expected_results)


@pytest.mark.filterwarnings("ignore:Start at a non crossable location:Warning")
@pytest.mark.filterwarnings("ignore:End at a non crossable location:Warning")
def test_a_star_search_snap(input_data_with_nans):
agg, start, goal = input_data_with_nans

Expand Down
3 changes: 2 additions & 1 deletion xrspatial/tests/test_zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ def test_default_stats_dataarray(
assert_input_data_unmodified(data_zones, copied_data_zones)
assert_input_data_unmodified(data_values_2d, copied_data_values_2d)


@pytest.mark.filterwarnings("ignore:All-NaN slice encountered:RuntimeWarning")
@pytest.mark.filterwarnings("ignore:invalid value encountered in divide:RuntimeWarning")
@pytest.mark.parametrize("backend", ['numpy', 'dask+numpy', 'cupy'])
def test_zone_ids_stats(backend, data_zones, data_values_2d, result_zone_ids_stats,
result_zone_ids_stats_no_majority):
Expand Down