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

multiscale meshes #435

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5ac119e
wip
akhileshh Jan 10, 2023
75fca44
wip: multiscale manifest
akhileshh Mar 26, 2023
92401c8
feat: multiscale manifest endpoint
akhileshh Mar 29, 2023
86afd62
fix: cleanup utils
akhileshh Mar 29, 2023
3cd7310
fix: initial values
akhileshh Apr 4, 2023
2052e0b
fix: handle l2 and leaf ids
akhileshh Apr 7, 2023
bce986c
fix: handle missing fragments due to skips
akhileshh Apr 8, 2023
8ef33c6
fix: max layer for lower level IDs
akhileshh Apr 16, 2023
92d856e
fix: octree hierarchy based on bfs level
akhileshh Apr 19, 2023
93af086
fix: account for leaves without meshes
akhileshh Apr 19, 2023
130a0c4
fix: no mesh edge case
akhileshh Apr 19, 2023
45ee6ce
fix: use only chunk coordinates
akhileshh Apr 25, 2023
5b52da7
fix: include clip bounds
akhileshh May 4, 2023
4253b67
virtual bit
akhileshh Jul 26, 2023
742c01f
fix: sort children nodes by morton code
akhileshh Sep 15, 2023
034a3af
fix(temp): auth bp for local ng
akhileshh Oct 12, 2023
0936d88
fix: efficient comparison for morton sort
akhileshh Oct 26, 2023
b304a2b
fix(manifest): chunk shape in nm
akhileshh Feb 28, 2024
613fa88
try octree coordinates in nm
akhileshh Apr 22, 2024
4dae0c0
adds octree validation
akhileshh Jan 27, 2025
9abfcb5
fix(mesh): skipped nodes in manifest
akhileshh Jan 27, 2025
085c49c
combine fragments per chunk
akhileshh Feb 18, 2025
2ae518c
mark root as virtual
akhileshh Feb 18, 2025
e771241
combine single fragment per chunk with inserted skipped nodes
akhileshh Feb 27, 2025
28e7cf2
fix: missing chunks, octree validation
akhileshh Mar 15, 2025
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
11 changes: 11 additions & 0 deletions pychunkedgraph/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=invalid-name, missing-docstring

import datetime
import json
import logging
Expand All @@ -8,6 +10,7 @@
import pandas as pd
import numpy as np
import redis
from flask import Blueprint
from flask import Flask
from flask.json.provider import DefaultJSONProvider
from flask.logging import default_handler
Expand Down Expand Up @@ -74,6 +77,14 @@ def create_app(test_config=None):
app.register_blueprint(segmentation_api_legacy)
app.register_blueprint(segmentation_api_v1)

auth_bp = Blueprint("auth_info", __name__, url_prefix="/")

@auth_bp.route("/auth_info")
def index():
return {"login_url": "https://globalv1.flywire-daf.com/sticky_auth"}

app.register_blueprint(auth_bp)

return app


Expand Down
15 changes: 11 additions & 4 deletions pychunkedgraph/app/meshing/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
from pychunkedgraph.meshing.manifest import get_highest_child_nodes_with_meshes
from pychunkedgraph.meshing.manifest import get_children_before_start_layer
from pychunkedgraph.meshing.manifest import ManifestCache
from pychunkedgraph.meshing.manifest import speculative_manifest_sharded
from pychunkedgraph.meshing.manifest.multiscale import (
get_manifest as get_multiscale_manifest,
)


__meshing_url_prefix__ = os.environ.get("MESHING_URL_PREFIX", "meshing")
Expand Down Expand Up @@ -54,7 +58,7 @@ def handle_valid_frags(table_id, node_id):
## MANIFEST --------------------------------------------------------------------


def handle_get_manifest(table_id, node_id):
def handle_get_manifest(table_id, node_id, multiscale=False):
current_app.request_type = "manifest"
current_app.table_id = table_id

Expand Down Expand Up @@ -84,6 +88,7 @@ def handle_get_manifest(table_id, node_id):
args = (
node_id,
verify,
multiscale,
return_seg_ids,
prepend_seg_ids,
start_layer,
Expand All @@ -95,11 +100,10 @@ def handle_get_manifest(table_id, node_id):


def manifest_response(cg, args):
from pychunkedgraph.meshing.manifest import speculative_manifest_sharded

(
node_id,
verify,
multiscale,
return_seg_ids,
prepend_seg_ids,
start_layer,
Expand All @@ -109,11 +113,14 @@ def manifest_response(cg, args):
) = args
resp = {}
seg_ids = []
node_id = np.uint64(node_id)
if not verify:
seg_ids, resp["fragments"] = speculative_manifest_sharded(
cg, node_id, start_layer=start_layer, bounding_box=bounding_box
)

elif multiscale is True:
seg_ids, response = get_multiscale_manifest(cg, node_id)
resp.update(response)
else:
seg_ids, resp["fragments"] = get_highest_child_nodes_with_meshes(
cg,
Expand Down
11 changes: 11 additions & 0 deletions pychunkedgraph/app/meshing/v1/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ def handle_get_manifest(table_id, node_id):
return common.handle_get_manifest(table_id, node_id)


@bp.route("/table/<table_id>/manifest/multiscale/<node_id>", methods=["GET"])
@auth_requires_permission(
"view",
public_table_key="table_id",
public_node_key="node_id",
)
@remap_public
def handle_get_multilod_manifest(table_id, node_id):
return common.handle_get_manifest(table_id, node_id, multiscale=True)


## ENQUE MESHING JOBS ----------------------------------------------------------


Expand Down
3 changes: 2 additions & 1 deletion pychunkedgraph/graph/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,9 +1014,10 @@ def get_proofread_root_ids(
return get_proofread_root_ids(self, start_time, end_time)

def get_earliest_timestamp(self):
from datetime import timedelta
from datetime import timedelta, datetime

for op_id in range(100):
_, timestamp = self.client.read_log_entry(op_id)
if timestamp is not None:
return timestamp - timedelta(milliseconds=500)
return datetime.fromtimestamp(0)
Loading