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
a0ec6c58
Commit
a0ec6c58
authored
3 months ago
by
Wolfgang Kastaun
Browse files
Options
Downloads
Patches
Plain Diff
minor cleanup
parent
b021039f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lisainstrument/fixed_shift_dask.py
+2
-5
2 additions, 5 deletions
lisainstrument/fixed_shift_dask.py
lisainstrument/fixed_shift_numpy.py
+21
-17
21 additions, 17 deletions
lisainstrument/fixed_shift_numpy.py
tests/test_dynamic_delay_dsp.py
+1
-1
1 addition, 1 deletion
tests/test_dynamic_delay_dsp.py
with
24 additions
and
23 deletions
lisainstrument/fixed_shift_dask.py
+
2
−
5
View file @
a0ec6c58
...
@@ -14,10 +14,7 @@ from typing_extensions import assert_never
...
@@ -14,10 +14,7 @@ from typing_extensions import assert_never
from
lisainstrument.dynamic_delay_numpy
import
DynShiftBC
from
lisainstrument.dynamic_delay_numpy
import
DynShiftBC
from
lisainstrument.fir_filters_dask
import
DaskArray1D
,
make_dask_array_1d
from
lisainstrument.fir_filters_dask
import
DaskArray1D
,
make_dask_array_1d
from
lisainstrument.fixed_shift_numpy
import
(
from
lisainstrument.fixed_shift_numpy
import
FixedShiftFactory
,
FixedShiftLagrange
FixedShiftFactory
,
make_fixed_shift_factory_lagrange
,
)
class
FixedShiftDask
:
# pylint: disable=too-few-public-methods
class
FixedShiftDask
:
# pylint: disable=too-few-public-methods
...
@@ -157,5 +154,5 @@ def make_fixed_shift_lagrange_dask(
...
@@ -157,5 +154,5 @@ def make_fixed_shift_lagrange_dask(
Returns:
Returns:
Fixed shift interpolator
Fixed shift interpolator
"""
"""
fac
=
make_f
ixed
_s
hift
_factory_lagrange
(
length
)
fac
=
F
ixed
S
hift
Lagrange
.
factory
(
length
)
return
FixedShiftDask
(
left_bound
,
right_bound
,
fac
)
return
FixedShiftDask
(
left_bound
,
right_bound
,
fac
)
This diff is collapsed.
Click to expand it.
lisainstrument/fixed_shift_numpy.py
+
21
−
17
View file @
a0ec6c58
...
@@ -80,6 +80,9 @@ class FixedShiftCore(Protocol):
...
@@ -80,6 +80,9 @@ class FixedShiftCore(Protocol):
"""
"""
FixedShiftFactory
:
TypeAlias
=
Callable
[[
float
],
FixedShiftCore
]
def
make_fir_lagrange_fixed
(
length
:
int
,
frac_shift
:
float
)
->
DefFilterFIR
:
def
make_fir_lagrange_fixed
(
length
:
int
,
frac_shift
:
float
)
->
DefFilterFIR
:
r
"""
Create FIR filter corresponding to non-integer shift using Lagrange interpolation
r
"""
Create FIR filter corresponding to non-integer shift using Lagrange interpolation
...
@@ -214,28 +217,29 @@ class FixedShiftLagrange(FixedShiftCore):
...
@@ -214,28 +217,29 @@ class FixedShiftLagrange(FixedShiftCore):
a
=
make_numpy_array_1d_float
(
samples
)
a
=
make_numpy_array_1d_float
(
samples
)
return
make_numpy_array_1d
(
self
.
_filt
(
a
))
return
make_numpy_array_1d
(
self
.
_filt
(
a
))
@staticmethod
def
factory
(
length
:
int
)
->
FixedShiftFactory
:
"""
Factory for making FixedShiftLagrange instances
FixedShiftFactory
:
TypeAlias
=
Callable
[[
float
],
FixedShiftCore
]
Arguments:
length: number of Lagrange polynomials to use
def
make_fixed_shift_factory_lagrange
(
length
:
int
)
->
FixedShiftFactory
:
Returns:
"""
Factory for making FixedShiftLagrange instances
Factory function for making FixedShiftLagrange instances from shift
"""
Arguments
:
def
factory
(
shift
:
float
)
->
FixedShiftCore
:
length: number of Lagrange polynomials to use
"""
FixedShiftLagrange instances from shift using preselected order
Returns:
Arguments:
Factory function for making FixedShiftLagrange instances from shift
shift: The fixed shift
"""
def
factory
(
shift
:
float
)
->
FixedShiftCore
:
Returns:
"""
FixedShiftLagrange instances from shift using preselected order
FixedShiftLagrange instance
Arguments:
"""
shift: The fixed shift
return
FixedShiftLagrange
(
length
,
shift
)
"""
return
FixedShiftLagrange
(
length
,
shift
)
return
factory
return
factory
class
FixedShiftNumpy
:
# pylint: disable=too-few-public-methods
class
FixedShiftNumpy
:
# pylint: disable=too-few-public-methods
...
@@ -365,5 +369,5 @@ def make_fixed_shift_lagrange_numpy(
...
@@ -365,5 +369,5 @@ def make_fixed_shift_lagrange_numpy(
Returns:
Returns:
Fixed shift interpolator
Fixed shift interpolator
"""
"""
fac
=
make_f
ixed
_s
hift
_factory_lagrange
(
length
)
fac
=
F
ixed
S
hift
Lagrange
.
factory
(
length
)
return
FixedShiftNumpy
(
left_bound
,
right_bound
,
fac
)
return
FixedShiftNumpy
(
left_bound
,
right_bound
,
fac
)
This diff is collapsed.
Click to expand it.
tests/test_dynamic_delay_dsp.py
+
1
−
1
View file @
a0ec6c58
...
@@ -7,7 +7,7 @@ from lisainstrument.dynamic_delay_dask import (
...
@@ -7,7 +7,7 @@ from lisainstrument.dynamic_delay_dask import (
make_dynamic_shift_lagrange_dask
,
make_dynamic_shift_lagrange_dask
,
numpyfy_dask_multi
,
numpyfy_dask_multi
,
)
)
from
lisainstrument.dynamic_delay_dsp
_dask
import
(
from
lisainstrument.dynamic_delay_dsp
import
(
make_dynamic_shift_dsp_dask
,
make_dynamic_shift_dsp_dask
,
make_dynamic_shift_dsp_numpy
,
make_dynamic_shift_dsp_numpy
,
)
)
...
...
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