tilearray.compute_with_policy#

tilearray.compute_with_policy(obj, fetch_policy=None, *, max_concurrent=None, num_workers=None, **compute_kwargs)[source]#

Compute a Dask-backed xarray or dask object with fetch-aligned thread workers.

Dask’s default .compute() uses num_workers=cpu_count(), which can cap in-flight tile fetches below max_concurrent when AIMD allows more parallel HTTP. This helper runs the threaded scheduler with num_workers=compute_thread_pool_size(policy).

Policy resolution order: explicit fetch_policy, then max_concurrent (builds a minimal policy), then tilearray_fetch_policy on obj.attrs (set by create_array()), else FetchPolicy defaults.

Parameters:
  • obj (Any)

  • fetch_policy (FetchPolicy | None)

  • max_concurrent (int | None)

  • num_workers (int | None)

  • compute_kwargs (Any)

Return type:

Any