labrad / pylabrad

python interface for labrad
51 stars 31 forks source link

Allow pluggable representations of unflattened labrad data. #66

Open maffoo opened 9 years ago

maffoo commented 9 years ago

Somewhat related to #65, it would be nice to be able to specify the type of python object into which you'd like to unflatten a piece of labrad data. While the defaults are good in most cases, there are time when one would like a custom representation that may be more efficient than the default (numpy record arrays come to mind, instead of lists of clusters). This would also allow us to avoid the tight coupling to a single representation of values with units, so that you could plug in pint or some other library if desired.

ejeffrey commented 9 years ago

One more thing, there are a handful of places, primarily to do with the fpga server where we send a flattened representation of a labrad request to one server, and that server then invokes it at a specified time. For instance, the qubit sequencer builds a packet that will change the anritsu frequency and sends it to the ghz fpga server to be invoked before the FPGAs run. This should be supported in a better fashion by whatever solution we pick here.

Evan

On Wed, Feb 11, 2015 at 7:15 PM, Matthew Neeley notifications@github.com wrote:

Somewhat related to #65 https://github.com/martinisgroup/pylabrad/issues/65, it would be nice to be able to specify the type of python object into which you'd like to unflatten a piece of labrad data. While the defaults are good in most cases, there are time when one would like a custom representation that may be more efficient than the default (numpy record arrays come to mind, instead of lists of clusters). This would also allow us to avoid the tight coupling to a single representation of values with units, so that you could plug in pint or some other library if desired.

— Reply to this email directly or view it on GitHub https://github.com/martinisgroup/pylabrad/issues/66.

DanielSank commented 9 years ago

One could override entries in the _parsers registry in types.py on a per-request or even per-record basis.