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
Carsten Eie Frigaard
GITMAL
Commits
f258503f
Commit
f258503f
authored
Mar 09, 2022
by
Carsten Eie Frigaard
Browse files
fixed_broken_AssertInRange
parent
f3a6ad26
Changes
1
Hide whitespace changes
Inline
Side-by-side
libitmal/utils.py
View file @
f258503f
...
...
@@ -173,8 +173,8 @@ def AssertInRange(x, expected, eps=1E-9, autoconverttofloat=True, verbose=0):
absdiff
=
np
.
fabs
(
x
-
expected
)
if
verbose
>
0
:
print
(
f
"CheckInRange(x=
{
x
}
, expected=
{
expected
}
, eps=
{
eps
}
: x in [
{
x0
}
;
{
x1
}
] =>
{
ok
}
"
)
assert
ok
,
f
"x=
{
x
}
is not within the range [
{
x0
}
;
{
x1
}
] for eps=
{
eps
}
, got eps=
{
absdiff
}
"
assert
ok
,
f
"x=
{
x
}
is not within the range [
{
x0
}
;
{
x1
}
] for eps=
{
eps
}
, got eps=
{
absdiff
}
"
def
InRange
(
x
,
expected
,
eps
=
1E-9
,
verbose
=
0
):
try
:
AssertInRange
(
x
,
expected
,
eps
,
True
,
verbose
)
...
...
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