Skip to content

datavault: Fix labrad_urlencode to work with new FlatData type#343

Merged
maffoo merged 1 commit into
masterfrom
u/maffoo/datavault-param-fix
May 16, 2016
Merged

datavault: Fix labrad_urlencode to work with new FlatData type#343
maffoo merged 1 commit into
masterfrom
u/maffoo/datavault-param-fix

Conversation

@maffoo

@maffoo maffoo commented Apr 19, 2016

Copy link
Copy Markdown
Contributor

The FlatData type is a namedtuple that replaces the plain tuple returned by older versions of pylabrad when flattening data. We modify the labrad_urlencode method to use names of the FlatData items if possible, rather than explicitly unpacking the tuple. This lets us maintain compatibility with changes in 0.95.2 which added a third endianness member to the FlatData tuple.

@maffoo maffoo mentioned this pull request Apr 19, 2016
@jwenner

jwenner commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

FYI, there are still failed datavault tests, although I don't know enough to determine if these relate to #335.

@ejeffrey

ejeffrey commented May 2, 2016

Copy link
Copy Markdown
Contributor

test_datavault.py:test_parameters() should have its calls to T.flatten changed to:

flat_a = T.flatten(a)
flat_b = T.flatten(b)
assert flat_a == flat_b

which will work independent of the number of elements in the FlatData tuple

@ejeffrey

ejeffrey commented May 2, 2016

Copy link
Copy Markdown
Contributor

Alternately, assert the individual elements of flat_a and flat_b are equal by name, rather than using tuple unpacking.

@maffoo

maffoo commented May 16, 2016

Copy link
Copy Markdown
Contributor Author

@ejeffrey, I've fixed the tests. Could you take another look?

@ejeffrey

Copy link
Copy Markdown
Contributor

LGTM

The FlatData type is a namedtuple that replaces the plain tuple
returned by older versions of pylabrad when flattening data. We
modify the labrad_urlencode method to use names of the FlatData
items if possible, rather than explicitly unpacking the tuple.
This lets us maintain compatibility with changes in 0.95.2 which
added a third endianness member to the FlatData tuple.

Review: @ejeffrey
@maffoo maffoo force-pushed the u/maffoo/datavault-param-fix branch from f19221c to cc26d57 Compare May 16, 2016 19:01
@maffoo maffoo merged commit cc26d57 into master May 16, 2016
@maffoo maffoo deleted the u/maffoo/datavault-param-fix branch May 16, 2016 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants