MCPcopy
hub / github.com/widgetti/ipyvolume / serialize_ndarray

Function serialize_ndarray

js/src/serialize.ts:230–240  ·  view source on GitHub ↗
(data, manager)

Source from the content-addressed store, hash-verified

228}
229
230function serialize_ndarray(data, manager) {
231 if (data === null) {
232 return null;
233 }
234 let ar = data;
235 if (isArray(data) && !(data as any).data) { // plain list of list
236 ar = require("ndarray-pack")(data);
237 }
238 const data_json = { data: ar.data.buffer, dtype: arrayToTypes[ar.data.constructor.name], shape: ar.shape };
239 return data_json;
240}
241
242function serialize_texture(data, manager) {
243 return data;

Callers

nothing calls this directly

Calls 1

isArrayFunction · 0.85

Tested by

no test coverage detected