Closed nseidle closed 4 years ago
Ah, may not be subsampling at all.
python buzzard.py "[VIN]" -o lib fails in same way,
Subsampling definitely fails with certain values, which is expected because there's a minimum number of times you can divide a line (the length of a segment surpasses the length of the line)
It doesn't seem like there's a great way to guess the optimal subsampling rate, but I'll play with setting a min/max and let buzzard "try again" with a bigger one when it fails.
This tag, in particular, works fine if you do
python buzzard.py "[VIN]" -o lib -u 0.3
Ran into this as well (look at me, checking the issues!!)
Just another point of reference, but
This worked: run makelabel -s 0.045 "[VREF)" -u 0.3
This failed: run makelabel -s 0.045 "[VREF)"
Also, I only encountered this issue when the combo of "[V" is included in the text.
Thanks for the work around!
Okay, I finally figured this out. I was TOTALLY WRONG about what causes this error. It was a stupid error where a function (interpPt, if you're curious) was allowed to return an empty list in certain situations. In the JS implementation, that was fine, because when JS "concats" lists, an empty list is ignored. When I did the same thing in Python, it added the empty list as an entry. Later, when that empty list was evaluated as a "point," Python was like "Hey, this is supposed to be a complex number, not a list!"
So anyway, I fixed the function so it returns None instead of [] and then added some safeguards against appending empty lists to the points list.
TL;DR: Any subsampling value should return some kind of result now, all the way from trash (<0.001) to huge (>1)
python buzzard.py "(R)" -u 0.1 -o lib works
python buzzard.py "(R)" -u 0.9 -o lib fails
I'm not sure I even need subsampling but wanted to capture the error while I had it.