Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Istvan N. Huszar, MD
tirl
Commits
f2ed0660
Commit
f2ed0660
authored
Aug 16, 2020
by
inhuszar
Browse files
Parameters can be changed on copying.
parent
28b9c95e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/tirl/interpolators/interpolator.py
View file @
f2ed0660
...
...
@@ -68,7 +68,8 @@ class Interpolator(TIRLObject):
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INITIALISATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
def
__init__
(
self
,
source
,
tensor_axes
=
(),
radius
=
1
,
hold
=
False
,
threads
=-
1
,
verbose
=
False
,
ipkwargs
=
None
,
**
kwargs
):
threads
=-
1
,
verbose
=
False
,
ipkwargs
=
None
,
fill_value
=
None
,
**
kwargs
):
"""
Initialisation of Interpolator.
...
...
@@ -116,6 +117,10 @@ class Interpolator(TIRLObject):
# Initialise metaparameters
self
.
kwargs
=
kwargs
if
fill_value
is
None
:
self
.
kwargs
.
update
(
fill_value
=
ts
.
FILL_VALUE
)
else
:
self
.
kwargs
.
update
(
fill_value
=
fill_value
)
# Set interpolation source values
...
...
@@ -487,7 +492,7 @@ class Interpolator(TIRLObject):
else
:
return
True
def
copy
(
self
):
def
copy
(
self
,
**
newparams
):
"""
Copy constructor. Subclasses that define their constructor signature
differently MAY find it necessary to overload this constructor as well.
...
...
@@ -498,10 +503,11 @@ class Interpolator(TIRLObject):
"""
kwargs
=
{
k
:
v
for
k
,
v
in
self
.
kwargs
.
items
()
if
k
not
in
self
.
RESERVED_KWARGS
}
obj
=
type
(
self
)(
source
=
self
.
values
,
tensor_axes
=
self
.
tensor_axes
,
kw
=
dict
(
source
=
self
.
values
,
tensor_axes
=
self
.
tensor_axes
,
radius
=
self
.
radius
,
hold
=
self
.
hold
,
threads
=
self
.
threads
,
verbose
=
self
.
verbose
,
ipkwargs
=
self
.
ipkwargs
,
**
kwargs
)
kw
.
update
(
newparams
)
obj
=
type
(
self
)(
**
kw
)
return
obj
@
classmethod
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment