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

Add support for Batch V2 #540

Merged
merged 20 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 16 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
575 changes: 575 additions & 0 deletions examples/batch_processing_v2.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ lint.fixable = [
"FA100", # import future annotations where necessary (not autofixable ATM)
]
lint.ignore = [
"G004", # f-strings in logging
"C408", # complains about `dict()` calls, we use them to avoid too many " in the code
"SIM108", # tries to aggresively inline `if`, not always readable
"COM812", # trailing comma missing, fights with black
Expand Down Expand Up @@ -191,6 +192,7 @@ disable = [
"unspecified-encoding",
"unnecessary-ellipsis",
"use-dict-literal",
"R0801",
]

[tool.pylint.design]
Expand Down
4 changes: 4 additions & 0 deletions sentinelhub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from .api import (
AsyncProcessRequest,
BatchCollection,
BatchProcessClient,
BatchProcessRequest,
BatchRequest,
BatchRequestStatus,
BatchStatisticalRequest,
Expand All @@ -28,6 +30,8 @@
get_async_running_status,
monitor_batch_analysis,
monitor_batch_job,
monitor_batch_process_analysis,
monitor_batch_process_job,
monitor_batch_statistical_analysis,
monitor_batch_statistical_job,
opensearch,
Expand Down
4 changes: 4 additions & 0 deletions sentinelhub/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from .batch import (
BatchCollection,
BatchProcessClient,
BatchProcessRequest,
BatchRequest,
BatchRequestStatus,
BatchStatisticalRequest,
Expand All @@ -13,6 +15,8 @@
SentinelHubBatchStatistical,
monitor_batch_analysis,
monitor_batch_job,
monitor_batch_process_analysis,
monitor_batch_process_job,
monitor_batch_statistical_analysis,
monitor_batch_statistical_job,
)
Expand Down
3 changes: 3 additions & 0 deletions sentinelhub/api/batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

from .base import BatchRequestStatus, BatchUserAction
from .process import BatchCollection, BatchRequest, BatchTileStatus, SentinelHubBatch
from .process_v2 import BatchProcessClient, BatchProcessRequest
from .statistical import BatchStatisticalRequest, SentinelHubBatchStatistical
from .utils import (
monitor_batch_analysis,
monitor_batch_job,
monitor_batch_process_analysis,
monitor_batch_process_job,
monitor_batch_statistical_analysis,
monitor_batch_statistical_job,
)
8 changes: 8 additions & 0 deletions sentinelhub/api/batch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ class BatchUserAction(Enum):
STOP = "STOP"


class StoppedStatusReason(Enum):
"""Description of why job status is STOPPED"""

OUT_OF_PU = "OUT_OF_PU"
USER_ACTION = "USER_ACTION"
UNHEALTHY = "UNHEALTHY"


class BaseBatchClient(SentinelHubService, Generic[BatchRequestType], metaclass=ABCMeta):
"""Class containing common methods and helper functions for Batch Client classes"""

Expand Down
Loading
Loading