@@ -43,12 +43,12 @@ class EdgeRange:
43
43
44
44
Attributes
45
45
----------
46
- start : int32
46
+ start : int
47
47
Starting index of the edge range (inclusive).
48
- stop : int32
48
+ stop : int
49
49
Stopping index of the edge range (exclusive).
50
- order : int32[]
51
- Array containing edge IDs in the order they should be processed.
50
+ order : numpy.ndarray
51
+ Array (dtype=np.int32) containing edge IDs in the order they should be processed.
52
52
The edge ids in this range are order[start:stop].
53
53
"""
54
54
@@ -70,10 +70,11 @@ class ParentIndex:
70
70
71
71
Attributes
72
72
----------
73
- edge_index : int32[num_edges]
74
- Array of edge IDs sorted by child node and left coordinate.
75
- index_range : int32[num_nodes, 2]
76
- For each node, the [start, stop) range in edge_index where this node is child.
73
+ edge_index : numpy.ndarray
74
+ Array (dtype=np.int32) of edge IDs sorted by child node and left coordinate.
75
+ index_range : numpy.ndarray
76
+ Array (dtype=np.int32, shape=(num_nodes, 2)) where each row contains the
77
+ [start, stop) range in edge_index where this node is the child.
77
78
"""
78
79
79
80
def __init__ (self , edge_index , index_range ):
@@ -97,20 +98,20 @@ class TreeIndex:
97
98
----------
98
99
ts : NumbaTreeSequence
99
100
Reference to the tree sequence being traversed.
100
- index : int32
101
+ index : int
101
102
Current tree index. -1 indicates no current tree (null state).
102
- direction : int32
103
+ direction : int
103
104
Traversal direction: tskit.FORWARD or tskit.REVERSE. tskit.NULL
104
105
if uninitialised.
105
- interval : tuple of float64
106
+ interval : tuple
106
107
Genomic interval (left, right) covered by the current tree.
107
- in_range : NumbaEdgeRange
108
+ in_range : EdgeRange
108
109
Edges being added to form this current tree, relative to the last state
109
- out_range : NumbaEdgeRange
110
+ out_range : EdgeRange
110
111
Edges being removed to form this current tree, relative to the last state
111
- site_range : tuple of int32
112
+ site_range : tuple
112
113
Range of sites in the current tree (start, stop).
113
- mutation_range : tuple of int32
114
+ mutation_range : tuple
114
115
Range of mutations in the current tree (start, stop).
115
116
116
117
Example
@@ -316,54 +317,56 @@ class NumbaTreeSequence:
316
317
317
318
Attributes
318
319
----------
319
- num_trees : int32
320
+ num_trees : int
320
321
Number of trees in the tree sequence.
321
- num_nodes : int32
322
+ num_nodes : int
322
323
Number of nodes in the tree sequence.
323
- num_samples : int32
324
+ num_samples : int
324
325
Number of samples in the tree sequence.
325
- num_edges : int32
326
+ num_edges : int
326
327
Number of edges in the tree sequence.
327
- num_sites : int32
328
+ num_sites : int
328
329
Number of sites in the tree sequence.
329
- num_mutations : int32
330
+ num_mutations : int
330
331
Number of mutations in the tree sequence.
331
- sequence_length : float64
332
+ sequence_length : float
332
333
Total sequence length of the tree sequence.
333
- edges_left : float64[]
334
- Left coordinates of edges.
335
- edges_right : float64[]
336
- Right coordinates of edges.
337
- edges_parent : int32[]
338
- Parent node IDs for each edge.
339
- edges_child : int32[]
340
- Child node IDs for each edge.
341
- nodes_time : float64[]
342
- Time values for each node.
343
- nodes_flags : uint32[]
344
- Flag values for each node.
345
- nodes_population : int32[]
346
- Population IDs for each node.
347
- nodes_individual : int32[]
348
- Individual IDs for each node.
349
- individuals_flags : uint32[]
350
- Flag values for each individual.
351
- sites_position : float64[]
352
- Positions of sites along the sequence.
353
- mutations_site : int32[]
354
- Site IDs for each mutation.
355
- mutations_node : int32[]
356
- Node IDs for each mutation.
357
- mutations_parent : int32[]
358
- Parent mutation IDs.
359
- mutations_time : float64[]
360
- Time values for each mutation.
361
- breakpoints : float64[]
362
- Genomic positions where trees change.
363
- indexes_edge_insertion_order : int32[]
364
- Order in which edges are inserted during tree building.
365
- indexes_edge_removal_order : int32[]
366
- Order in which edges are removed during tree building.
334
+ edges_left : numpy.ndarray
335
+ Array (dtype=np.float64) of left coordinates of edges.
336
+ edges_right : numpy.ndarray
337
+ Array (dtype=np.float64) of right coordinates of edges.
338
+ edges_parent : numpy.ndarray
339
+ Array (dtype=np.int32) of parent node IDs for each edge.
340
+ edges_child : numpy.ndarray
341
+ Array (dtype=np.int32) of child node IDs for each edge.
342
+ nodes_time : numpy.ndarray
343
+ Array (dtype=np.float64) of time values for each node.
344
+ nodes_flags : numpy.ndarray
345
+ Array (dtype=np.uint32) of flag values for each node.
346
+ nodes_population : numpy.ndarray
347
+ Array (dtype=np.int32) of population IDs for each node.
348
+ nodes_individual : numpy.ndarray
349
+ Array (dtype=np.int32) of individual IDs for each node.
350
+ individuals_flags : numpy.ndarray
351
+ Array (dtype=np.uint32) of flag values for each individual.
352
+ sites_position : numpy.ndarray
353
+ Array (dtype=np.float64) of positions of sites along the sequence.
354
+ mutations_site : numpy.ndarray
355
+ Array (dtype=np.int32) of site IDs for each mutation.
356
+ mutations_node : numpy.ndarray
357
+ Array (dtype=np.int32) of node IDs for each mutation.
358
+ mutations_parent : numpy.ndarray
359
+ Array (dtype=np.int32) of parent mutation IDs.
360
+ mutations_time : numpy.ndarray
361
+ Array (dtype=np.float64) of time values for each mutation.
362
+ breakpoints : numpy.ndarray
363
+ Array (dtype=np.float64) of genomic positions where trees change.
364
+ indexes_edge_insertion_order : numpy.ndarray
365
+ Array (dtype=np.int32) specifying the order in which edges are inserted
366
+ during tree building.
367
+ indexes_edge_removal_order : numpy.ndarray
368
+ Array (dtype=np.int32) specifying the order in which edges are removed
369
+ during tree building.
367
370
368
371
"""
369
372
@@ -443,9 +446,9 @@ def child_index(self):
443
446
"""
444
447
Create child index array for finding child edges of nodes.
445
448
446
- :return: Array where each row [node] contains [start, stop) range of edges
447
- where this node is the parent.
448
- :rtype: int32[num_nodes, 2]
449
+ :return: A numpy array (dtype=np.int32, shape=(num_nodes, 2)) where each row
450
+ contains the [start, stop) range of edges where this node is the parent.
451
+ :rtype: numpy.ndarray
449
452
"""
450
453
child_range = np .full ((self .num_nodes , 2 ), - 1 , dtype = np .int32 )
451
454
edges_parent = self .edges_parent
0 commit comments