swiftsimio.optional_packages module

Import optional packages.

This includes:

  • tqdm: progress bars

  • scipy.spatial: KDTrees

  • numba/cuda: visualisation

  • hdfstream: remote data access

swiftsimio.optional_packages.tqdm(x: Iterable, *args: tuple[Any], **kwargs: dict[str, Any]) Iterable[source]

Mock the main tqdm function for use if it’s unavailable.

Parameters:
  • x (Iterable) – The iterable whose progress would be track by tqdm.

  • *args (tuple[Any]) – Arbitrary additional arguments.

  • **kwargs (dict[str, Any]) – Arbitrary additional kwargs.

Returns:

out – The input iterable is returned.

Return type:

Iterable

swiftsimio.optional_packages.cuda_jit(*args, **kwargs)[source]

Mock the cuda_jit function for use if it’s unavailable.

Returns:

out – The wrapper function (a trivial wrapper).

Return type:

Callable