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 raven-wps CLI entrypoint #475

Merged
merged 6 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ jobs:
python=${{ matrix.python-version }}
- name: Conda and Mamba versions
run: |
micromamba --version
echo "mircomamba $(micromamba --version)"
conda --version
- name: Install RavenWPS
run: |
pip install -e ".[dev]"
python3 -m pip install -e ".[dev]"
- name: List installed packages
run: |
conda list
- name: Test RavenPy
run: |
pytest tests
python3 -m pytest tests

finish:
name: Finish
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ dependencies = [
# GIS libraries
"affine",
"fiona>=1.9.0,<2.0",
"gdal",
"geojson",
"geopandas",
"pyproj>=3.4",
Expand Down Expand Up @@ -113,7 +112,7 @@ docs = [
]

[project.scripts]
raven = "raven.cli:cli"
raven-wps = "raven.cli:cli"

[project.urls]
"Homepage" = "https://pavics-raven.readthedocs.io/"
Expand Down
18 changes: 9 additions & 9 deletions tests/test_wps_generic_shape_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def test_simple(self):
props = json.loads(out["properties"])
assert {"centroid", "area", "perimeter", "gravelius"}.issubset(props[0].keys())

np.testing.assert_allclose(props[0]["perimeter"], 673431, atol=1)
np.testing.assert_approx_equal(props[0]["area"], 6258366698.5253, 4)
np.testing.assert_approx_equal(props[0]["centroid"][0], -73.41117680)
np.testing.assert_approx_equal(props[0]["centroid"][1], 46.46286765)
np.testing.assert_approx_equal(props[0]["perimeter"], 673430.9089454)
np.testing.assert_approx_equal(props[0]["gravelius"], 2.4013618703)

def test_geographic_epsg(self):
Expand Down Expand Up @@ -161,16 +161,16 @@ def test_multifeature_geojson(self, get_local_testdata):
props[i].keys()
)

np.testing.assert_approx_equal(props[0]["area"], 111417901.6141605)
np.testing.assert_allclose(props[0]["area"], 111417901, atol=1)
np.testing.assert_approx_equal(props[0]["centroid"][0], -71.8223648)
np.testing.assert_approx_equal(props[0]["centroid"][1], 48.8974365)
np.testing.assert_approx_equal(props[0]["perimeter"], 46351.1628725)
np.testing.assert_approx_equal(props[0]["gravelius"], 1.2387344)
np.testing.assert_approx_equal(props[0]["perimeter"], 46351.1628725)

np.testing.assert_approx_equal(props[-1]["area"], 334136117.9693527)
np.testing.assert_allclose(props[-1]["area"], 334136220, atol=100)
np.testing.assert_allclose(props[-1]["perimeter"], 92477.3, atol=0.1)
np.testing.assert_approx_equal(props[-1]["centroid"][0], -72.6117018)
np.testing.assert_approx_equal(props[-1]["centroid"][1], 46.3632907)
np.testing.assert_approx_equal(props[-1]["perimeter"], 92477.2915962)
np.testing.assert_approx_equal(props[-1]["gravelius"], 1.4271461)

def test_multifeature_zipped_shapefile(self, get_local_testdata):
Expand Down Expand Up @@ -210,14 +210,14 @@ def test_multifeature_zipped_shapefile(self, get_local_testdata):
props[i].keys()
)

np.testing.assert_approx_equal(props[0]["area"], 111417901.6141605)
np.testing.assert_allclose(props[0]["area"], 111417901, atol=1)
np.testing.assert_approx_equal(props[0]["centroid"][0], -71.8223648)
np.testing.assert_approx_equal(props[0]["centroid"][1], 48.8974365)
np.testing.assert_approx_equal(props[0]["perimeter"], 46351.1628725)
np.testing.assert_approx_equal(props[0]["gravelius"], 1.2387344)
np.testing.assert_approx_equal(props[0]["perimeter"], 46351.1628725)

np.testing.assert_approx_equal(props[-1]["area"], 334136117.9693527)
np.testing.assert_allclose(props[-1]["area"], 334136220, atol=1)
np.testing.assert_allclose(props[-1]["perimeter"], 92477.3, atol=0.1)
np.testing.assert_approx_equal(props[-1]["centroid"][0], -72.6117018)
np.testing.assert_approx_equal(props[-1]["centroid"][1], 46.3632907)
np.testing.assert_approx_equal(props[-1]["perimeter"], 92477.2915962)
np.testing.assert_approx_equal(props[-1]["gravelius"], 1.4271461)