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

checks in get_latest_roots that all IDs are current #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,9 @@ def get_latest_roots(self, root_id, timestamp=None, timestamp_future=None):
out_degree_dict = dict(lineage_graph.out_degree)
nodes = np.array(list(out_degree_dict.keys()))
out_degrees = np.array(list(out_degree_dict.values()))
return nodes[out_degrees == 0]
out_degree_nodes = nodes[out_degrees == 0]
are_they_current = self.is_latest_roots(out_degree_nodes,timestamp=timestamp)
return out_degree_nodes[are_they_current]
else:
# then timestamp is in fact in the past
lineage_graph = self.get_lineage_graph(
Expand All @@ -1021,7 +1023,9 @@ def get_latest_roots(self, root_id, timestamp=None, timestamp_future=None):
in_degree_dict = dict(lineage_graph.in_degree)
nodes = np.array(list(in_degree_dict.keys()))
in_degrees = np.array(list(in_degree_dict.values()))
return nodes[in_degrees == 0]
in_degree_nodes = nodes[in_degrees == 0]
are_they_current = self.is_latest_roots(in_degree_nodes,timestamp=timestamp)
return in_degree_nodes[are_they_current]

def get_original_roots(self, root_id, timestamp_past=None):
"""Returns root IDs that are the latest successors of a given root ID.
Expand Down
Loading