Open Araneidae opened 2 years ago
I think this is fixed with https://pypi.org/project/wavedrom/2.0.3.post3/ can you confirm that?
Hello, I have installed 2.0.3.post3. The relaxed JSON works fine for digital signals. However I am unable to make the piecewise linear analog signal syntax work in this package. I am able to successfully render analog signals in the native wavedrom editor. Please see exact example below consisting of 2 analog signals and 3 digital signals. When I use the wave: ['pw', {d: 'm,0,0 h,0.5,0 l,1,5 h,12.5'}] syntax directly I get the error of "TypeError: unhashable type: 'dict'". If I place the contents within {d: 'm,0,0 h,0.5,0 l,1,5 h,12.5'} in a dict and name it say "dict1", and then use dict1 in the wave description I do not get this error but the waveform does not get rendered either. Any suggestions on how I might overcome this syntactical issue?
{signal: [ {name: '', wave: '1.............'}, {}, ['VIN', {name:'12V'}, {name:'10V'}, {name:'5V'}, {name: '0V', wave: ['pw', {d: 'm,0,0 h,0.5,0 l,1,5 h,12.5'}]} ], {}, {name:'5V'}, {name:'4.3V'}, {name:'VOUT 3.6V'}, {name:'1.8V'}, {name: '0V', wave: ['pw', {d: 'm,0,0 q,0.5,4,3,4 h,3 L,7,5 h,4 L,12,6 h,2'}]}, {name: 'dig1', wave: "x.......0..1.."}, {name: 'dig2', wave: "01......0....."}, {name: 'dig3', wave: "x.......3..4..",data:["00","11"]} ]}
I'm not sure if this is a duplicate issue (certainly issue #34 seems to cover the same ground, but doesn't actually state the issue).
If I run
wavedrompy -i test-file.json -s test-file.svg
on a file generated using the wavedrom editor I get the following error message:I understand that the underlying issue is that the wavedrom file format (an example is shown below):
is in what is referred to as "relaxed JSON", or really Javascript, which is a dialect the Python JSON decoder doesn't appear to understand.