Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
aa137a44
Commit
aa137a44
authored
Aug 22, 2013
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
any 0 points now show the abs err as rel err is undefined
parent
f41a1f8d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pykat/testing/test.py
+5
-4
5 additions, 4 deletions
pykat/testing/test.py
pykat/testing/web/web_interface.py
+5
-6
5 additions, 6 deletions
pykat/testing/web/web_interface.py
with
10 additions
and
10 deletions
pykat/testing/test.py
+
5
−
4
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
nzix
=
(
ref_arr
!=
0
)
rel_diff
=
np
.
abs
(
out_arr
-
ref_arr
)
/
np
.
abs
(
ref_arr_c
)
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
)
...
...
This diff is collapsed.
Click to expand it.
pykat/testing/web/web_interface.py
+
5
−
6
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
"
response
=
make_response
(
contents
)
response
.
headers
[
"
Content-type
"
]
=
"
text/plain
"
response
.
headers
[
"
Content-encoding
"
]
=
"
gzip
"
return
response
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment