File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 4545 key_index = int64(0 );
4646 for key = cell(py .list(x_py .keys()))
4747 key_index = key_index + 1 ;
48- v_name = string(key );
48+ if class(key ) == ' cell'
49+ % key could be a Python number
50+ v_name = string(py .str(key{1 }));
51+ else
52+ v_name = string(key );
53+ end
4954 if isvarname(v_name )
5055 x_mat.(v_name ) = x_py .get(v_name );
5156 else
5257 % this key can't be used; replace it
5358 fixed = sprintf(' K%06d _' , key_index ) + ...
54- regexprep(string( key ) ,' \W' ,' _' );
59+ regexprep(v_name ,' \W' ,' _' );
5560 x_mat.(fixed ) = x_py .get(v_name );
5661 end
5762 end
170175 case ' logical'
171176 x_mat = logical(x_py );
172177
178+ case ' py.bytes'
179+ x_mat = uint8(x_py );
180+
181+ case ' py.NoneType'
182+ x_mat = ' ' ;
183+
173184 % punt
174185 otherwise
175186 % return the original item? nothing?
You can’t perform that action at this time.
0 commit comments