Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Keitel
PyFstat
Commits
d569dc90
Commit
d569dc90
authored
Aug 02, 2019
by
Gregory Ashton
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'make-tests-more-robust' into 'master'
Make tests more robust See merge request
!21
parents
e976b57c
367e4a02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
pyfstat/tcw_fstat_map_funcs.py
pyfstat/tcw_fstat_map_funcs.py
+2
-5
setup.py
setup.py
+0
-1
tests.py
tests.py
+4
-7
No files found.
pyfstat/tcw_fstat_map_funcs.py
View file @
d569dc90
...
...
@@ -31,11 +31,8 @@ def _optional_import(modulename, shorthand=None):
logging
.
debug
(
"Successfully imported module %s%s."
%
(
modulename
,
shorthandbit
))
success
=
True
except
ImportError
as
e
:
if
e
.
message
==
"No module named "
+
modulename
:
logging
.
debug
(
"No module {:s} found."
.
format
(
modulename
))
success
=
False
else
:
raise
logging
.
debug
(
"Failed to import module {:s}."
.
format
(
modulename
))
success
=
False
return
success
...
...
setup.py
View file @
d569dc90
...
...
@@ -31,6 +31,5 @@ setup(
"bashplotlib"
,
"peakutils"
,
"pathos"
,
"pycuda"
,
],
)
tests.py
View file @
d569dc90
...
...
@@ -5,7 +5,7 @@ import shutil
import
pyfstat
import
lalpulsar
import
logging
import
time
class
Test
(
unittest
.
TestCase
):
outdir
=
"TestData"
...
...
@@ -85,6 +85,7 @@ class Writer(Test):
Writer
.
run_makefakedata
()
time_second
=
os
.
path
.
getmtime
(
Writer
.
sftfilepath
)
self
.
assertTrue
(
time_first
==
time_second
)
time
.
sleep
(
1
)
# make sure timestamp is actually different!
os
.
system
(
"touch {}"
.
format
(
Writer
.
config_file_name
))
Writer
.
run_makefakedata
()
time_third
=
os
.
path
.
getmtime
(
Writer
.
sftfilepath
)
...
...
@@ -550,12 +551,8 @@ class GridSearch(Test):
tref
=
self
.
tref
,
Lambda0
=
[
30
,
0
,
0
,
0
],
)
search
.
run
()
self
.
assertTrue
(
os
.
path
.
isfile
(
"{}/{}_slice_projection.png"
.
format
(
search
.
outdir
,
search
.
label
)
)
)
fig
,
axes
=
search
.
run
(
save
=
False
)
self
.
assertTrue
(
fig
is
not
None
)
def
test_glitch_grid_search
(
self
):
search
=
pyfstat
.
GridGlitchSearch
(
...
...
Write
Preview
Markdown
is supported
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