Show More
@@ -46,6 +46,20 b' import random' | |||
|
46 | 46 | import util, dagutil |
|
47 | 47 | |
|
48 | 48 | def _updatesample(dag, nodes, sample, always, quicksamplesize=0): |
|
49 | """update an existing sample to match the expected size | |
|
50 | ||
|
51 | The sample is updated with nodes exponentially distant from each head of the | |
|
52 | <nodes> set. (H~1, H~2, H~4, H~8, etc). | |
|
53 | ||
|
54 | If a target size is specified, the sampling will stop once this size is | |
|
55 | reached. Otherwise sampling will happen until roots of the <nodes> set are | |
|
56 | reached. | |
|
57 | ||
|
58 | :dag: a dag object from dagutil | |
|
59 | :nodes: set of nodes we want to discover (if None, assume the whole dag) | |
|
60 | :sample: a sample to update | |
|
61 | :always: set of notable nodes that will be part of the sample anyway | |
|
62 | :quicksamplesize: optional target size of the sample""" | |
|
49 | 63 | # if nodes is empty we scan the entire graph |
|
50 | 64 | if nodes: |
|
51 | 65 | heads = dag.headsetofconnecteds(nodes) |
General Comments 0
You need to be logged in to leave comments.
Login now