-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document & refactor
artifacts.get_artifacts()
(#103)
* docment & refactor artifacts.get_artifacts() * exclude mask should be GeoSeries
- Loading branch information
Showing
2 changed files
with
120 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pathlib | ||
|
||
import geopandas | ||
import pytest | ||
|
||
import sgeop | ||
|
||
|
||
def test_get_artifacts_error(): | ||
path = pathlib.Path("sgeop", "tests", "data", "apalachicola_original.parquet") | ||
with pytest.raises( # noqa: SIM117 | ||
ValueError, | ||
match=( | ||
"No threshold for artifact detection found. Pass explicit " | ||
"`threshold` or `threshold_fallback` to provide the value directly." | ||
), | ||
): | ||
with pytest.warns( | ||
UserWarning, | ||
match=( | ||
"Input roads could not not be polygonized. " | ||
"Identification of face artifacts not possible." | ||
), | ||
): | ||
sgeop.artifacts.get_artifacts(geopandas.read_parquet(path).iloc[:3]) |