You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When flattening python data into labrad format, pylabrad tries to infer the correct python type as it goes. This can become complicated when flattening lists of more complicated structures, because lists must be homogeneous so that each element has the same type, but the final type may need to be refined as we visit more elements in the list. We ran into the following edge case, where we want to flatten a list of clusters of two lists of strings:
The first example with clusters containing one list works fine; the flattening code infers that the list contains strings after it sees the second element. But the next example with clusters containing two lists does not work as expected. If we provide an explicit type as in the last example, everything flattens just fine, but it should work even if we don't provide an explicit type to flatten to.
The text was updated successfully, but these errors were encountered:
maffoo
changed the title
Cannot lists of tuples containing lists
Cannot flatten lists of tuples containing lists
Jul 24, 2017
When flattening python data into labrad format, pylabrad tries to infer the correct python type as it goes. This can become complicated when flattening lists of more complicated structures, because lists must be homogeneous so that each element has the same type, but the final type may need to be refined as we visit more elements in the list. We ran into the following edge case, where we want to flatten a list of clusters of two lists of strings:
The first example with clusters containing one list works fine; the flattening code infers that the list contains strings after it sees the second element. But the next example with clusters containing two lists does not work as expected. If we provide an explicit type as in the last example, everything flattens just fine, but it should work even if we don't provide an explicit type to flatten to.
The text was updated successfully, but these errors were encountered: