Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Jun 25, 2024
2 parents 47d0e7c + 79cf4dc commit 9d4e25a
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Install Python
uses: actions/setup-python@v2
with:
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release history

## 3.7.0b1 (2024-06-25)

- Update to `eodag v3` search api [(#153)](https://github.com/CS-SI/eodag-labextension/pull/153)
- Update to `eodag v3` imports [(#148)](https://github.com/CS-SI/eodag-labextension/pull/148)
- `pytest` version pinned [(#150)](https://github.com/CS-SI/eodag-labextension/pull/150)
- Updates dependencies and developement tools versions [(#147)](https://github.com/CS-SI/eodag-labextension/pull/147)
[(#148)](https://github.com/CS-SI/eodag-labextension/pull/148)[(#151)](https://github.com/CS-SI/eodag-labextension/pull/151)
[(#152)](https://github.com/CS-SI/eodag-labextension/pull/152)

## 3.6.0 (2024-03-04)

- New `reload eodag environment` button [(#139)](https://github.com/CS-SI/eodag-labextension/pull/139)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ setup_logging(1) # 0: nothing, 1: only progress bars, 2: INFO, 3: DEBUG

dag = EODataAccessGateway()
geometry = "POLYGON ((0.550136 43.005451, 0.550136 44.151469, 2.572104 44.151469, 2.572104 43.005451, 0.550136 43.005451))"
search_results, total_count = dag.search(
search_results = dag.search(
productType="S2_MSI_L1C",
geom=geometry,
start="2021-08-01",
Expand Down
14 changes: 7 additions & 7 deletions eodag_labextension/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import tornado
from eodag import EODataAccessGateway, SearchResult
from eodag.api.core import DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE
from eodag.rest.utils import get_datetime
from eodag.utils import parse_qs
from eodag.utils.exceptions import (
AuthenticationError,
Expand All @@ -20,6 +19,7 @@
UnsupportedProvider,
ValidationError,
)
from eodag.utils.rest import get_datetime
from jupyter_server.base.handlers import APIHandler
from jupyter_server.utils import url_path_join
from shapely.geometry import shape
Expand Down Expand Up @@ -131,8 +131,8 @@ def get(self):
provider = query_dict.pop("provider")[0]
provider = None if not provider or provider == "null" else provider

returned_product_types = []
try:
returned_product_types = []
# fetch all product types
all_product_types = eodag_api.list_product_types(provider=provider)

Expand All @@ -156,9 +156,9 @@ def get(self):

# 3. Append guessed product types
guess_kwargs = {}
# ["aa bb", "cc-dd_ee"] to "*aa* *bb* *cc* **dd* *ee*"
# ["aa bb", "cc-dd_ee"] to "*aa* AND *bb* AND *cc-dd_ee*"
for k, v in query_dict.items():
guess_kwargs[k] = re.sub(r"(\S+)", r"*\1*", " ".join(v).replace("-", " ").replace("_", " "))
guess_kwargs[k] = " AND ".join(re.sub(r"(\S+)", r"*\1*", " ".join(v)).split(" "))

# guessed product types ids
guessed_ids_list = eodag_api.guess_product_type(**guess_kwargs)
Expand All @@ -173,7 +173,7 @@ def get(self):

self.write(orjson.dumps(returned_product_types))
except NoMatchingProductType:
self.write(orjson.dumps([]))
self.write(orjson.dumps(returned_product_types))
except UnsupportedProvider as e:
self.set_status(400)
self.finish({"error": str(e)})
Expand Down Expand Up @@ -215,7 +215,7 @@ def post(self, product_type):
arguments = dict((k, v) for k, v in arguments.items() if v is not None)

try:
products, total = eodag_api.search(productType=product_type, **arguments)
products = eodag_api.search(productType=product_type, count=True, **arguments)
except ValidationError as e:
self.set_status(400)
self.finish({"error": e.message})
Expand Down Expand Up @@ -243,7 +243,7 @@ def post(self, product_type):
"properties": {
"page": int(arguments.get("page", DEFAULT_PAGE)),
"itemsPerPage": DEFAULT_ITEMS_PER_PAGE,
"totalResults": total,
"totalResults": products.number_matched,
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion notebooks/user_manual.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"\n",
"dag = EODataAccessGateway()\n",
"geometry = \"POLYGON ((0.550136 43.005451, 0.550136 44.151469, 2.572104 44.151469, 2.572104 43.005451, 0.550136 43.005451))\"\n",
"search_results, total_count = dag.search(\n",
"search_results = dag.search(\n",
" productType=\"S2_MSI_L1C\",\n",
" geom=geometry,\n",
" start=\"2022-11-01\",\n",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eodag-labextension",
"version": "3.6.0",
"version": "3.7.0b1",
"description": "Searching remote sensed imagery from various image providers",
"keywords": [
"jupyter",
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@
"jupyterlab~=3.0",
"tornado>=6.0.3,<7.0.0",
"notebook>=6.0.3,<7.0.0",
"eodag[notebook]>=2.8.0",
"eodag[notebook]>=3.0.0b1",
"orjson",
],
extras_require={"dev": ["black", "pre-commit", "pytest", "shapely"]},
extras_require={
"dev": [
"black",
"pre-commit",
# pytest pinned until https://github.com/pytest-dev/pytest/issues/12263 is fixes
"pytest < 8.2.0",
"shapely",
]
},
zip_safe=False,
include_package_data=True,
python_requires=">=3.8",
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ${standardMessage}`
geometry = "${geojsonToWKT(geometry)}"`;
}
code += `
search_results, total_count = dag.search(`;
search_results = dag.search(`;
if (provider) {
code += `
provider="${provider}",`;
Expand Down
4 changes: 3 additions & 1 deletion tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_get_not_found(self):
def test_post_not_found(self):
self.fetch_results_error("/eodag/foo/bar", 404, method="POST", body=json.dumps({}))

@mock.patch("eodag.api.core.EODataAccessGateway.search", autospec=True, return_value=(SearchResult([]), 0))
@mock.patch("eodag.api.core.EODataAccessGateway.search", autospec=True, return_value=SearchResult([], 0))
def test_search(self, mock_search):
geom_dict = {
"type": "Polygon",
Expand Down Expand Up @@ -181,6 +181,7 @@ def test_search(self, mock_search):
cloudCover=50,
foo="bar",
provider="cop_dataspace",
count=True,
)
self.assertDictEqual(
result,
Expand All @@ -205,6 +206,7 @@ def test_search(self, mock_search):
mock_search.assert_called_once_with(
mock.ANY,
productType="S2_MSI_L1C",
count=True,
)

# date error
Expand Down
41 changes: 23 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2328,11 +2328,11 @@ brace-expansion@^2.0.1:
balanced-match "^1.0.0"

braces@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.0.1"
fill-range "^7.1.1"

browser-process-hrtime@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -3556,10 +3556,10 @@ file-loader@~6.0.0:
loader-utils "^2.0.0"
schema-utils "^2.6.5"

fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
fill-range@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"

Expand Down Expand Up @@ -5011,6 +5011,11 @@ minipass@^3.0.0, minipass@^3.1.1:
dependencies:
yallist "^4.0.0"

minipass@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==

minizlib@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
Expand Down Expand Up @@ -6494,13 +6499,13 @@ tapable@^2.1.1, tapable@^2.2.0:
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==

tar@^6.0.2:
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
minipass "^3.0.0"
minipass "^5.0.0"
minizlib "^2.1.1"
mkdirp "^1.0.3"
yallist "^4.0.0"
Expand Down Expand Up @@ -7167,16 +7172,16 @@ wrappy@1:
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==

ws@^6.2.1:
version "6.2.2"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e"
integrity sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==
version "6.2.3"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.3.tgz#ccc96e4add5fd6fedbc491903075c85c5a11d9ee"
integrity sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA==
dependencies:
async-limiter "~1.0.0"

ws@^7.4.6:
version "7.5.9"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
version "7.5.10"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9"
integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==

xml-name-validator@^3.0.0:
version "3.0.0"
Expand Down

0 comments on commit 9d4e25a

Please sign in to comment.