Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# (c) Stefan Countryman, 2019 

2 

3""" 

4Tests for LLAMA, to be run with ``pytest``. 

5""" 

6 

7from llama.run import Run 

8from llama.utils import TEST_DATA, TEST_EVENT_FILES 

9 

10TEST_RUN_INPUTS = Run(rundir=TEST_EVENT_FILES) 

11 

12 

13def floateql(a, b, prec=1e-15): 

14 """Compares floating point arrays for equality up to some precision.""" 

15 import numpy as np 

16 return all(prec > abs(np.array(a).flatten() - np.array(b).flatten())) 

17 

18 

19__all__ = [ 

20 'TEST_RUN_INPUTS', 

21 'TEST_DATA', 

22 'TEST_EVENT_FILES', 

23]