Skip to content

l2cache

L2CacheClientLegacy(server_address, auth_header, api_version, endpoints, server_name, table_name=None, max_retries=None, pool_maxsize=None, pool_block=None, over_client=None, verify=True)

Bases: ClientBase

server_version: Optional[Version] property

The version of the service running on the remote server. Note that this refers to the software running on the server and has nothing to do with the version of the datastack itself.

cache_metadata()

Retrieves the meta data for the cache

Returns:

Type Description
dict

keys are attribute names, values are datatypes

get_l2data(l2_ids, attributes=None)

Gets the attributed statistics data for L2 ids.

Parameters:

Name Type Description Default
l2_ids list or ndarray

a list of level 2 ids

required
attributes list

a list of attributes to retrieve. Defaults to None which will return all that are available. Available stats are ['area_nm2', 'chunk_intersect_count', 'max_dt_nm', 'mean_dt_nm', 'pca', 'pca_val', 'rep_coord_nm', 'size_nm3']. See docs for more description.

None

Returns:

Type Description
dict

keys are l2 ids, values are data

has_cache(datastack_name=None)

Checks if the l2 cache is available for the dataset

Parameters:

Name Type Description Default
datastack_name str

The name of the datastack to check, by default None (if None, uses the client's datastack)

None

Returns:

Type Description
bool

True if the l2 cache is available, False otherwise

raise_for_status(r, log_warning=True) staticmethod

Raises requests.HTTPError, if one occurred.

table_mapping()

Retrieves table mappings for l2 cache.

Returns:

Type Description
dict

keys are pcg table names, values are dicts with fields l2cache_id and cv_path.