Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Commits
7a067241
Commit
7a067241
authored
1 year ago
by
Michael Williams
Committed by
Colm Talbot
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
TST: add option to skip ROQs tests
parent
1a89e8e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1331
TST: add option to skip ROQs tests
Pipeline
#602325
passed with warnings
1 year ago
Stage: initial
Stage: test
Stage: docs
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/conftest.py
+19
-0
19 additions, 0 deletions
test/conftest.py
test/gw/likelihood_test.py
+6
-0
6 additions, 0 deletions
test/gw/likelihood_test.py
with
25 additions
and
0 deletions
test/conftest.py
0 → 100644
+
19
−
0
View file @
7a067241
import
pytest
def
pytest_addoption
(
parser
):
parser
.
addoption
(
"
--skip-roqs
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Skip all tests that require ROQs
"
)
def
pytest_configure
(
config
):
config
.
addinivalue_line
(
"
markers
"
,
"
requires_roqs: mark a test that requires ROQs
"
)
def
pytest_collection_modifyitems
(
config
,
items
):
if
config
.
getoption
(
"
--skip-roqs
"
):
skip_roqs
=
pytest
.
mark
.
skip
(
reason
=
"
Skipping tests that require ROQs
"
)
for
item
in
items
:
if
"
requires_roqs
"
in
item
.
keywords
:
item
.
add_marker
(
skip_roqs
)
This diff is collapsed.
Click to expand it.
test/gw/likelihood_test.py
+
6
−
0
View file @
7a067241
...
...
@@ -3,6 +3,7 @@ import unittest
import
tempfile
from
itertools
import
product
from
parameterized
import
parameterized
import
pytest
import
h5py
import
numpy
as
np
...
...
@@ -273,6 +274,7 @@ class TestGWTransient(unittest.TestCase):
)
@pytest.mark.requires_roqs
class
TestROQLikelihood
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
duration
=
4
...
...
@@ -538,6 +540,7 @@ class TestROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class
TestRescaledROQLikelihood
(
unittest
.
TestCase
):
def
test_rescaling
(
self
):
...
...
@@ -612,6 +615,7 @@ class TestRescaledROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class
TestROQLikelihoodHDF5
(
unittest
.
TestCase
):
"""
Test ROQ likelihood constructed from .hdf5 basis
...
...
@@ -846,6 +850,7 @@ class TestROQLikelihoodHDF5(unittest.TestCase):
self
.
assertLess
(
np
.
abs
(
llr
-
llr_roq
),
max_llr_error
)
@pytest.mark.requires_roqs
class
TestCreateROQLikelihood
(
unittest
.
TestCase
):
"""
Test if ROQ likelihood is constructed without any errors from .hdf5 or .npy basis
...
...
@@ -966,6 +971,7 @@ class TestCreateROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class
TestInOutROQWeights
(
unittest
.
TestCase
):
@parameterized.expand
([
'
npz
'
,
'
hdf5
'
])
...
...
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