Skip to content

Commit e2d08de

Browse files
committed
Fix array handling from server to support multi stim returns (#649)
Summary: Pull Request resolved: #649 Multistimuli experiments weren’t able to return to the client because the _tensor_to_config method didn’t handle nested object numpy arrays correctly. This fixes it. Reviewed By: tymmsc Differential Revision: D69474480 fbshipit-source-id: 1524206ea259dfe66cd5fa885edf4e29c2543a5f
1 parent a81b6e6 commit e2d08de

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

aepsych/server/server.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,7 @@ def _tensor_to_config(self, next_x):
249249
config = {}
250250
for i, name in enumerate(self.parnames):
251251
val = next_x[:, i]
252-
if isinstance(val, str):
253-
config[name] = [val]
254-
elif isinstance(val, (int, float)):
255-
config[name] = [float(val)]
256-
elif isinstance(val[0], str):
257-
config[name] = val
258-
else:
259-
config[name] = list(np.array(val, dtype="float64"))
252+
config[name] = val.tolist()
260253
return config
261254

262255
def _config_to_tensor(self, config):

0 commit comments

Comments
 (0)