Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 |
"""
|
|
2 |
test_basic_plot.py
|
|
3 |
"""
|
|
4 |
import sys |
|
5 |
import os |
|
6 |
import pytest |
|
7 |
import shutil |
|
8 |
|
|
9 |
# define location of input files for testing
|
|
10 |
mydir = os.path.dirname(os.path.abspath(__file__)) |
|
11 |
|
|
12 |
# import functions to aid testing
|
|
13 |
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers')) |
|
14 |
from helper import * |
|
15 |
|
|
16 |
from quanformer.basic_plot import * |
|
17 |
|
|
18 |
import matplotlib as mpl |
|
19 |
mpl.use("Agg") # for Mac OS X error of NSInvalidArgumentException on Travis CI |
|
20 |
|
|
21 |
# -----------------------
|
|
22 |
|
|
23 |
|
|
24 |
def test_basic_plot(): |
|
25 |
basic_plot(os.path.join(mydir, 'data_tests', 'survey_confs', 'divrefine-220.sdf'), |
|
26 |
tag='QM Psi4 Final Opt. Energy (Har) b3lyp-d3mbj/def2-tzvp', |
|
27 |
style='line', |
|
28 |
take_relative=True, |
|
29 |
har_to_kcal=True) |
|
30 |
os.remove('output_0.png') |
|
31 |
os.remove('output_1.png') |
|
32 |
|
|
33 |
def test_combine_files_plot(): |
|
34 |
os.chdir(mydir) |
|
35 |
combine_files_plot(os.path.join(mydir, 'data_tests', 'survey_confs', 'stitch_ene.in'), |
|
36 |
molname='Div_6', |
|
37 |
verbose=True, |
|
38 |
take_relative=True, |
|
39 |
har_to_kcal=True) |
|
40 |
os.remove('combined.dat') |
|
41 |
os.remove('combined.png') |
|
42 |
|
|
43 |
|
|
44 |
# test manually without pytest
|
|
45 |
if 0: |
|
46 |
sys.path.insert(0, '/home/limvt/Documents/quanformer/quanformer') |
|
47 |
from basic_plot import * |
|
48 |
test_basic_plot() |
Read our documentation on viewing source code .