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
Goran Jelic-Cizmek
coffe
Commits
c42fe515
Commit
c42fe515
authored
Dec 05, 2021
by
Goran Jelic-Cizmek
Browse files
Added safety checks for bias ranges
parent
85a310b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
coffe.pyx
View file @
c42fe515
...
...
@@ -55,7 +55,7 @@ def _check_parameter(
cdef
double
evaluate_spline
(
ccoffe
.
coffe_interpolation
*
interp
,
const
double
x
,
):
)
except
*
:
"""
Evaluates the spline at some value x
"""
...
...
@@ -68,12 +68,14 @@ cdef double evaluate_spline(
cdef
void
set_spline
(
cdef
int
set_spline
(
ccoffe
.
coffe_interpolation
*
interp
,
x_sampling
:
List
[
float
],
y_sampling
:
List
[
float
],
const
ccoffe
.
coffe_interp1d_type
interp1d_type
,
):
xmin
:
float
=
0
,
xmax
:
float
=
15
,
)
except
*
:
"""
Sets the value of the spline according to some x_sampling and y_sampling
"""
...
...
@@ -84,6 +86,9 @@ cdef void set_spline(
f
'Mismatching lengths for x (
{
len
(
x_sampling
)
}
) and y (
{
len
(
y_sampling
)
}
)'
)
_check_parameter
(
'xmin'
,
x_sampling
[
0
],
(
int
,
float
),
xmin
=
xmin
)
_check_parameter
(
'xmax'
,
x_sampling
[
-
1
],
(
int
,
float
),
xmax
=
xmax
)
cdef
double
*
x
=
NULL
cdef
double
*
y
=
NULL
...
...
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