Skip to content

Commit 647d7cd

Browse files
better empty array check
1 parent e52f92b commit 647d7cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xopt/generators/ga/nsga2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def vocs_data_to_arr(data: list | np.ndarray) -> np.ndarray:
2929
"""Force data coming from VOCS object into 2D numpy array (or None) for compatibility with helper functions"""
3030
if isinstance(data, list):
3131
data = np.ndarray(list)
32-
if len(data.shape) == 0:
32+
if data.size == 0:
3333
return None
3434
if len(data.shape) == 1:
3535
return data[:, None]

0 commit comments

Comments
 (0)