Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pymor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
pyMOR
pymor
Commits
1210d44c
Commit
1210d44c
authored
Apr 28, 2020
by
René Fritze
Committed by
René Fritze
Jun 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] fix bounding box check for large inputs
parent
b27b9ec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/pymortests/affine_grid.py
src/pymortests/affine_grid.py
+6
-3
No files found.
src/pymortests/affine_grid.py
View file @
1210d44c
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import
operator
import
numpy
as
np
import
pytest
from
hypothesis
import
given
,
settings
,
reproduce_failure
from
pymor.discretizers.builtin.grids.interfaces
import
ReferenceElement
from
pymor.tools.floatcmp
import
float_cmp
,
compare_with_tolerance
from
pymortests.base
import
runmodule
from
pymortests.fixtures.grid
import
hy_grid
,
hy_grid_with_orthogonal_centers
...
...
@@ -333,8 +334,10 @@ def test_bounding_box(grid):
bbox
=
g
.
bounding_box
()
assert
bbox
.
shape
==
(
2
,
g
.
dim
)
assert
np
.
all
(
bbox
[
0
]
<=
bbox
[
1
])
assert
np
.
all
(
g
.
centers
(
g
.
dim
)
>=
bbox
[
0
])
assert
np
.
all
(
g
.
centers
(
g
.
dim
)
<=
bbox
[
1
])
# compare with tolerance is necessary with very large domain boundaries values
# where the relative error in the centers computation introduces enough error to fail the test otherwise
assert
np
.
all
(
compare_with_tolerance
(
bbox
[
0
],
g
.
centers
(
g
.
dim
),
operator
.
le
,
rtol
=
1e-15
,
atol
=
0
))
assert
np
.
all
(
compare_with_tolerance
(
g
.
centers
(
g
.
dim
),
bbox
[
1
],
operator
.
le
,
rtol
=
1e-15
,
atol
=
0
))
@
settings
(
deadline
=
None
)
...
...
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