From fd3703bd0f30acb4bcaa90c7dbd8373b67623dbd Mon Sep 17 00:00:00 2001 From: Ben Pedigo Date: Mon, 14 Oct 2024 15:26:37 -0700 Subject: [PATCH] more small fixes --- caveclient/annotationengine.py | 65 ++++++++++++++--------------- caveclient/auth.py | 3 +- caveclient/chunkedgraph.py | 2 +- caveclient/emannotationschemas.py | 1 + caveclient/infoservice.py | 1 + caveclient/jsonservice.py | 34 +++++++-------- caveclient/l2cache.py | 2 + caveclient/materializationengine.py | 48 ++++++++++----------- caveclient/skeletonservice.py | 1 + docs/api/annotation.md | 5 +++ docs/api/client.md | 1 + mkdocs.yml | 4 +- 12 files changed, 89 insertions(+), 78 deletions(-) diff --git a/caveclient/annotationengine.py b/caveclient/annotationengine.py index d7d62266..573436f6 100644 --- a/caveclient/annotationengine.py +++ b/caveclient/annotationengine.py @@ -13,39 +13,7 @@ class AnnotationClient(ClientBase): - """ - Client for interacting with the annotation engine. - - Parameters - ---------- - server_address : str - server_address to use to connect to (i.e. https://minniev1.microns-daf.com) - aligned_volume_name : str - Name of the aligned volume to use. - auth_client : AuthClient or None, optional - Authentication client to use to connect to server. If None, do not use - authentication. - api_version : str or int (default: latest) - What version of the api to use, 0: Legacy client (i.e www.dynamicannotationframework.com) - 2: new api version, (i.e. minniev1.microns-daf.com) - 'latest': default to the most recent (current 2) - verify : str (default : True) - Whether to verify https - max_retries : Int or None, optional - Set the number of retries per request, by default None. If None, defaults to - requests package default. - pool_block : Bool or None, optional - If True, restricts pool of threads to max size, by default None. If None, - defaults to requests package default. - pool_maxsize : Int or None, optional - Sets the max number of threads in the pool, by default None. If None, defaults - to requests package default. - over_client: - Client to overwrite configuration with. - schema_client: - Client to use to get schema information. If None, uses the `over_client`'s - schema client. - """ + """Client for interacting with the annotation engine.""" def __init__( self, @@ -60,6 +28,37 @@ def __init__( over_client=None, schema_client=None, ): + """ + Parameters + ---------- + server_address : str + server_address to use to connect to (i.e. https://minniev1.microns-daf.com) + aligned_volume_name : str + Name of the aligned volume to use. + auth_client : AuthClient or None, optional + Authentication client to use to connect to server. If None, do not use + authentication. + api_version : str or int (default: latest) + What version of the api to use, 0: Legacy client (i.e www.dynamicannotationframework.com) + 2: new api version, (i.e. minniev1.microns-daf.com) + 'latest': default to the most recent (current 2) + verify : str (default : True) + Whether to verify https + max_retries : Int or None, optional + Set the number of retries per request, by default None. If None, defaults to + requests package default. + pool_block : Bool or None, optional + If True, restricts pool of threads to max size, by default None. If None, + defaults to requests package default. + pool_maxsize : Int or None, optional + Sets the max number of threads in the pool, by default None. If None, defaults + to requests package default. + over_client: + Client to overwrite configuration with. + schema_client: + Client to use to get schema information. If None, uses the `over_client`'s + schema client. + """ if auth_client is None: auth_client = AuthClient() auth_header = auth_client.request_header diff --git a/caveclient/auth.py b/caveclient/auth.py index 52829c32..942692d5 100644 --- a/caveclient/auth.py +++ b/caveclient/auth.py @@ -53,6 +53,7 @@ def server_token_filename(server_address): class AuthClient(object): + """Client to find and use auth tokens to access the other services.""" def __init__( self, token_file=None, @@ -61,7 +62,7 @@ def __init__( server_address=default_global_server_address, local_server=None, ): - """Client to find and use auth tokens to access the dynamic annotation framework services. + """ Parameters ---------- diff --git a/caveclient/chunkedgraph.py b/caveclient/chunkedgraph.py index 760934bb..bd29be3f 100644 --- a/caveclient/chunkedgraph.py +++ b/caveclient/chunkedgraph.py @@ -109,7 +109,7 @@ def root_id_int_list_check( class ChunkedGraphClient(ClientBase): - """ChunkedGraph Client for the v1 API""" + """Client for interacting with the chunkedgraph.""" def __init__( self, diff --git a/caveclient/emannotationschemas.py b/caveclient/emannotationschemas.py index d771b2b2..f711d09c 100644 --- a/caveclient/emannotationschemas.py +++ b/caveclient/emannotationschemas.py @@ -14,6 +14,7 @@ class SchemaClient(ClientBase): + """Client for interacting with the schema service.""" def __init__( self, server_address=None, diff --git a/caveclient/infoservice.py b/caveclient/infoservice.py index e053787a..e555768a 100644 --- a/caveclient/infoservice.py +++ b/caveclient/infoservice.py @@ -22,6 +22,7 @@ class InfoServiceClient(ClientBaseWithDatastack): + """Client for interacting with the info service.""" def __init__( self, server_address=None, diff --git a/caveclient/jsonservice.py b/caveclient/jsonservice.py index 92ef0fb4..168f4ed4 100644 --- a/caveclient/jsonservice.py +++ b/caveclient/jsonservice.py @@ -40,23 +40,7 @@ def neuroglancer_json_encoder(obj): class JSONService(ClientBase): - """Client to interface with the JSON state service. - - Parameters - ---------- - server_address : str, optional - URL to the JSON state server. - If None, set to the default global server address. - By default None. - auth_client : An Auth client, optional - An auth client with a token for the same global server, by default None - api_version : int or 'latest', optional - Which endpoint API version to use or 'latest'. By default, 'latest' tries to ask - the server for which versions are available, if such functionality exists, or if not - it defaults to the latest version for which there is a client. By default 'latest' - ngl_url : str or None, optional - Default neuroglancer deployment URL. Only used for V1 and later. - """ + """Client to interface with the JSON state service.""" def __init__( self, @@ -69,6 +53,22 @@ def __init__( pool_block=None, over_client=None, ): + """ + Parameters + ---------- + server_address : str, optional + URL to the JSON state server. + If None, set to the default global server address. + By default None. + auth_client : An Auth client, optional + An auth client with a token for the same global server, by default None + api_version : int or 'latest', optional + Which endpoint API version to use or 'latest'. By default, 'latest' tries to ask + the server for which versions are available, if such functionality exists, or if not + it defaults to the latest version for which there is a client. By default 'latest' + ngl_url : str or None, optional + Default neuroglancer deployment URL. Only used for V1 and later. + """ if server_address is None: server_address = default_global_server_address diff --git a/caveclient/l2cache.py b/caveclient/l2cache.py index eb78a3e0..30745795 100644 --- a/caveclient/l2cache.py +++ b/caveclient/l2cache.py @@ -15,6 +15,8 @@ class L2CacheClient(ClientBase): + """Client for interacting with the level2 cache service.""" + def __init__( self, server_address=None, diff --git a/caveclient/materializationengine.py b/caveclient/materializationengine.py index 1eb163bb..f5474cbb 100644 --- a/caveclient/materializationengine.py +++ b/caveclient/materializationengine.py @@ -152,30 +152,7 @@ def _tables_metadata_key(matclient, *args, **kwargs): class MaterializationClient(ClientBase): - """Client for interacting with the materialization engine - - Parameters - ---------- - server_address : str - server_address to use to connect to (i.e. https://minniev1.microns-daf.com) - datastack_name : str - Name of the datastack. - auth_client : AuthClient or None, optional - Authentication client to use to connect to server. If None, do not use authentication. - api_version : str or int (default: latest) - What version of the api to use, 0: Legacy client (i.e www.dynamicannotationframework.com) - 2: new api version, (i.e. minniev1.microns-daf.com) - 'latest': default to the most recent (current 2) - cg_client: caveclient.chunkedgraph.ChunkedGraphClient - chunkedgraph client for live materializations - synapse_table: str - default synapse table for queries - version : default version to query - if None will default to latest version - desired_resolution : Iterable[float] or None, optional - If given, should be a list or array of the desired resolution you want queries returned in - useful for materialization queries. - """ + """Client for interacting with the materialization engine.""" def __init__( self, @@ -193,6 +170,29 @@ def __init__( desired_resolution=None, over_client=None, ): + """ + Parameters + ---------- + server_address : str + server_address to use to connect to (i.e. https://minniev1.microns-daf.com) + datastack_name : str + Name of the datastack. + auth_client : AuthClient or None, optional + Authentication client to use to connect to server. If None, do not use authentication. + api_version : str or int (default: latest) + What version of the api to use, 0: Legacy client (i.e www.dynamicannotationframework.com) + 2: new api version, (i.e. minniev1.microns-daf.com) + 'latest': default to the most recent (current 2) + cg_client: caveclient.chunkedgraph.ChunkedGraphClient + chunkedgraph client for live materializations + synapse_table: str + default synapse table for queries + version : default version to query + if None will default to latest version + desired_resolution : Iterable[float] or None, optional + If given, should be a list or array of the desired resolution you want queries returned in + useful for materialization queries. + """ if auth_client is None: auth_client = AuthClient() diff --git a/caveclient/skeletonservice.py b/caveclient/skeletonservice.py index 5aefea93..b3b8d00c 100644 --- a/caveclient/skeletonservice.py +++ b/caveclient/skeletonservice.py @@ -38,6 +38,7 @@ def __init__(self, value=""): class SkeletonClient(ClientBase): + """Client for interacting with the skeleton service.""" def __init__( self, server_address: str, diff --git a/docs/api/annotation.md b/docs/api/annotation.md index d4207b41..56ac9d79 100644 --- a/docs/api/annotation.md +++ b/docs/api/annotation.md @@ -6,3 +6,8 @@ title: client.annotation options: heading_level: 2 show_bases: false + filters: ["!__init__"] + docstring_options: + ignore_init_summary: false + merge_init_into_class: false + diff --git a/docs/api/client.md b/docs/api/client.md index 4ab01e14..27ff6320 100644 --- a/docs/api/client.md +++ b/docs/api/client.md @@ -5,3 +5,4 @@ title: caveclient.CAVEclient ::: caveclient.frameworkclient.CAVEclientFull options: show_bases: false + merge_init_into_class: true \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index a957e344..47c3fce5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -106,7 +106,7 @@ plugins: docstring_section_style: table # list, table, spacy docstring_options: ignore_init_summary: false - merge_init_into_class: true + merge_init_into_class: false allow_section_blank_line: false show_root_heading: false show_root_toc_entry: false @@ -127,7 +127,7 @@ plugins: heading_level: 2 inherited_members: true # members: none - filters: ["!^_[^_]", "!.*(raise_for_status).*"] + filters: ["!^_[^_]", "!.*(raise_for_status).*", "!__init__"] - macros - autorefs # - section-index