MCPcopy Create free account
hub / github.com/numpy/numpy / comp_state

Function comp_state

numpy/random/tests/test_smoke.py:62–76  ·  view source on GitHub ↗
(state1, state2)

Source from the content-addressed store, hash-verified

60
61
62def comp_state(state1, state2):
63 identical = True
64 if isinstance(state1, dict):
65 for key in state1:
66 identical &= comp_state(state1[key], state2[key])
67 elif type(state1) != type(state2):
68 identical &= type(state1) == type(state2)
69 else:
70 if (isinstance(state1, (list, tuple, np.ndarray)) and isinstance(
71 state2, (list, tuple, np.ndarray))):
72 for s1, s2 in zip(state1, state2):
73 identical &= comp_state(s1, s2)
74 else:
75 identical &= state1 == state2
76 return identical
77
78
79def warmup(rg, n=None):

Callers 11

test_initMethod · 0.85
test_advanceMethod · 0.85
test_jumpMethod · 0.85
test_entropy_initMethod · 0.85
test_seedMethod · 0.85
test_pickleMethod · 0.85
test_seed_arrayMethod · 0.85
test_uniform_floatMethod · 0.85
test_gamma_floatsMethod · 0.85
test_normal_floatsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected