Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60161113
conftest.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Apr 27, 23:29
Size
900 B
Mime Type
text/x-python
Expires
Mon, Apr 29, 23:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17310682
Attached To
rUVW UVW
conftest.py
View Options
import
pytest
import
numpy
as
np
from
vtk.util.numpy_support
import
vtk_to_numpy
as
v2n
@pytest.fixture
def
threeD_data
():
N
=
4
x
=
np
.
linspace
(
0
,
1
,
N
*
2
)
y
=
np
.
linspace
(
0
,
1
,
N
+
2
)
z
=
np
.
linspace
(
0
,
1
,
N
)
xx
,
yy
,
zz
=
np
.
meshgrid
(
x
,
y
,
z
,
indexing
=
'ij'
,
sparse
=
True
)
r
=
np
.
sqrt
(
xx
**
2
+
yy
**
2
+
zz
**
2
)
e_r
=
np
.
zeros
([
s
-
1
for
s
in
r
.
shape
]
+
[
3
,
3
])
e_r
[
0
,
0
,
0
,
:,
:]
=
np
.
array
([[
0
,
1
,
0
],
[
1
,
0
,
0
],
[
0
,
1
,
1
]])
e_r
[
-
1
,
0
,
0
,
:,
:]
=
np
.
eye
(
3
)
return
[
x
,
y
,
z
],
r
,
e_r
@pytest.fixture
(
params
=
[
False
,
True
])
def
compression_fixture
(
request
):
return
request
def
get_vtk_data
(
reader
,
sstream
):
reader
.
SetReadFromInputString
(
True
)
reader
.
SetInputString
(
sstream
.
getvalue
())
reader
.
Update
()
output
=
reader
.
GetOutput
()
return
v2n
(
output
.
GetPointData
()
.
GetArray
(
'point'
)),
\
v2n
(
output
.
GetCellData
()
.
GetArray
(
'cell'
))
Event Timeline
Log In to Comment