Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion pygeodes/geodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def search_items(
if not quiet:
print(f"Found {matched} items matching your query")

if matched > MAX_NB_ITEMS:
if matched > self.conf.nb_max_items:
raise TooManyResultsException(
f"Your query matched with {matched} items, which is too much. Please refine your query to be more precise"
)
Expand Down
2 changes: 2 additions & 0 deletions pygeodes/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from pygeodes.utils.consts import (
CONFIG_DEFAULT_FILENAME,
MAX_NB_ITEMS,
DEFAULT_LOGGING_LEVEL,
DEFAULT_S3_REGION_NAME,
)
Expand Down Expand Up @@ -50,6 +51,7 @@ class Config:
download_dir: str = "."
checksum_error: bool = True
use_async_requests: bool = True
nb_max_items: int = MAX_NB_ITEMS
aws_access_key_id: str = None
aws_secret_access_key: str = None
aws_session_token: str = None # ajouter profil à la place
Expand Down
3 changes: 1 addition & 2 deletions pygeodes/utils/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
# SSL_CERT_PATH = "/etc/pki/tls/cert.pem" #CNES certificate
SSL_CERT_PATH = ""
MAX_PAGE_SIZE = 80
NB_PAGES_LIMIT = 10000000
MAX_NB_ITEMS = MAX_PAGE_SIZE * NB_PAGES_LIMIT
MAX_NB_ITEMS = MAX_PAGE_SIZE * 10000000
DOWNLOAD_CHUNK_SIZE = 8192
MAX_NB_RETRIES = 5
TIME_BEFORE_RETRY = 2
Expand Down
1 change: 1 addition & 0 deletions tests/test_env/pygeodes-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"logging_level": "INFO",
"download_dir": "./pygeodes/tests/test_env",
"checksum_error": true,
"nb_max_items": 2000000,
"use_async_requests": true,
"aws_access_key_id": null,
"aws_secret_access_key": null,
Expand Down