crantpy.utils.cave.load module#

This module provides utility functions for cave-related loading and caching.

crantpy.utils.cave.load.clear_all_caches()[source]#

Clears all caches.

Return type:

None

crantpy.utils.cave.load.clear_cave_client_cache()[source]#

Clears the CAVE client cache.

Return type:

None

crantpy.utils.cave.load.clear_cloudvolume_cache()[source]#

Clears the cloudvolume cache.

Return type:

None

crantpy.utils.cave.load.get_cave_client(dataset=None, clear_cache=False, check_stale=True)[source]#

Returns a CAVE client instance. If a token is already set, it will be used for authentication. Otherwise, a new token will be generated.

Parameters:
  • clear_cache (bool, default False) – If True, bypasses the cache and fetches a new client.

  • check_stale (bool, default True) – If True, checks if the cached client is stale based on materialization and maximum cache duration.

  • dataset (str, optional) – The dataset to use. If not provided, uses the default dataset.

Returns:

A CAVE client instance authenticated with the token.

Return type:

CAVEclient

Raises:

ValueError – If no token is found after attempting to generate one.

crantpy.utils.cave.load.get_cave_datastacks()[source]#

Get available CAVE datastacks.

Return type:

list

crantpy.utils.cave.load.get_cloudvolume(dataset=None, clear_cache=False, check_stale=True, **kwargs)[source]#

Returns a cloudvolume instance.

Parameters:
  • dataset (str | None)

  • clear_cache (bool)

  • check_stale (bool)

Return type:

caveclient.CAVEclient

crantpy.utils.cave.load.get_dataset_segmentation_source(dataset)[source]#

Get segmentation source for given dataset.

Parameters:

dataset (str)

Return type:

str

crantpy.utils.cave.load.get_datastack_segmentation_source(datastack)[source]#

Get segmentation source for given CAVE datastack.

Return type:

str

crantpy.utils.cave.load.validate_cave_client(client, *args, **kwargs)[source]#

Validate if a cached CAVE client is still valid.