Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Marc Arene
bilby
Commits
8834bae2
Commit
8834bae2
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
make source tests python2 compatible
parent
ce56c551
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gw_source_test.py
+18
-15
18 additions, 15 deletions
test/gw_source_test.py
with
18 additions
and
15 deletions
test/gw_source_test.py
+
18
−
15
View file @
8834bae2
...
...
@@ -21,17 +21,17 @@ class TestLalBBH(unittest.TestCase):
del
self
.
frequency_array
def
test_lal_bbh_works_runs_valid_parameters
(
self
):
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsInstance
(
bilby
.
gw
.
source
.
lal_binary_black_hole
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_mass_ratio_greater_one_returns_none
(
self
):
self
.
parameters
[
'
mass_2
'
]
=
1000.0
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsNone
(
bilby
.
gw
.
source
.
lal_binary_black_hole
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_lal_bbh_works_without_waveform_parameters
(
self
):
self
.
assertIsInstance
(
...
...
@@ -56,17 +56,17 @@ class TestLalBNS(unittest.TestCase):
del
self
.
frequency_array
def
test_lal_bns_works_runs_valid_parameters
(
self
):
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsInstance
(
bilby
.
gw
.
source
.
lal_binary_neutron_star
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_mass_ratio_greater_one_returns_none
(
self
):
self
.
parameters
[
'
mass_2
'
]
=
1000.0
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsNone
(
bilby
.
gw
.
source
.
lal_binary_neutron_star
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_lal_bns_works_without_waveform_parameters
(
self
):
self
.
assertIsInstance
(
...
...
@@ -76,16 +76,18 @@ class TestLalBNS(unittest.TestCase):
def
test_fails_without_tidal_parameters
(
self
):
self
.
parameters
.
pop
(
'
lambda_1
'
)
self
.
parameters
.
pop
(
'
lambda_2
'
)
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
with
self
.
assertRaises
(
TypeError
):
bilby
.
gw
.
source
.
lal_binary_neutron_star
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
)
self
.
frequency_array
,
**
self
.
parameters
)
def
test_fails_without_aligned_spins
(
self
):
self
.
parameters
.
pop
(
'
chi_1
'
)
self
.
parameters
.
pop
(
'
chi_2
'
)
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
with
self
.
assertRaises
(
TypeError
):
bilby
.
gw
.
source
.
lal_binary_neutron_star
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
)
self
.
frequency_array
,
**
self
.
parameters
)
class
TestEccentricLalBBH
(
unittest
.
TestCase
):
...
...
@@ -105,17 +107,17 @@ class TestEccentricLalBBH(unittest.TestCase):
del
self
.
frequency_array
def
test_lal_ebbh_works_runs_valid_parameters
(
self
):
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsInstance
(
bilby
.
gw
.
source
.
lal_eccentric_binary_black_hole_no_spins
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_mass_ratio_greater_one_returns_none
(
self
):
self
.
parameters
[
'
mass_2
'
]
=
1000.0
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
self
.
assertIsNone
(
bilby
.
gw
.
source
.
lal_eccentric_binary_black_hole_no_spins
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
),
dict
)
self
.
frequency_array
,
**
self
.
parameters
),
dict
)
def
test_lal_ebbh_works_without_waveform_parameters
(
self
):
self
.
assertIsInstance
(
...
...
@@ -124,9 +126,10 @@ class TestEccentricLalBBH(unittest.TestCase):
def
test_fails_without_eccentricity
(
self
):
self
.
parameters
.
pop
(
'
eccentricity
'
)
self
.
parameters
.
update
(
self
.
waveform_kwargs
)
with
self
.
assertRaises
(
TypeError
):
bilby
.
gw
.
source
.
lal_eccentric_binary_black_hole_no_spins
(
self
.
frequency_array
,
**
self
.
parameters
,
**
self
.
waveform_kwargs
)
self
.
frequency_array
,
**
self
.
parameters
)
if
__name__
==
'
__main__
'
:
...
...
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