Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
3525ff1
fix: cleanup ingest code
akhileshh Aug 6, 2023
411a922
add ttl column family
akhileshh Aug 6, 2023
c0632e8
fix: new l2 cx edge attribute
akhileshh Aug 6, 2023
08bd83a
feat: post process sv cross edges
akhileshh Aug 6, 2023
b8a4425
fix: use longer expiry for debugging
akhileshh Aug 11, 2023
8986fac
feat(ingest): read l2 cross edges
akhileshh Aug 11, 2023
24798bd
feat(ingest): postprocess job handling
akhileshh Aug 12, 2023
bb5512d
fix(ingest): status
akhileshh Aug 12, 2023
5985b28
fix: timedelta import
akhileshh Aug 12, 2023
335f701
fix(ingest): status
akhileshh Aug 12, 2023
00aa97f
fix(ingest): use hypenated names for valid dns
akhileshh Aug 12, 2023
d5a6654
fix: rename attr; better var names
akhileshh Aug 20, 2023
b17038b
fix: rename attr; better var names
akhileshh Aug 20, 2023
5e4aee7
fix: add more docs; better var names
akhileshh Aug 20, 2023
febb9f2
fix: move cross_edges module to ingest module; only used in ingest
akhileshh Aug 20, 2023
7ac3b7a
fix: reduce mem use; var names; remove unused code
akhileshh Aug 20, 2023
1fe1e20
fix: adds cg typehint
akhileshh Aug 20, 2023
fd43a1a
fix: reduce loc
akhileshh Aug 20, 2023
d7bfc89
fix: use shorter name
akhileshh Aug 20, 2023
9295156
feat: cache cx edges at each layer
akhileshh Aug 20, 2023
4e5b682
fix: convert array type
akhileshh Aug 20, 2023
ad107ee
fix: use atomic edges during ingest
akhileshh Aug 20, 2023
1811f36
fix: tests
akhileshh Aug 20, 2023
176ea2f
fix: remove postprocess step
akhileshh Aug 20, 2023
49d0b95
fix: raises specific error
akhileshh Aug 20, 2023
d594289
fix: removes dangerous default value
akhileshh Aug 21, 2023
32ee750
wip: read from cached edges
akhileshh Aug 21, 2023
36526d1
wip: edits refactor
akhileshh Aug 21, 2023
6c6375e
wip: edits refactor
akhileshh Aug 21, 2023
88d3a5d
fix(ingest): cache cross chunk edges from children
akhileshh Aug 22, 2023
a34f476
feat: add unique flag
akhileshh Aug 22, 2023
59bac66
feat: cross edges column family gcversionrule
akhileshh Aug 22, 2023
48139b7
fix: convert input to np arrays
akhileshh Aug 22, 2023
aadfe82
fix: linting issues
akhileshh Aug 22, 2023
9f935d1
wip: edits refactor
akhileshh Aug 22, 2023
2edccc9
fix: undo gcrule changes
akhileshh Aug 23, 2023
8af6407
fix: add mock_edges; linting issues
akhileshh Aug 23, 2023
0a23d84
feat: edits using cached cross edges
akhileshh Aug 23, 2023
8f49c30
fix: use function for dry code
akhileshh Aug 24, 2023
fa901b2
fix: mask skipped nodes
akhileshh Aug 28, 2023
3f2759c
fix: use the correct layer variable
akhileshh Aug 28, 2023
d53e0fd
fix: redis pipeline for lower latency
akhileshh Aug 29, 2023
cd76cad
fix: pass redis connection
akhileshh Aug 29, 2023
4a0d1a2
fix: version update for deployment
akhileshh Aug 29, 2023
ce27bba
fix: status print padding
akhileshh Aug 29, 2023
23f6458
fix: filter active edges for split, add timestamp for reading cross c…
akhileshh Aug 30, 2023
64a678b
fix: get roots no cache flag
akhileshh Aug 30, 2023
aee03d2
fix: parent and roots no cache
akhileshh Aug 31, 2023
8b60346
fix: out edges here dont refer to edges crossing chunk
akhileshh Aug 31, 2023
ecba1cc
fix: missing timestamps
akhileshh Sep 2, 2023
c18bd99
fix: consolidate neighbor nodes cx edge updates
akhileshh Sep 8, 2023
51554a3
fix: set to list for np.array
akhileshh Sep 8, 2023
43dc7f9
fix: use copy=False where possible; some cleanup
akhileshh Sep 8, 2023
d4bf022
fix: attribute type must be np.array
akhileshh Sep 8, 2023
e19440d
fix(ingest): worker details in status
akhileshh Sep 9, 2023
93a2f27
fix: handle empty input
akhileshh Sep 9, 2023
b2e0b94
fix: use empty array instead
akhileshh Sep 9, 2023
b75fbde
fix: missed time_stamp
akhileshh Sep 10, 2023
cadede5
fix: only consolidate cx_edge writes; update per new_id
akhileshh Sep 10, 2023
f95d892
fix: reset parent layer in loop
akhileshh Sep 11, 2023
6637066
fix(ingest): use get_roots with ceil=False instead of get_parents
akhileshh Sep 11, 2023
0393f33
fix(ingest): incorrect stop_layer
akhileshh Sep 11, 2023
cfa4ba0
fix: add safeguard to against data corruption
akhileshh Sep 12, 2023
f095925
add another safeguard
akhileshh Sep 12, 2023
6b0bf9d
feat: log operation_id in errors
akhileshh Sep 12, 2023
c86ba6d
fix: remove temp error
akhileshh Sep 12, 2023
5337e44
add more safeguards
akhileshh Sep 12, 2023
9adb8a7
fix: circular import
akhileshh Sep 12, 2023
e9977e1
fix: consider layer 2 as well
akhileshh Sep 12, 2023
99d7b07
fix(edits): incorrect order of opeartions; documentation
akhileshh Sep 13, 2023
9dd30e5
feat(ingest): add tests command
akhileshh Sep 15, 2023
21d5f32
fix(edits): make sure to add reverse edges
akhileshh Sep 26, 2023
dd64aa4
fix(edits): read neighbor cx edges from cache
akhileshh Sep 26, 2023
8cd2aa7
fix(edits): check for no cx edges; comments
akhileshh Sep 27, 2023
17d0d46
fix(edits): update neighbor cx edges in a skipped layer
akhileshh Oct 3, 2023
c828449
fix(edits): make sure to update all skipped neighbors
akhileshh Oct 11, 2023
d6e0e63
fix(edits): ignore new ids in neighbor update
akhileshh Oct 11, 2023
fce92a6
add docs
akhileshh Oct 12, 2023
0f7399d
fix: resolve column filter ambiguity
akhileshh Jan 14, 2024
7536d90
fix: resolve column filter ambiguity(2)
akhileshh Jan 14, 2024
c17c41b
V3 migration (#484)
akhileshh May 12, 2024
c4ac266
reset version v3
akhileshh May 12, 2024
03179b4
breakup long fn
akhileshh May 12, 2024
3eba2a8
gh actions for pcgv3
akhileshh May 15, 2024
5e01622
update split tests (#497)
akhileshh May 25, 2024
db227e5
segregate update nodes logic
akhileshh Jun 10, 2024
e96c1e5
fix(edits): overwrite children partners when superseded by parents
akhileshh Jun 28, 2024
55df0d6
fix: unique edges always, predecing edit ts, allow same segment merge
akhileshh Jul 4, 2024
8febe81
Bump version: 3.0.0 → 3.0.1
akhileshh Jul 4, 2024
3df48be
fix(edits): mask all descendants when updating cx edges
akhileshh Jul 6, 2024
05afaad
Bump version: 3.0.1 → 3.0.2
akhileshh Jul 6, 2024
50c94c4
fix(edits): use supervoxels to get the correct cross edge parents
akhileshh Jul 7, 2024
a128a3a
Bump version: 3.0.2 → 3.0.3
akhileshh Jul 7, 2024
1d5270d
fix(edits/split): filter out inactive cross edges
akhileshh Jul 16, 2024
d35c440
fix(edits/split): filter out inactive cross edges AT EACH LAYER
akhileshh Jul 17, 2024
fb5178c
migration debug code
akhileshh Aug 30, 2024
b0f2ff1
use parent timestamps to lift cx edges
akhileshh Sep 22, 2024
d05a55a
make dynamic mesh dir graph specific
akhileshh Sep 23, 2024
3a4fe64
fix(upgrade): use hierarchy from supervoxels
akhileshh Sep 26, 2024
fa24c99
fix(upgrade): include cx edges at node_ts explicitly
akhileshh Sep 26, 2024
3ad0973
adds job type guard, flush_redis prompts, improved status output
akhileshh Sep 29, 2024
4e22c06
fix(upgrade): include timestamps for partner supervoxel parents
akhileshh Nov 10, 2024
28f9773
fix(upgrade): use timestamps of partners at layers > 2
akhileshh Nov 21, 2024
9bef014
version 3.0.9
akhileshh Dec 5, 2024
e0565b7
feat: use mesh dir and dynamic dir from metadata
akhileshh Dec 9, 2024
5c6306c
ingest: change job batch size, more logging
akhileshh Jul 15, 2025
5ddfa81
Bump version: 3.0.10 → 3.0.11
akhileshh Jul 15, 2025
2e6fcc8
ingest: add socket_timeout for redis connections
akhileshh Jul 15, 2025
19af42d
Bump version: 3.0.11 → 3.0.12
akhileshh Jul 15, 2025
cc5d0f2
fix(edits): descriptive error message
akhileshh Jul 17, 2025
b428147
Bump version: 3.0.12 → 3.0.13
akhileshh Jul 17, 2025
aee77f4
fix(edits): find stale edges and their latest nodes
akhileshh Jul 29, 2025
20b4cf2
fix(edits): more precise filter for latest edges; error on chunk_id m…
akhileshh Aug 3, 2025
2662751
fix(edits): account for fake edges when finding latest edges
akhileshh Aug 5, 2025
7c2edc5
fix(upgrade): use start and end timestamps to filter out irreleveant …
akhileshh Oct 21, 2025
52708ab
fix(upgrade): remove unnecessary checks to reduce latency
akhileshh Oct 22, 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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.21.1
current_version = 3.1.0
commit = True
tag = True

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- "main"
- "pcgv3"
pull_request:
branches:
- "main"
- "pcgv3"

jobs:
unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion pychunkedgraph/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.21.1"
__version__ = "3.1.0"
2 changes: 2 additions & 0 deletions pychunkedgraph/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def configure_app(app):
with app.app_context():
from ..ingest.rq_cli import init_rq_cmds
from ..ingest.cli import init_ingest_cmds
from ..ingest.cli_upgrade import init_upgrade_cmds

init_rq_cmds(app)
init_ingest_cmds(app)
init_upgrade_cmds(app)
40 changes: 8 additions & 32 deletions pychunkedgraph/app/meshing/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import threading

import numpy as np
import redis
from rq import Queue, Connection, Retry
from flask import Response, current_app, jsonify, make_response, request

from pychunkedgraph import __version__
Expand Down Expand Up @@ -145,37 +143,15 @@ def _check_post_options(cg, resp, data, seg_ids):
def handle_remesh(table_id):
current_app.request_type = "remesh_enque"
current_app.table_id = table_id
is_priority = request.args.get("priority", True, type=str2bool)
is_redisjob = request.args.get("use_redis", False, type=str2bool)

new_lvl2_ids = json.loads(request.data)["new_lvl2_ids"]

if is_redisjob:
with Connection(redis.from_url(current_app.config["REDIS_URL"])):

if is_priority:
retry = Retry(max=3, interval=[1, 10, 60])
queue_name = "mesh-chunks"
else:
retry = Retry(max=3, interval=[60, 60, 60])
queue_name = "mesh-chunks-low-priority"
q = Queue(queue_name, retry=retry, default_timeout=1200)
task = q.enqueue(meshing_tasks.remeshing, table_id, new_lvl2_ids)

response_object = {"status": "success", "data": {"task_id": task.get_id()}}

return jsonify(response_object), 202
else:
new_lvl2_ids = np.array(new_lvl2_ids, dtype=np.uint64)
cg = app_utils.get_cg(table_id)

if len(new_lvl2_ids) > 0:
t = threading.Thread(
target=_remeshing, args=(cg.get_serialized_info(), new_lvl2_ids)
)
t.start()

return Response(status=202)
new_lvl2_ids = np.array(new_lvl2_ids, dtype=np.uint64)
cg = app_utils.get_cg(table_id)
if len(new_lvl2_ids) > 0:
t = threading.Thread(
target=_remeshing, args=(cg.get_serialized_info(), new_lvl2_ids)
)
t.start()
return Response(status=202)


def _remeshing(serialized_cg_info, lvl2_nodes):
Expand Down
60 changes: 0 additions & 60 deletions pychunkedgraph/debug/cross_edge_test.py

This file was deleted.

78 changes: 0 additions & 78 deletions pychunkedgraph/debug/existence_test.py

This file was deleted.

54 changes: 0 additions & 54 deletions pychunkedgraph/debug/family_test.py

This file was deleted.

52 changes: 40 additions & 12 deletions pychunkedgraph/debug/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# pylint: disable=invalid-name, missing-docstring, bare-except, unidiomatic-typecheck

import numpy as np

from ..graph import ChunkedGraph
from ..graph.utils.basetypes import NODE_ID
from pychunkedgraph.graph.meta import ChunkedGraphMeta, GraphConfig


def print_attrs(d):
Expand All @@ -16,28 +17,55 @@ def print_attrs(d):
print(v)


def print_node(
cg: ChunkedGraph,
node: NODE_ID,
indent: int = 0,
stop_layer: int = 2,
) -> None:
def print_node(cg, node: np.uint64, indent: int = 0, stop_layer: int = 2) -> None:
children = cg.get_children(node)
print(f"{' ' * indent}{node}[{len(children)}]")
if cg.get_chunk_layer(node) <= stop_layer:
return
for child in children:
print_node(cg, child, indent=indent + 1, stop_layer=stop_layer)
print_node(cg, child, indent=indent + 4, stop_layer=stop_layer)


def get_l2children(cg: ChunkedGraph, node: NODE_ID) -> np.ndarray:
nodes = np.array([node], dtype=NODE_ID)
def get_l2children(cg, node: np.uint64) -> np.ndarray:
nodes = np.array([node], dtype=np.uint64)
layers = cg.get_chunk_layers(nodes)
assert np.all(layers > 2), "nodes must be at layers > 2"
assert np.all(layers >= 2), "nodes must be at layers >= 2"
l2children = []
while nodes.size:
children = cg.get_children(nodes, flatten=True)
layers = cg.get_chunk_layers(children)
l2children.append(children[layers == 2])
nodes = children[layers > 2]
return np.concatenate(l2children)


def sanity_check(cg, new_roots, operation_id):
"""
Check for duplicates in hierarchy, useful for debugging.
"""
# print(f"{len(new_roots)} new ids from {operation_id}")
l2c_d = {}
for new_root in new_roots:
l2c_d[new_root] = get_l2children(cg, new_root)
success = True
for k, v in l2c_d.items():
success = success and (len(v) == np.unique(v).size)
# print(f"{k}: {np.unique(v).size}, {len(v)}")
if not success:
raise RuntimeError("Some ids are not valid.")


def sanity_check_single(cg, node, operation_id):
v = get_l2children(cg, node)
msg = f"invalid node {node}:"
msg += f" found {len(v)} l2 ids, must be {np.unique(v).size}"
assert np.unique(v).size == len(v), f"{msg}, from {operation_id}."
return v


def update_graph_id(cg, new_graph_id:str):
old_gc = cg.meta.graph_config._asdict()
old_gc["ID"] = new_graph_id
new_gc = GraphConfig(**old_gc)
new_meta = ChunkedGraphMeta(new_gc, cg.meta.data_source, cg.meta.custom_data)
cg.update_meta(new_meta, overwrite=True)
Loading