Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skeleton service incorporation into CAVEclient is working, at least in certain respects #212

Merged
merged 45 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3c4ed79
Skeleton engine
kebwi May 7, 2024
954131f
Merge branch 'master' of https://github.com/CAVEconnectome/CAVEclient…
kebwi May 7, 2024
0d4cbdb
Removed extraneous notebook
kebwi May 7, 2024
27cf9d1
Client object builds in a notebook test, still pretty empty though.
kebwi May 7, 2024
21de32a
Entry point added.
kebwi May 7, 2024
8bf0339
SkeletonClient now works in a basic test.
kebwi May 28, 2024
9aba046
Merge remote-tracking branch 'origin' into skeleton_dev
kebwi Aug 8, 2024
2ffe201
Ongoing skeleton work.
kebwi Aug 12, 2024
11568f8
Merge remote-tracking branch 'origin' into skeleton_dev
kebwi Aug 12, 2024
af7ada4
Merge remote-tracking branch 'origin' into skeleton_dev
kebwi Aug 16, 2024
2862e36
Skeleton service work.
kebwi Aug 20, 2024
6b503e8
Updates to PR 212
kebwi Aug 21, 2024
89d6f39
Updates to PR 212
kebwi Aug 21, 2024
e612036
Updates for PR 212
kebwi Aug 21, 2024
ff8cdd9
Updates to PR 212
kebwi Aug 21, 2024
1180454
Attempts to pacify lint checks for PR 212
kebwi Aug 21, 2024
7905296
Updates toward PR 212
kebwi Aug 21, 2024
c2ed44a
Trying to appease Git lint formatter
kebwi Aug 21, 2024
2de4bd6
fix import from type checking
ceesem Aug 21, 2024
863311d
tweak for linting
ceesem Aug 21, 2024
c54ed48
run ruff fix imports
ceesem Aug 21, 2024
eb105a9
Rebuilt endpoint map for PR 212
kebwi Aug 22, 2024
4b86152
Trying to appease lint tests for PR 212
kebwi Aug 22, 2024
643f07e
Testing formatting cleanup against lint.
kebwi Aug 22, 2024
4a2a87a
Nope, line insists on allowing ruff to butcher the formatting so it's…
kebwi Aug 22, 2024
dd25d0d
Added 'verify' to super call.
kebwi Aug 22, 2024
29bf7dc
Skeleton endpoint cleanup.
kebwi Aug 23, 2024
a011164
Praying to the lint gods.
kebwi Aug 23, 2024
76ef93d
Return type cleanup
kebwi Aug 23, 2024
2b8bf38
Added an exception to handle a missing L2Cache.
kebwi Aug 27, 2024
913825c
Trying to make lint happy.
kebwi Aug 27, 2024
6b868b1
Wrestling with lint.
kebwi Aug 27, 2024
6c31431
Wrestling with lint.
kebwi Aug 27, 2024
d2135cd
Wrestling with lint.
kebwi Aug 27, 2024
1e94069
Made a few imports optional.
kebwi Aug 27, 2024
5eca9e7
Wrestline with lint.
kebwi Aug 27, 2024
1fb669a
Added warnings on import failures. Changed default output from precom…
kebwi Aug 28, 2024
ecff164
Made test function names consistent.
kebwi Aug 28, 2024
e1c0729
Version endpoint work.
kebwi Aug 28, 2024
446272d
string formatting cleanup.
kebwi Aug 28, 2024
c66dca9
Wrestling with lint.
kebwi Aug 28, 2024
61ce2c6
Merge branch 'master' of https://github.com/CAVEconnectome/CAVEclient
kebwi Sep 9, 2024
aab7723
Merge branch 'master' into skeleton_dev
kebwi Sep 9, 2024
9277751
removing keith dev
fcollman Sep 9, 2024
638665e
Merge branch 'skeleton_dev' of github.com:seung-lab/CAVEclient into s…
fcollman Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
kebwi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ notebooks/
*.mp4
*.tiff
.idea/


27 changes: 25 additions & 2 deletions caveclient/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
+ "/aligned_volume/{aligned_volume_name}/table/{table_name}/count",
}

annotation_api_versions = {0: annotation_endpoints_legacy, 2: annotation_endpoints_v2}

# -------------------------------
# ------ MaterializationEngine endpoints
# -------------------------------

