Skip to content

Commit 9a96c76

Browse files
committed
test clean-up
1 parent 5884908 commit 9a96c76

File tree

9 files changed

+7921
-9
lines changed

9 files changed

+7921
-9
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PYTHONVERS=python3.8 python3.7 python3.6 python3.5 python2.7
1111
VERSION=0.1.5b4
1212
SHELL:= /bin/bash
1313

14-
LONG_TESTS=true
14+
LONG_TESTS=false
1515

1616
# Select this to have anaconda installed for you.
1717
CONDA=./anaconda3
@@ -141,6 +141,7 @@ endif
141141
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_chunking.py
142142
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_hapitime2datetime.py
143143
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_hapitime_reformat.py
144+
144145
# These require visual inspection.
145146
repository-test-plots:
146147
@make clean

hapiclient/test/readcompare.log

Whitespace-only changes.

hapiclient/test/readcompare.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import pickle
23
import numpy as np
34

@@ -66,11 +67,12 @@ def closeFloats(a, b):
6667

6768

6869
# Create empty file
69-
with open("readcompare.log", "w") as f: pass
70+
logfile = os.path.realpath(__file__)[0:-2] + "log"
71+
with open(logfile, "w") as f: pass
7072

7173
def xprint(msg):
7274
print(msg)
73-
f = open("readcompare.log", "a")
75+
f = open(logfile, "a")
7476
f.write(msg + "\n")
7577
f.close()
7678

