Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
d57e4fb
fix: cleanup ingest code
akhileshh Aug 6, 2023
8a95fd8
add ttl column family
akhileshh Aug 6, 2023
935da73
fix: new l2 cx edge attribute
akhileshh Aug 6, 2023
0f2593a
feat: post process sv cross edges
akhileshh Aug 6, 2023
5311a0e
fix: use longer expiry for debugging
akhileshh Aug 11, 2023
8441bec
feat(ingest): read l2 cross edges
akhileshh Aug 11, 2023
d32aad1
feat(ingest): postprocess job handling
akhileshh Aug 12, 2023
a4c7b06
fix(ingest): status
akhileshh Aug 12, 2023
710828f
fix: timedelta import
akhileshh Aug 12, 2023
fb20c26
fix(ingest): status
akhileshh Aug 12, 2023
50755e4
fix(ingest): use hypenated names for valid dns
akhileshh Aug 12, 2023
d7f1c27
fix: rename attr; better var names
akhileshh Aug 20, 2023
5576fc6
fix: rename attr; better var names
akhileshh Aug 20, 2023
193a646
fix: add more docs; better var names
akhileshh Aug 20, 2023
824b9ac
fix: move cross_edges module to ingest module; only used in ingest
akhileshh Aug 20, 2023
1be6d04
fix: reduce mem use; var names; remove unused code
akhileshh Aug 20, 2023
9486187
fix: adds cg typehint
akhileshh Aug 20, 2023
bb1a952
fix: reduce loc
akhileshh Aug 20, 2023
41351b9
fix: use shorter name
akhileshh Aug 20, 2023
d36d43c
feat: cache cx edges at each layer
akhileshh Aug 20, 2023
a841114
fix: convert array type
akhileshh Aug 20, 2023
3072aa1
fix: use atomic edges during ingest
akhileshh Aug 20, 2023
c39872d
fix: tests
akhileshh Aug 20, 2023
64d18bc
fix: remove postprocess step
akhileshh Aug 20, 2023
4efa345
fix: raises specific error
akhileshh Aug 20, 2023
638da49
fix: removes dangerous default value
akhileshh Aug 21, 2023
da1e8d9
wip: read from cached edges
akhileshh Aug 21, 2023
0084579
wip: edits refactor
akhileshh Aug 21, 2023
3846fdf
wip: edits refactor
akhileshh Aug 21, 2023
4f0750f
fix(ingest): cache cross chunk edges from children
akhileshh Aug 22, 2023
ad1f32d
feat: add unique flag
akhileshh Aug 22, 2023
9cf9ada
feat: cross edges column family gcversionrule
akhileshh Aug 22, 2023
3ced5d8
fix: convert input to np arrays
akhileshh Aug 22, 2023
85d00b4
fix: linting issues
akhileshh Aug 22, 2023
f42ad42
wip: edits refactor
akhileshh Aug 22, 2023
cb7426a
fix: undo gcrule changes
akhileshh Aug 23, 2023
9d03201
fix: add mock_edges; linting issues
akhileshh Aug 23, 2023
e8aff59
feat: edits using cached cross edges
akhileshh Aug 23, 2023
41ed9ca
fix: use function for dry code
akhileshh Aug 24, 2023
a889250
fix: mask skipped nodes
akhileshh Aug 28, 2023
c7783f0
fix: use the correct layer variable
akhileshh Aug 28, 2023
9c5f041
fix: redis pipeline for lower latency
akhileshh Aug 29, 2023
7975336
fix: pass redis connection
akhileshh Aug 29, 2023
0157b22
fix: version update for deployment
akhileshh Aug 29, 2023
4bab5c0
fix: status print padding
akhileshh Aug 29, 2023
6b31662
fix: filter active edges for split, add timestamp for reading cross c…
akhileshh Aug 30, 2023
a9de28b
fix: get roots no cache flag
akhileshh Aug 30, 2023
9d00933
fix: parent and roots no cache
akhileshh Aug 31, 2023
546ddac
fix: out edges here dont refer to edges crossing chunk
akhileshh Aug 31, 2023
7328d0e
fix: missing timestamps
akhileshh Sep 2, 2023
e742f88
fix: consolidate neighbor nodes cx edge updates
akhileshh Sep 8, 2023
d3b1fe8
fix: set to list for np.array
akhileshh Sep 8, 2023
0cd26b3
fix: use copy=False where possible; some cleanup
akhileshh Sep 8, 2023
b1cfee2
fix: attribute type must be np.array
akhileshh Sep 8, 2023
fa31648
fix(ingest): worker details in status
akhileshh Sep 9, 2023
a4debc7
fix: handle empty input
akhileshh Sep 9, 2023
83745c7
fix: use empty array instead
akhileshh Sep 9, 2023
1bc64ee
fix: missed time_stamp
akhileshh Sep 10, 2023
ea13a4d
fix: only consolidate cx_edge writes; update per new_id
akhileshh Sep 10, 2023
2626d0a
fix: reset parent layer in loop
akhileshh Sep 11, 2023
e10be50
fix(ingest): use get_roots with ceil=False instead of get_parents
akhileshh Sep 11, 2023
820f38a
fix(ingest): incorrect stop_layer
akhileshh Sep 11, 2023
1cd4215
fix: add safeguard to against data corruption
akhileshh Sep 12, 2023
3705161
add another safeguard
akhileshh Sep 12, 2023
de4c2e1
feat: log operation_id in errors
akhileshh Sep 12, 2023
d2638c4
fix: remove temp error
akhileshh Sep 12, 2023
c8c0984
add more safeguards
akhileshh Sep 12, 2023
6fa7f88
fix: circular import
akhileshh Sep 12, 2023
59edc98
fix: consider layer 2 as well
akhileshh Sep 12, 2023
4086311
fix(edits): incorrect order of opeartions; documentation
akhileshh Sep 13, 2023
3eda639
feat(ingest): add tests command
akhileshh Sep 15, 2023
312119c
fix(edits): make sure to add reverse edges
akhileshh Sep 26, 2023
0dab362
fix(edits): read neighbor cx edges from cache
akhileshh Sep 26, 2023
d51607b
fix(edits): check for no cx edges; comments
akhileshh Sep 27, 2023
a1a1a48
fix(edits): update neighbor cx edges in a skipped layer
akhileshh Oct 3, 2023
8b17a35
fix(edits): make sure to update all skipped neighbors
akhileshh Oct 11, 2023
8b730c6
fix(edits): ignore new ids in neighbor update
akhileshh Oct 11, 2023
c80cf90
add docs
akhileshh Oct 12, 2023
a405ed7
fix: resolve column filter ambiguity
akhileshh Jan 14, 2024
6da21fc
fix: resolve column filter ambiguity(2)
akhileshh Jan 14, 2024
e5f2d0a
V3 migration (#484)
akhileshh May 12, 2024
f018a76
reset version v3
akhileshh May 12, 2024
84c77c7
breakup long fn
akhileshh May 12, 2024
797378d
gh actions for pcgv3
akhileshh May 15, 2024
98cf76a
update split tests (#497)
akhileshh May 25, 2024
e4d16d9
segregate update nodes logic
akhileshh Jun 10, 2024
d06eecb
fix(edits): overwrite children partners when superseded by parents
akhileshh Jun 28, 2024
fd09f30
fix: unique edges always, predecing edit ts, allow same segment merge
akhileshh Jul 4, 2024
c8d6bd7
Bump version: 3.0.0 → 3.0.1
akhileshh Jul 4, 2024
070f38d
fix(edits): mask all descendants when updating cx edges
akhileshh Jul 6, 2024
ab826d9
Bump version: 3.0.1 → 3.0.2
akhileshh Jul 6, 2024
f1dd317
fix(edits): use supervoxels to get the correct cross edge parents
akhileshh Jul 7, 2024
503f684
Bump version: 3.0.2 → 3.0.3
akhileshh Jul 7, 2024
4448eae
fix(edits/split): filter out inactive cross edges
akhileshh Jul 16, 2024
bc1c939
fix(edits/split): filter out inactive cross edges AT EACH LAYER
akhileshh Jul 17, 2024
8830199
migration debug code
akhileshh Aug 30, 2024
c5ff68a
use parent timestamps to lift cx edges
akhileshh Sep 22, 2024
ac76672
make dynamic mesh dir graph specific
akhileshh Sep 23, 2024
1ee4c30
fix(upgrade): use hierarchy from supervoxels
akhileshh Sep 26, 2024
7d30657
fix(upgrade): include cx edges at node_ts explicitly
akhileshh Sep 26, 2024
811e7a2
adds job type guard, flush_redis prompts, improved status output
akhileshh Sep 29, 2024
9e039bd
fix(upgrade): include timestamps for partner supervoxel parents
akhileshh Nov 10, 2024
a07cf77
fix(upgrade): use timestamps of partners at layers > 2
akhileshh Nov 21, 2024
f8b1e43
version 3.0.9
akhileshh Dec 5, 2024
1d57ed5
feat: use mesh dir and dynamic dir from metadata
akhileshh Dec 9, 2024
ba97cea
ingest: change job batch size, more logging
akhileshh Jul 15, 2025
d0626a2
Bump version: 3.0.10 → 3.0.11
akhileshh Jul 15, 2025
43b4185
ingest: add socket_timeout for redis connections
akhileshh Jul 15, 2025
9fd5e88
Bump version: 3.0.11 → 3.0.12
akhileshh Jul 15, 2025
9e4b57a
fix(edits): descriptive error message
akhileshh Jul 17, 2025
8e7cfce
Bump version: 3.0.12 → 3.0.13
akhileshh Jul 17, 2025
5a1d153
fix(edits): find stale edges and their latest nodes
akhileshh Jul 29, 2025
f7bd517
fix(edits): more precise filter for latest edges; error on chunk_id m…
akhileshh Aug 3, 2025
cb11034
fix(edits): account for fake edges when finding latest edges
akhileshh Aug 5, 2025
eaab3d0
fix(upgrade): use start and end timestamps to filter out irreleveant …
akhileshh Aug 18, 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.20.0
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.20.0"
__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