Skip to content

can't interface with python generated messages #15

@timotheecour

Description

@timotheecour

server in python:

def ndarray_to_msg(a):
  assert isinstance(a, np.ndarray)
  return {'nd': True,
                'type': a.dtype.str,
                'shape': a.shape,
                'data': a.tostring()}
import numpy
vals = numpy.zeros((2, 3))
vals=ndarray_to_msg(vals)


def foo():
  # return vals in a python server

client in d:

struct NDArrayMsgpck{
  bool nd;
  string type;
  int[] shape;
  ubyte[] data;
}

auto temp=client.call!NDArrayMsgpck("foo");
// will fail (it returns a Value(map, Via))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions