caveclient.CAVEclient
A manager for all clients sharing common datastack and authentication information.
This client wraps all the other clients and keeps track of the things that need to be consistent across them. To instantiate a client:
from caveclient import CAVEclient
client = CAVEclient(datastack_name='my_datastack',
server_address='www.myserver.com',
auth_token_file='~/.mysecrets/secrets.json')
Then
client.annotation
is anAnnotationClient
(see client.annotation)client.auth
is anAuthClient
(see client.auth)client.chunkedgraph
is aChunkedGraphClient
(see client.chunkedgraph)client.info
is anInfoServiceClient
(see client.info)client.l2cache
is anL2CacheClient
(see client.l2cache)client.materialize
is aMaterializationClient
(see client.materialize)client.skeleton
is aSkeletonClient
(see client.skeleton)client.schema
is aSchemaClient
(see client.schema)client.state
is a neuroglancerJSONService
(see client.state)
All subclients are loaded lazily and share the same datastack name, server address, and auth tokens where used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datastack_name
|
str
|
Datastack name for the services. Almost all services need this and will not work if it is not passed. |
None
|
server_address
|
str or None
|
URL of the framework server. If None, chooses the default server global.daf-apis.com. Optional, defaults to None. |
None
|
auth_token_file
|
str or None
|
Path to a json file containing the auth token. If None, uses the default location. See Auth client documentation. Optional, defaults to None. |
default_token_file
|
auth_token_key
|
str
|
Dictionary key for the token in the the JSON file. Optional, default is 'token'. |
'token'
|
auth_token
|
str or None
|
Direct entry of an auth token. If None, uses the file arguments to find the token. Optional, default is None. |
None
|
max_retries
|
int or None
|
Sets the default number of retries on failed requests. Optional, by default 2. |
None
|
pool_maxsize
|
int or None
|
Sets the max number of threads in a requests pool, although this value will be exceeded if pool_block is set to False. Optional, uses requests defaults if None. |
None
|
pool_block
|
If True, prevents the number of threads in a requests pool from exceeding the max size. Optional, uses requests defaults (False) if None. |
None
|
|
desired_resolution
|
Iterable[float] or None
|
If given, should be a list or array of the desired resolution you want queries returned in useful for materialization queries. |
None
|
info_cache
|
Pre-computed info cache, bypassing the lookup of datastack info from the info service. Should only be used in cases where this information is cached and thus repetitive lookups can be avoided. |
None
|
|
version
|
Optional[int]
|
The default materialization version of the datastack to use. If None, the latest version is used. Optional, defaults to None. |
None
|
Methods:
Name | Description |
---|---|
change_auth |
Change the authentication token and reset services. |
Attributes:
Name | Type | Description |
---|---|---|
annotation |
AnnotationClient
|
A client for the annotation service. See client.annotation |
auth |
AuthClient
|
A client for the auth service. See client.auth for more information. |
chunkedgraph |
ChunkedGraphClient
|
A client for the chunkedgraph service. See client.chunkedgraph |
datastack_name |
str
|
The name of the datastack for the client. |
info |
InfoServiceClient
|
A client for the info service. See client.info for more information. |
l2cache |
L2CacheClient
|
A client for the L2 cache service. See client.l2cache |
materialize |
MaterializationClient
|
A client for the materialization service. See client.materialize |
schema |
SchemaClient
|
A client for the EM Annotation Schemas service. See client.schema |
server_address |
The server address for the client. |
|
skeleton |
SkeletonClient
|
A client for the skeleton service. See client.skeleton |
state |
JSONService
|
A client for the neuroglancer state service. See client.state |
timestamp |
Optional[datetime]
|
The default timestamp to use for queries which rely on a timestamp. |
version |
Optional[int]
|
The default materialization version of the datastack to use for queries which |
annotation: AnnotationClient
property
¶
A client for the annotation service. See client.annotation for more information.
auth: AuthClient
property
¶
A client for the auth service. See client.auth for more information.
chunkedgraph: ChunkedGraphClient
property
¶
A client for the chunkedgraph service. See client.chunkedgraph for more information.
datastack_name: str
property
¶
The name of the datastack for the client.
info: InfoServiceClient
property
¶
A client for the info service. See client.info for more information.
l2cache: L2CacheClient
property
¶
A client for the L2 cache service. See client.l2cache for more information.
materialize: MaterializationClient
property
¶
A client for the materialization service. See client.materialize for more information.
schema: SchemaClient
property
¶
A client for the EM Annotation Schemas service. See client.schema for more information.
server_address
property
¶
The server address for the client.
skeleton: SkeletonClient
property
¶
A client for the skeleton service. See client.skeleton for more information.
state: JSONService
property
¶
A client for the neuroglancer state service. See client.state for more information.
timestamp: Optional[datetime]
property
¶
The default timestamp to use for queries which rely on a timestamp.
version: Optional[int]
property
writable
¶
The default materialization version of the datastack to use for queries which expect a version. Also sets the timestamp to the corresponding timestamp of the version for queries which rely on a timestamp.
change_auth(auth_token_file=None, auth_token_key=None, auth_token=None)
¶
Change the authentication token and reset services.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_token_file
|
str
|
New auth token json file path, by default None, which defaults to the existing state. |
None
|
auth_token_key
|
str
|
New dictionary key under which the token is stored in the json file, by default None, which defaults to the existing state. |
None
|
auth_token
|
str
|
Direct entry of a new token, by default None. |
None
|