hapiclient/test/test_chunking.log

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
________________________________________________________________________________
2+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
3+
options 2: {'logging': False, 'usecache': False, 'cache': False}
4+
x_totalTime1 = 0.7053 s
5+
x_totalTime2 = 0.6169 s
6+
________________________________________________________________________________
7+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
8+
options 2: {'logging': False, 'usecache': False, 'cache': False, 'n_chunks': 2}
9+
x_totalTime1 = 0.7053 s
10+
x_totalTime2 = 1.0725 s
11+
________________________________________________________________________________
12+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
13+
options 2: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': 'PT1H'}
14+
x_totalTime1 = 0.7053 s
15+
x_totalTime2 = 2.3334 s
16+
________________________________________________________________________________
17+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
18+
options 2: {'logging': False, 'usecache': False, 'cache': False, 'parallel': True, 'n_chunks': 2}
19+
x_totalTime1 = 0.7053 s
20+
x_totalTime2 = 0.6128 s
21+
________________________________________________________________________________
22+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
23+
options 2: {'logging': False, 'usecache': False, 'cache': False, 'parallel': True, 'dt_chunk': 'PT1H'}
24+
x_totalTime1 = 0.7053 s
25+
x_totalTime2 = 0.7664 s
26+
________________________________________________________________________________
27+
options 1: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': None}
28+
options 2: {'logging': False, 'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
29+
x_totalTime1 = 0.7747 s
30+
x_totalTime2 = 0.8439 s
31+
________________________________________________________________________________
32+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
33+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
34+
x_totalTime1 = 0.6427 s
35+
x_totalTime2 = 0.7466 s
36+
________________________________________________________________________________
37+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
38+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
39+
x_totalTime1 = 0.6427 s
40+
x_totalTime2 = 0.6501 s
41+
________________________________________________________________________________
42+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
43+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
44+
x_totalTime1 = 0.6427 s
45+
x_totalTime2 = 0.5770 s
46+
________________________________________________________________________________
47+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
48+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
49+
x_totalTime1 = 1.8516 s
50+
x_totalTime2 = 12.5979 s
51+
________________________________________________________________________________
52+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
53+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
54+
x_totalTime1 = 1.8516 s
55+
x_totalTime2 = 15.6459 s
56+
________________________________________________________________________________
57+
options 1: {'usecache': False, 'cache': False, 'dt_chunk': None}
58+
options 2: {'usecache': False, 'cache': False, 'dt_chunk': 'infer'}
59+
x_totalTime1 = 1.8516 s
60+
x_totalTime2 = 14.4577 s

hapiclient/test/test_chunking.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import isodate
23

34
from datetime import datetime
@@ -11,11 +12,11 @@
1112
hapi_logging = False
1213

1314
# Create empty file
14-
with open("test_chunking.log", "w") as f: pass
15+
logfile = os.path.realpath(__file__)[0:-2] + "log"
1516

1617
def xprint(msg):
1718
print(msg)
18-
f = open("test_hapitime_reformat.log", "a")
19+
f = open(logfile, "a")
1920
f.write(msg + "\n")
2021
f.close()
2122

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
test_api(): API test.
2+
hapitime2datetime(): Pandas processing time = 0.0018s, first time = 1970-01-01T00:00:00.000Z
3+
hapitime2datetime(): Pandas processing time = 0.0008s, first time = 1970-01-01T00:00:00.000Z
4+
hapitime2datetime(): Pandas processing time = 0.0007s, first time = 1970-01-01T00:00:00.000Z
5+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1970-01-01T00:00:00.000Z
6+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1970-01-01T00:00:00.000Z
7+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1970-01-01T00:00:00.000Z
8+
test_parsing(): Parse test.
9+
hapitime2datetime(): Pandas processing failed, first time = 1989Z
10+
hapitime2datetime(): Manual processing time = 0.0023s, Input = 1989Z, fmt = %YZ
11+
hapitime2datetime(): Pandas processing failed, first time = 1989-01Z
12+
hapitime2datetime(): Manual processing time = 0.0009s, Input = 1989-01Z, fmt = %Y-%mZ
13+
hapitime2datetime(): Pandas processing failed, first time = 1989-001Z
14+
hapitime2datetime(): Manual processing time = 0.0007s, Input = 1989-001Z, fmt = %Y-%jZ
15+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01Z
16+
hapitime2datetime(): Manual processing time = 0.0009s, Input = 1989-01-01Z, fmt = %Y-%m-%dZ
17+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00Z
18+
hapitime2datetime(): Manual processing time = 0.0009s, Input = 1989-001T00Z, fmt = %Y-%jT%HZ
19+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00Z
20+
hapitime2datetime(): Manual processing time = 0.0011s, Input = 1989-01-01T00Z, fmt = %Y-%m-%dT%HZ
21+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00Z
22+
hapitime2datetime(): Manual processing time = 0.0009s, Input = 1989-001T00:00Z, fmt = %Y-%jT%H:%MZ
23+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00:00Z
24+
hapitime2datetime(): Manual processing time = 0.0011s, Input = 1989-01-01T00:00Z, fmt = %Y-%m-%dT%H:%MZ
25+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.Z
26+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-001T00:00:00.Z, fmt = %Y-%jT%H:%M:%S.Z
27+
hapitime2datetime(): Pandas processing time = 0.0004s, first time = 1989-01-01T00:00:00.Z
28+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1989-01-01T00:00:00.0Z
29+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.0Z
30+
hapitime2datetime(): Manual processing time = 0.0011s, Input = 1989-001T00:00:00.0Z, fmt = %Y-%jT%H:%M:%S.%fZ
31+
hapitime2datetime(): Pandas processing time = 0.0007s, first time = 1989-01-01T00:00:00.00Z
32+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.00Z
33+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.00Z, fmt = %Y-%jT%H:%M:%S.%fZ
34+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1989-01-01T00:00:00.000Z
35+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.000Z
36+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.000Z, fmt = %Y-%jT%H:%M:%S.%fZ
37+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1989-01-01T00:00:00.0000Z
38+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.0000Z
39+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.0000Z, fmt = %Y-%jT%H:%M:%S.%fZ
40+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1989-01-01T00:00:00.00000Z
41+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.00000Z
42+
hapitime2datetime(): Manual processing time = 0.0006s, Input = 1989-001T00:00:00.00000Z, fmt = %Y-%jT%H:%M:%S.%fZ
43+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00:00:00.000000Z
44+
hapitime2datetime(): Manual processing time = 0.0016s, Input = 1989-01-01T00:00:00.000000Z, fmt = %Y-%m-%dT%H:%M:%S.%fZ
45+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.000000Z
46+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.000000Z, fmt = %Y-%jT%H:%M:%S.%fZ
47+
test_error_conditions(): Checking that hapitime2datetime(1999) throws HAPIError
48+
test_api(): API test.
49+
hapitime2datetime(): Pandas processing time = 0.0049s, first time = 1970-01-01T00:00:00.000Z
50+
hapitime2datetime(): Pandas processing time = 0.0023s, first time = 1970-01-01T00:00:00.000Z
51+
hapitime2datetime(): Pandas processing time = 0.0016s, first time = 1970-01-01T00:00:00.000Z
52+
hapitime2datetime(): Pandas processing time = 0.0014s, first time = 1970-01-01T00:00:00.000Z
53+
hapitime2datetime(): Pandas processing time = 0.0015s, first time = 1970-01-01T00:00:00.000Z
54+
hapitime2datetime(): Pandas processing time = 0.0010s, first time = 1970-01-01T00:00:00.000Z
55+
test_parsing(): Parse test.
56+
hapitime2datetime(): Pandas processing failed, first time = 1989Z
57+
hapitime2datetime(): Manual processing time = 0.0021s, Input = 1989Z, fmt = %YZ
58+
hapitime2datetime(): Pandas processing failed, first time = 1989-01Z
59+
hapitime2datetime(): Manual processing time = 0.0008s, Input = 1989-01Z, fmt = %Y-%mZ
60+
hapitime2datetime(): Pandas processing failed, first time = 1989-001Z
61+
hapitime2datetime(): Manual processing time = 0.0008s, Input = 1989-001Z, fmt = %Y-%jZ
62+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01Z
63+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-01-01Z, fmt = %Y-%m-%dZ
64+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00Z
65+
hapitime2datetime(): Manual processing time = 0.0008s, Input = 1989-001T00Z, fmt = %Y-%jT%HZ
66+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00Z
67+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-01-01T00Z, fmt = %Y-%m-%dT%HZ
68+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00Z
69+
hapitime2datetime(): Manual processing time = 0.0009s, Input = 1989-001T00:00Z, fmt = %Y-%jT%H:%MZ
70+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00:00Z
71+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-01-01T00:00Z, fmt = %Y-%m-%dT%H:%MZ
72+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.Z
73+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-001T00:00:00.Z, fmt = %Y-%jT%H:%M:%S.Z
74+
hapitime2datetime(): Pandas processing time = 0.0004s, first time = 1989-01-01T00:00:00.Z
75+
hapitime2datetime(): Pandas processing time = 0.0006s, first time = 1989-01-01T00:00:00.0Z
76+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.0Z
77+
hapitime2datetime(): Manual processing time = 0.0010s, Input = 1989-001T00:00:00.0Z, fmt = %Y-%jT%H:%M:%S.%fZ
78+
hapitime2datetime(): Pandas processing time = 0.0007s, first time = 1989-01-01T00:00:00.00Z
79+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.00Z
80+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.00Z, fmt = %Y-%jT%H:%M:%S.%fZ
81+
hapitime2datetime(): Pandas processing time = 0.0007s, first time = 1989-01-01T00:00:00.000Z
82+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.000Z
83+
hapitime2datetime(): Manual processing time = 0.0007s, Input = 1989-001T00:00:00.000Z, fmt = %Y-%jT%H:%M:%S.%fZ
84+
hapitime2datetime(): Pandas processing time = 0.0009s, first time = 1989-01-01T00:00:00.0000Z
85+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.0000Z
86+
hapitime2datetime(): Manual processing time = 0.0008s, Input = 1989-001T00:00:00.0000Z, fmt = %Y-%jT%H:%M:%S.%fZ
87+
hapitime2datetime(): Pandas processing time = 0.0007s, first time = 1989-01-01T00:00:00.00000Z
88+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.00000Z
89+
hapitime2datetime(): Manual processing time = 0.0005s, Input = 1989-001T00:00:00.00000Z, fmt = %Y-%jT%H:%M:%S.%fZ
90+
hapitime2datetime(): Pandas processing failed, first time = 1989-01-01T00:00:00.000000Z
91+
hapitime2datetime(): Manual processing time = 0.0019s, Input = 1989-01-01T00:00:00.000000Z, fmt = %Y-%m-%dT%H:%M:%S.%fZ
92+
hapitime2datetime(): Pandas processing failed, first time = 1989-001T00:00:00.000000Z
93+
hapitime2datetime(): Manual processing time = 0.0008s, Input = 1989-001T00:00:00.000000Z, fmt = %Y-%jT%H:%M:%S.%fZ
94+
test_error_conditions(): Checking that hapitime2datetime(1999) throws HAPIError

hapiclient/test/test_hapitime2datetime.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
# from hapiclient.test.test_hapitime2datetime import test_parse_string_input
99
# test_parse_string_input()
1010

11+
import os
12+
import numpy as np
13+
1114
from hapiclient import hapitime2datetime
1215
from hapiclient.util import log
1316

14-
import numpy as np
15-
1617
# Create empty file
1718
with open("test_hapitime2datetime.log", "w") as f: pass
18-
logging = open("test_hapitime2datetime.log", "a")
19+
logging = open(os.path.realpath(__file__)[0:-2] + "log", "a")
1920

2021
expected = '1970-01-01T00:00:00.000000Z'
2122

0 commit comments

Comments
 (0)