materialization_common = {
"get_api_versions": "{me_server_address}/materialize/api/versions"
Expand Down Expand Up @@ -94,8 +99,6 @@
3: materialization_endpoints_v3,
}

annotation_api_versions = {0: annotation_endpoints_legacy, 2: annotation_endpoints_v2}

# -------------------------------
# ------ Infoservice endpoints
# -------------------------------
Expand Down Expand Up @@ -284,3 +287,23 @@
"get_info": "{ngl_url}/version.json",
"fallback_ngl_url": fallback_ngl_endpoint,
}

# -------------------------------
# ------ Skeleton endpoints
# -------------------------------

skeletonservice_common = {}

skeleton_common = "{skeleton_server_address}/skeletoncache/api"
skeleton_v1 = "{skeleton_server_address}/skeletoncache/api/v1"
skeletonservice_endpoints_v1 = {
"get_version": skeleton_common + "/version",
"skeleton_info": skeleton_v1 + "/{datastack_name}/precomputed/skeleton/info",
"get_skeleton_via_rid": skeleton_v1
+ "/{datastack_name}/precomputed/skeleton/{root_id}",
"get_skeleton_via_skvn_rid": skeleton_v1
+ "/{datastack_name}/precomputed/skeleton/{skeleton_version}/{root_id}",
"get_skeleton_via_skvn_rid_fmt": skeleton_v1
+ "/{datastack_name}/precomputed/skeleton/{skeleton_version}/{root_id}/{output_format}",
}
skeletonservice_api_versions = {1: skeletonservice_endpoints_v1}
23 changes: 23 additions & 0 deletions caveclient/frameworkclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .jsonservice import JSONService, JSONServiceV1
from .l2cache import L2CacheClient, L2CacheClientLegacy
from .materializationengine import MaterializationClient, MaterializationClientType
from .skeletonservice import SkeletonClient

DEFAULT_RETRIES = 3

Expand Down Expand Up @@ -53,6 +54,7 @@ def __new__(
- `client.info` is an `InfoServiceClient` (see [client.info](../client_api/info.md))
- `client.l2cache` is an `L2CacheClient` (see [client.l2cache](../client_api/l2cache.md))
- `client.materialize` is a `MaterializationClient` (see [client.materialize](../client_api/materialize.md))
- `client.skeleton` is a `SkeletonClient` (see [client.skeleton](../client_api/skeleton.md))
- `client.schema` is a `SchemaClient` (see [client.schema](../client_api/schema.md))
- `client.state` is a neuroglancer `JSONService` (see [client.state](../client_api/state.md))

Expand Down Expand Up @@ -339,6 +341,7 @@ def __init__(
- `client.info` is an `InfoServiceClient` (see [client.info](../client_api/info.md))
- `client.l2cache` is an `L2CacheClient` (see [client.l2cache](../client_api/l2cache.md))
- `client.materialize` is a `MaterializationClient` (see [client.materialize](../client_api/materialize.md))
- `client.skeleton` is a `SkeletonClient` (see [client.skeleton](../client_api/skeleton.md))
kebwi marked this conversation as resolved.
Show resolved Hide resolved
- `client.schema` is a `SchemaClient` (see [client.schema](../client_api/schema.md))
- `client.state` is a neuroglancer `JSONService` (see [client.state](../client_api/state.md))

Expand Down Expand Up @@ -391,6 +394,7 @@ def __init__(
self._chunkedgraph = None
self._annotation = None
self._materialize = None
self._skeleton = None
self._l2cache = None
self.desired_resolution = desired_resolution
self.local_server = self.info.local_server()
Expand Down Expand Up @@ -436,6 +440,7 @@ def _reset_services(self):
self._chunkedgraph = None
self._annotation = None
self._materialize = None
self._skeleton = None
self._l2cache = None

@property
Expand Down Expand Up @@ -502,6 +507,24 @@ def materialize(self) -> MaterializationClientType:
)
return self._materialize

@property
def skeleton(self) -> SkeletonClient:
"""
A client for the skeleton service. See [client.skeleton](../client_api/skeleton.md)
for more information.
"""
if self._skeleton is None:
self._skeleton = SkeletonClient(
server_address=self.local_server,
auth_client=self.auth,
datastack_name=self._datastack_name,
max_retries=self._max_retries,
pool_maxsize=self._pool_maxsize,
pool_block=self._pool_block,
over_client=self,
)
return self._skeleton

@property
def state(self) -> JSONServiceV1:
"""
Expand Down
Loading
Loading