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
9468f577
Commit
9468f577
authored
Nov 06, 2020
by
René Fritze
Committed by
René Fritze
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gui] refactor gl buffer dtype to prevent futurewarning
parent
68f2d38f
Pipeline
#68734
passed with stages
in 37 minutes and 16 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
src/pymor/discretizers/builtin/gui/gl.py
src/pymor/discretizers/builtin/gui/gl.py
+5
-8
No files found.
src/pymor/discretizers/builtin/gui/gl.py
View file @
9468f577
...
...
@@ -129,23 +129,20 @@ if config.HAVE_QT and config.HAVE_QTOPENGL and config.HAVE_GL:
self
.
shift
=
-
np
.
array
(
bb
[
0
])
-
self
.
size
/
2
# setup buffers
buffer_dtype
=
[(
'position'
,
'f4'
,
2
),
(
'color'
,
'f4'
,
(
1
,))]
if
self
.
reference_element
==
triangle
:
if
codim
==
2
:
self
.
vertex_data
=
np
.
empty
(
len
(
coordinates
),
dtype
=
[(
'position'
,
'f4'
,
2
),
(
'color'
,
'f4'
,
1
)])
self
.
vertex_data
=
np
.
empty
(
len
(
coordinates
),
dtype
=
buffer_dtype
)
self
.
indices
=
subentities
else
:
self
.
vertex_data
=
np
.
empty
(
len
(
subentities
)
*
3
,
dtype
=
[(
'position'
,
'f4'
,
2
),
(
'color'
,
'f4'
,
1
)])
self
.
vertex_data
=
np
.
empty
(
len
(
subentities
)
*
3
,
dtype
=
buffer_dtype
)
self
.
indices
=
np
.
arange
(
len
(
subentities
)
*
3
,
dtype
=
np
.
uint32
)
else
:
if
codim
==
2
:
self
.
vertex_data
=
np
.
empty
(
len
(
coordinates
),
dtype
=
[(
'position'
,
'f4'
,
2
),
(
'color'
,
'f4'
,
1
)])
self
.
vertex_data
=
np
.
empty
(
len
(
coordinates
),
dtype
=
buffer_dtype
)
self
.
indices
=
np
.
vstack
((
subentities
[:,
0
:
3
],
subentities
[:,
[
0
,
2
,
3
]]))
else
:
self
.
vertex_data
=
np
.
empty
(
len
(
subentities
)
*
6
,
dtype
=
[(
'position'
,
'f4'
,
2
),
(
'color'
,
'f4'
,
1
)])
self
.
vertex_data
=
np
.
empty
(
len
(
subentities
)
*
6
,
dtype
=
buffer_dtype
)
self
.
indices
=
np
.
arange
(
len
(
subentities
)
*
6
,
dtype
=
np
.
uint32
)
self
.
indices
=
np
.
ascontiguousarray
(
self
.
indices
)
...
...
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