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
ift
NIFTy
Commits
63e06add
Commit
63e06add
authored
Jun 27, 2020
by
Philipp Arras
Browse files
Use same tolerances as numpy as default values
parent
19ece6ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/extra.py
View file @
63e06add
...
...
@@ -20,7 +20,6 @@ from itertools import combinations
import
numpy
as
np
from
numpy.testing
import
assert_
from
.
import
random
from
.domain_tuple
import
DomainTuple
from
.field
import
Field
from
.linearization
import
Linearization
...
...
@@ -124,7 +123,7 @@ def check_operator(op, loc, tol=1e-12, ntries=100, perf_check=True,
metric_sampling
)
def
assert_allclose
(
f1
,
f2
,
atol
,
rtol
):
def
assert_allclose
(
f1
,
f2
,
atol
=
0
,
rtol
=
1e-7
):
if
isinstance
(
f1
,
Field
):
return
np
.
testing
.
assert_allclose
(
f1
.
val
,
f2
.
val
,
atol
=
atol
,
rtol
=
rtol
)
for
key
,
val
in
f1
.
items
():
...
...
Write
Preview
Markdown
is supported
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