Skip to content

Commit cb0d3ac

Browse files
author
Felix Igelbrink
committed
fixed an error regarding scalar parameters being stored as numpy arrays in the LaunchParamsRecord
1 parent 166bb56 commit cb0d3ac

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

examples/dynamic_geometry.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def __init__(self):
5151

5252
def __getattribute__(self, name):
5353
if name in Params._params.keys():
54-
return self.__dict__['handle'][name]
54+
item = self.__dict__['handle'][name]
55+
if isinstance(item, np.ndarray) and item.shape in ((0,), (1,)):
56+
return item.item()
5557
else:
5658
return super().__getattribute__(name)
5759

@@ -482,7 +484,7 @@ def create_sbt(state):
482484

483485
glfw.swap_buffers(window)
484486

485-
state.params.subframe_index = state.params.subframe_index.item() + 1
487+
state.params.subframe_index = state.params.subframe_index+ 1
486488

487489
impl.shutdown()
488490
glfw.terminate()

examples/dynamic_materials.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def __init__(self):
3838

3939
def __getattribute__(self, name):
4040
if name in Params._params.keys():
41-
return self.__dict__['handle'][name]
41+
item = self.__dict__['handle'][name]
42+
if isinstance(item, np.ndarray) and item.shape in ((0,), (1,)):
43+
return item.item()
4244
else:
4345
return super().__getattribute__(name)
4446

0 commit comments

Comments
 (0)