Skip to content

Commit bb11825

Browse files
committed
py2mat: error on unknown type
1 parent 2d1a299 commit bb11825

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

py2mat.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,11 @@
197197
case 'py.xarray.core.dataarray.DataArray'
198198
x_mat = double(py.numpy.asfortranarray(x_py));
199199

200-
% punt
200+
case "py.xarray.core.dataset.Dataset"
201+
error("xarray.Dataset: please index the DataArray before py2mat")
202+
201203
otherwise
202-
% return the original item? nothing?
203-
fprintf('py2mat: type "%s" not recognized\n', ...
204-
string(class(x_py)));
205-
x_mat = [];
204+
error(class(x_py) + " not handled")
206205
end
207206
end
208207

0 commit comments

Comments
 (0)