et_engine.batches

Classes

Batch(base_url, *args, **kwargs)

An Interface & Client for interacting with an ET Engine Batch.

BatchesClient([base_url])

Client for interacting with ET Engine Batches.

tqdm(*_, **__)

Decorate an iterable object, returning an iterator which acts exactly like the original iterable, but prints a dynamically updating progressbar every time a value is requested.

class Batch(base_url: str, *args, **kwargs)

Bases: Batch

An Interface & Client for interacting with an ET Engine Batch.

delete() None

Delete this batch. * NOTE: This will not cancel any jobs, which will still run and incur costs once deleted.

static from_json(base_url: str, batch_json: dict) Self

Convert a JSON object to an interactive Batch.

Parameters:
  • base_url (str) – Base endpoint for requests.

  • batch_json (dict) – JSON description of the Batch.

Returns:

A Batch object.

Return type:

Self

status(max_retries: int = 5) BatchStatus

Fetches a summary of the status of all jobs in the Batch.

Parameters:

max_retries (int, optional) – Number of requests to try before raising an exception. Defaults to 5.

Raises:

Exception – Max retries exceeded.

Returns:

An et_engine_core.BatchStatus object summarizing the status of all jobs in the Batch.

Return type:

etc.BatchStatus

wait(interval: int = 15, thresh: int = None) None

Wait for the Batch to finish processing.

Parameters:
  • interval (int, optional) – Number of seconds between status refreshes, in seconds. Defaults to 15.

  • thresh (int, optional) – Threshold number of jobs to finish waiting, if None then it waits until all jobs finish. Defaults to None.

class BatchesClient(base_url: str = 'https://api.exploretech.ai/v1')

Bases: APIClient

Client for interacting with ET Engine Batches.

clear_batches() None

Deletes all batches.

connect(batch_id: str) Batch

Connect to a specific Batch

Parameters:

batch_id (str) – unique ID of the batch

Raises:

Exception – No batch with the specified ID

Returns:

A new Batch client.

Return type:

Batch

list_batches() list[Batch]

Lists all the available batches.

Returns:

A list of Batch clients to each available resource.

Return type:

list[Batch]