Skip to content

Commit

Permalink
resolve the request changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-dkrz committed Feb 12, 2025
1 parent 87cee1b commit dcd9762
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 45 deletions.
40 changes: 15 additions & 25 deletions freva-client/src/freva_client/cli/databrowser_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,9 @@ def metadata_search(
help=(
"Special search facet to refine/subset search results by spatial "
"extent. This can be a string representation of a bounding box. "
"The bounding box has to follow the format ``min_lon,min_lat by "
"max_lon,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``. **Note**: You don't have to give the full string "
"format to subset the bounding box ``min_lon,min_lat`` etc are "
"also valid."
"The bounding box has to follow the format ``min_lon,max_lon by "
"min_lat,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``."
),
),
bbox_select: SelectMethod = typer.Option(
Expand Down Expand Up @@ -330,11 +328,9 @@ def data_search(
help=(
"Special search facet to refine/subset search results by spatial "
"extent. This can be a string representation of a bounding box. "
"The bounding box has to follow the format ``min_lon,min_lat by "
"max_lon,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``. **Note**: You don't have to give the full string "
"format to subset the bounding box ``min_lon,min_lat`` etc are "
"also valid."
"The bounding box has to follow the format ``min_lon,max_lon by "
"min_lat,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``."
),
),
bbox_select: SelectMethod = typer.Option(
Expand Down Expand Up @@ -469,11 +465,9 @@ def intake_catalogue(
help=(
"Special search facet to refine/subset search results by spatial "
"extent. This can be a string representation of a bounding box. "
"The bounding box has to follow the format ``min_lon,min_lat by "
"max_lon,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``. **Note**: You don't have to give the full string "
"format to subset the bounding box ``min_lon,min_lat`` etc are "
"also valid."
"The bounding box has to follow the format ``min_lon,max_lon by "
"min_lat,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``."
),
),
bbox_select: SelectMethod = typer.Option(
Expand Down Expand Up @@ -622,11 +616,9 @@ def stac_catalogue(
help=(
"Special search facet to refine/subset search results by spatial "
"extent. This can be a string representation of a bounding box. "
"The bounding box has to follow the format ``min_lon,min_lat by "
"max_lon,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``. **Note**: You don't have to give the full string "
"format to subset the bounding box ``min_lon,min_lat`` etc are "
"also valid."
"The bounding box has to follow the format ``min_lon,max_lon by "
"min_lat,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``."
),
),
bbox_select: SelectMethod = typer.Option(
Expand Down Expand Up @@ -754,11 +746,9 @@ def count_values(
help=(
"Special search facet to refine/subset search results by spatial "
"extent. This can be a string representation of a bounding box. "
"The bounding box has to follow the format ``min_lon,min_lat by "
"max_lon,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``. **Note**: You don't have to give the full string "
"format to subset the bounding box ``min_lon,min_lat`` etc are "
"also valid."
"The bounding box has to follow the format ``min_lon,max_lon by "
"min_lat,max_lat``. Valid strings are ``-10,10 by -10,10`` to "
"``0,5 by 0,5``."
),
),
bbox_select: SelectMethod = typer.Option(
Expand Down
9 changes: 0 additions & 9 deletions freva-client/src/freva_client/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ class databrowser:
Valid strings are ``min_lon,max_lon by min_lat,max_lat`` for bounding
boxes and Well-Known Text (WKT) format for polygons.
.. note:: Longitude values must be between -180 and 180, latitude values
between -90 and 90.
bbox_select: str, default: flexible
Operator that specifies how the spatial extent is selected. Choose from
flexible (default), strict or file. ``strict`` returns only those files
Expand Down Expand Up @@ -560,9 +557,6 @@ def count_values(
Valid strings are ``min_lon,max_lon by min_lat,max_lat`` for bounding
boxes and Well-Known Text (WKT) format for polygons.
.. note:: Longitude values must be between -180 and 180, latitude values
between -90 and 90.
bbox_select: str, default: flexible
Operator that specifies how the spatial extent is selected. Choose from
flexible (default), strict or file. ``strict`` returns only those files
Expand Down Expand Up @@ -720,9 +714,6 @@ def metadata_search(
Valid strings are ``min_lon,max_lon by min_lat,max_lat`` for bounding
boxes and Well-Known Text (WKT) format for polygons.
.. note:: Longitude values must be between -180 and 180, latitude values
between -90 and 90.
bbox_select: str, default: flexible
Operator that specifies how the spatial extent is selected. Choose from
flexible (default), strict or file. ``strict`` returns only those files
Expand Down
2 changes: 1 addition & 1 deletion freva-data-portal-worker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"watchfiles",
"xarray",
"xpublish",
"zarr==2.18.2",
"zarr<3",
]
[project.scripts]
data-loader-worker = "data_portal_worker:cli.run_data_loader"
Expand Down
2 changes: 1 addition & 1 deletion freva-rest/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"watchfiles",
"uuid",
"typing_extensions",
"zarr==2.18.2",
"zarr<3",
"pystac",
"httpx",
]
Expand Down
10 changes: 1 addition & 9 deletions freva-rest/src/freva_rest/databrowser_api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,10 @@ async def stac_catalogue(
await stac_instance.init_stac_catalogue(request)
if stac_dynamic:
await stac_instance.stacapi_availability()
# following function has been moved here to create a collection
# before the background task is started to hand a non-404 redirect
# url to the client; otherwise the client would have to reload the
# delivered endpoint to see the content, which doesn't look appealing!
await stac_instance.init_stac_dynamic_collection(collection_id)

async def run_stac_creation() -> None:
"""Execute the STAC catalogue creation background task
in a seperate fucntion to avoid blocking the main request
thread and have more control over the background task to
handle and deliver status without blocking the client
response."""
"""Execute the STAC catalogue creation background task"""
try:
async for _ in stac_instance.stream_stac_catalogue(
collection_id, stac_dynamic
Expand Down

0 comments on commit dcd9762

Please sign in to comment.