Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
aa137a44
Commit
aa137a44
authored
Aug 22, 2013
by
Daniel Brown
Browse files
any 0 points now show the abs err as rel err is undefined
parent
f41a1f8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
pykat/testing/test.py
View file @
aa137a44
...
...
@@ -331,10 +331,11 @@ class FinesseTestProcess(Thread):
# for computing relative errors we need to make sure we
# have no zeros in the data
ref_arr_c
=
np
.
where
(
ref_arr
==
0
,
1
,
ref_arr
)
ref_arr_c
[
ref_arr_c
==
0
]
=
1
rel_diff
=
np
.
abs
(
out_arr
-
ref_arr
)
/
np
.
abs
(
ref_arr_c
)
nzix
=
(
ref_arr
!=
0
)
rel_diff
=
np
.
abs
(
out_arr
-
ref_arr
)
# only compute rel diff for non zero values
rel_diff
[
nzix
]
=
np
.
divide
(
rel_diff
[
nzix
],
np
.
abs
(
ref_arr
[
nzix
]))
diff
=
np
.
any
(
rel_diff
>=
self
.
diff_rel_eps
)
...
...
pykat/testing/web/web_interface.py
View file @
aa137a44
...
...
@@ -17,7 +17,7 @@ from CodernityDB.database_thread_safe import ThreadSafeDatabase
from
CodernityDB.database
import
RecordNotFound
import
numpy
as
np
from
pykat.testing.web.database_indices
import
TestIDIndex
,
SrcCommitIndex
,
KatTestIndex
import
re
import
re
,
gzip
import
os
,
sys
,
traceback
global
current_test
,
scheduled_tests
,
schedule_lock
,
enabled_suites
...
...
@@ -637,13 +637,12 @@ def finesse_view_out(test_id,suite, out):
OUT_FILE
=
os
.
path
.
join
(
app
.
instance_path
,
"tests"
,
str
(
test_id
),
"outputs"
,
suite
,
out
+
".gz"
)
if
os
.
path
.
exists
(
OUT_FILE
):
contents
=
open
(
OUT_FILE
).
read
()
contents
=
gzip
.
open
(
OUT_FILE
,
'rb'
).
read
()
else
:
contents
=
"out file not found"
response
=
make_response
(
contents
)
response
.
headers
[
"Content-type"
]
=
"text/plain"
response
.
headers
[
"Content-encoding"
]
=
"gzip"
return
response
...
...
@@ -668,13 +667,13 @@ def finesse_view_log(test_id,suite, kat):
OUT_FILE
=
os
.
path
.
join
(
app
.
instance_path
,
"tests"
,
str
(
test_id
),
"outputs"
,
suite
,
log
+
".gz"
)
if
os
.
path
.
exists
(
OUT_FILE
):
contents
=
open
(
OUT_FILE
).
read
()
file
=
gzip
.
open
(
OUT_FILE
,
'rb'
)
contents
=
file
.
read
()
else
:
contents
=
"log file not found"
contents
=
"log file not found"
response
=
make_response
(
contents
)
response
.
headers
[
"Content-type"
]
=
"text/plain"
response
.
headers
[
"Content-encoding"
]
=
"gzip"
return
response
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment