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
1944b80b
Commit
1944b80b
authored
6 years ago
by
MoritzThomasHuebner
Browse files
Options
Downloads
Patches
Plain Diff
Defined repr test for the cubic spline
parent
3b92a0e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!170
Resolve "Add more __repr__ methods"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/calibration_tests.py
+16
-2
16 additions, 2 deletions
test/calibration_tests.py
with
16 additions
and
2 deletions
test/calibration_tests.py
+
16
−
2
View file @
1944b80b
...
...
@@ -20,14 +20,22 @@ class TestBaseClass(unittest.TestCase):
class
TestCubicSpline
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
prefix
=
'
recalib_
'
self
.
minimum_frequency
=
20
self
.
maximum_frequency
=
1024
self
.
n_points
=
5
self
.
model
=
calibration
.
CubicSpline
(
prefix
=
'
recalib_
'
,
minimum_frequency
=
20
,
max
imum_frequency
=
1024
,
n_points
=
5
)
prefix
=
self
.
prefix
,
minimum_frequency
=
self
.
min
imum_frequency
,
maximum_frequency
=
self
.
maximum_frequency
,
n_points
=
self
.
n_points
)
self
.
parameters
=
{
'
recalib_{}_{}
'
.
format
(
param
,
ii
):
0.0
for
ii
in
range
(
5
)
for
param
in
[
'
amplitude
'
,
'
phase
'
]}
def
tearDown
(
self
):
del
self
.
prefix
del
self
.
minimum_frequency
del
self
.
maximum_frequency
del
self
.
n_points
del
self
.
model
del
self
.
parameters
...
...
@@ -37,6 +45,12 @@ class TestCubicSpline(unittest.TestCase):
**
self
.
parameters
)
assert
np
.
alltrue
(
cal_factor
.
real
==
np
.
ones_like
(
frequency_array
))
def
test_repr
(
self
):
expected
=
'
CubicSpline(prefix={}, minimum_frequency={}, maximum_frequency={}, n_points={})
'
\
.
format
(
self
.
prefix
,
self
.
minimum_frequency
,
self
.
maximum_frequency
,
self
.
n_points
)
actual
=
repr
(
self
.
model
)
self
.
assertEqual
(
expected
,
actual
)
class
TestCubicSplineRequiresFourNodes
(
unittest
.
TestCase
):
...
...
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