Repository navigation
Allow arrays of strings to be used with Waveforms - #102
Conversation
Codecov Report
@@ Coverage Diff @@
## master #102 +/- ##
==========================================
+ Coverage 87.15% 87.34% +0.19%
==========================================
Files 14 14
Lines 981 996 +15
==========================================
+ Hits 855 870 +15
Misses 126 126
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
220677d to
aa8a8b3
Compare
|
The current state of the branch is that you can create a WaveformIn/Out with an initial_value of an array of (byte) strings, but you cannot set that value at a later time. This is because if there is no If you specify an I'm unsure if we can support arrays of strings quite as freely as we could in version 3.2.1 - I don't see a neat way around the implicit |
aa8a8b3 to
87e748b
Compare
87e748b to
3e3d20e
Compare
Note the tests fail, largely due to now numpy defaults to a floating point dtype, which we cannot coerce into an array of strings. Also TODOs need completion...
Note that these tests don't currently pass!
Also make all the tests pass. Involved skipping
3e3d20e to
ef3204b
Compare
Also add more tests
ef3204b to
01308e0
Compare
Araneidae
left a comment
There was a problem hiding this comment.
Think there are a few minor things to tidy up, but looks good.
| .. note:: | ||
| When storing arrays of strings, it is possible to store Unicode characters. | ||
| However, as EPICS has no Unicode support the resultant values will be stored | ||
| as byte strings. Care must be taken when encoding/decoding the values. | ||
|
|
There was a problem hiding this comment.
Don't really think this note captures the essence of this new feature. In particular, the internal encoding is almost completely hidden from users, and it's a bit of a misconception to say that "EPICS has no Unicode support".
We should reference the fact that waveforms of strings are treated as Python Unicode strings throughout and are managed as Python arrays unlike all other waveforms.
There was a problem hiding this comment.
Rewritten in 5b59ed7 - how does that sound?
- Rewrites the note on waveform of strings - Refactors _require_waveform - Removes unused DTYPE and add more tests for mixed lists
Allow creation records like:
Where each element of the array is treated as an EPICS string
Values returned will always be Python string lists:
(valid) Unicode characters may also be passed in, and will be returned as-is. Note that it is not always obvious how many Unicode characters can be safely entered into EPICS's 40 character string limits.