Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LISA Instrument
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LISA Simulation
LISA Instrument
Commits
012ed69d
Commit
012ed69d
authored
1 month ago
by
Wolfgang Kastaun
Browse files
Options
Downloads
Patches
Plain Diff
Add unit test for shift_inversion_dask module
parent
26b8f754
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_shift_inversion_dask.py
+35
-0
35 additions, 0 deletions
tests/test_shift_inversion_dask.py
with
35 additions
and
0 deletions
tests/test_shift_inversion_dask.py
0 → 100644
+
35
−
0
View file @
012ed69d
"""
Unit tests for module shift_inversion_dask
"""
import
numpy
as
np
import
pytest
from
lisainstrument.shift_inversion_numpy
import
make_shift_inverse_lagrange_numpy
from
lisainstrument.shift_inversion_dask
import
make_shift_inverse_lagrange_dask
from
lisainstrument.dynamic_delay_dask
import
numpyfy_dask_multi
def
test_shift_inversion_numpy
():
"""
Test basic functioning of shift_inversion_dask on analytic coordinate transform
"""
order
=
31
nsamp
=
600
chunks
=
70
k_mod
=
8
*
np
.
pi
a_mod
=
1e-3
max_it
=
6
tol
=
1e-12
def
dx_from_x
(
x
):
return
np
.
sin
(
x
*
k_mod
)
*
a_mod
xi
,
dt
=
np
.
linspace
(
0
,
1
,
nsamp
,
retstep
=
True
)
fsample
=
1
/
dt
dxi
=
dx_from_x
(
xi
)
op_np
=
make_shift_inverse_lagrange_numpy
(
order
,
a_mod
*
1.01
,
max_it
,
tol
/
dt
)
op_da
=
make_shift_inverse_lagrange_dask
(
order
,
a_mod
*
1.01
,
max_it
,
tol
/
dt
)
op_na
=
numpyfy_dask_multi
(
op_da
,
chunks
)
ai_np
=
op_np
(
dxi
,
fsample
)
ai_na
=
op_na
(
dxi
,
fsample
)
assert
ai_np
==
pytest
.
approx
(
ai_na
,
abs
=
tol
,
rel
=
0
)
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