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

copy of #639 PR: add/fix missing tests annotations, cleanup requirements.txt #640

Merged
merged 8 commits into from
Jul 25, 2024
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
Changelog
#########

---------------------
2024.7.1 - 2024-07-25
---------------------

* core

* fix annotation of `test/test_io_raster.py::test_read_raster` and split it into `test/test_io_raster.py::test_read_raster` and `test/test_io_raster.py::test_read_remote_raster`
* in `mapchete.geometry.types` try using `geojson-pydantic`

* packaging
* replace `pydantic-geojson` with `geojson-pydantic`

* align dependencies `requirements.txt`, `requirements-dev.txt` with `pyproject.toml` with `hatch` package

* `hatch dep show requirements --all`
* `hatch dep show requirements --all >> requirements.txt`

* `requrements-dev.txt` still need to be managed manually when required

---------------------
2024.7.0 - 2024-07-24
Expand Down
2 changes: 1 addition & 1 deletion mapchete/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"VectorInput",
"VectorInputGroup",
]
__version__ = "2024.7.0"
__version__ = "2024.7.1"

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
Expand Down
2 changes: 1 addition & 1 deletion mapchete/geometry/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
runtime_checkable,
)

from pydantic_geojson import GeometryType as GeoJSONGeometryType
from geojson_pydantic import FeatureCollection as GeoJSONGeometryType
from shapely.geometry import (
GeometryCollection,
LinearRing,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ dependencies = [
"distributed",
"fiona>=1.8.13.post1",
"fsspec",
"geojson-pydantic",
"importlib-metadata",
"importlib-resources",
"numpy>=1.16",
"oyaml",
"pydantic>=2.3.0",
"pydantic-geojson",
"pydantic_settings>=2.0.0",
"pyproj",
"python-dateutil",
Expand Down
49 changes: 29 additions & 20 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
aiobotocore>=1.1.2
aiohttp>=3.6.2
aioitertools>=0.7.0
aiohttp
boto3>=1.14.44
cachetools>=4.1.0
cachetools
click-plugins
click-spinner
click>=7.1.1
click-plugins>=1.1.1
click-spinner>=0.1.10
dask
distributed
python-dateutil
fiona>=1.8.13.post1
Flask>=1.1.2,<=3.0.0
Flask-RangeRequest>=0.0.2
flask-rangerequest
flask<3.0.0
fsspec
fsspec[http,s3]>=2023.12.0
importlib-metadata>=1.6.0
importlib-resources>=1.5.0
lxml>=4.5.0
matplotlib>=3.2.1
fsspec[http]
fsspec[s3]
geojson-pydantic
importlib-metadata
importlib-resources
lxml
matplotlib
memray
numpy>=1.16
oyaml>=0.9
pyproj
oyaml
pydantic-settings>=2.0.0
pydantic>=2.3.0
pydantic_settings>=2.0.0
retry>=0.9.2
pyproj
pystac-client>=0.7.2
pystac[urllib3]>=1.8.2
python-dateutil
rasterio>1.2.10
s3fs>2023.9.0
Shapely>=2.0.0
requests
retry
rtree
s3fs!=2023.9.0
shapely>=2.0.0
tilebench
tilematrix>=2022.12.0
tqdm>=4.46.0
werkzeug>=0.15
tqdm
werkzeug>=0.15
18 changes: 15 additions & 3 deletions test/test_io_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,6 @@ def test_read_raster_window_aws_s3(path, grid, pixelbuffer, zoom):
@pytest.mark.parametrize(
"path",
[
lazy_fixture("raster_4band_s3"),
lazy_fixture("raster_4band_http"),
lazy_fixture("raster_4band_secure_http"),
lazy_fixture("raster_4band"),
lazy_fixture("stacta"),
],
Expand All @@ -1069,6 +1066,21 @@ def test_read_raster(path):
assert not rr.data.mask.all()


@pytest.mark.integration
@pytest.mark.parametrize(
"path",
[
lazy_fixture("raster_4band_s3"),
lazy_fixture("raster_4band_http"),
lazy_fixture("raster_4band_secure_http"),
],
)
def test_read_remote_raster(path):
rr = read_raster(path)
assert isinstance(rr, ReferencedRaster)
assert not rr.data.mask.all()


@pytest.mark.parametrize("masked", [True, False])
@pytest.mark.parametrize("grid", [lazy_fixture("s2_band_tile")])
def test_read_raster_args(s2_band, masked, grid):
Expand Down
Loading