MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / test_random_DAG

Function test_random_DAG

numpy_ml/tests/test_utils.py:288–300  ·  view source on GitHub ↗
(N=1)

Source from the content-addressed store, hash-verified

286
287
288def test_random_DAG(N=1):
289 np.random.seed(12345)
290 i = 0
291 while i < N:
292 p = np.random.uniform(0.25, 1)
293 n_v = np.random.randint(5, 50)
294
295 G = random_DAG(n_v, p)
296 G_nx = to_networkx(G)
297
298 assert nx.is_directed_acyclic_graph(G_nx)
299 print("PASSED")
300 i += 1
301
302
303def test_topological_ordering(N=1):

Callers

nothing calls this directly

Calls 2

random_DAGFunction · 0.90
to_networkxFunction · 0.85

Tested by

no test coverage detected