glot
glot copied to clipboard
Error when saving: This plot has 0 curves and therefore its a redundant plot and it can't be printed.
After updating to the latest commit ( 828496c875ee51ac46eab15f1e63a23050add6f4 ), I am getting an error when calling SavePlot. I believe this error is caused because nplots
is 0. nplots
is only updated in plotX()
, plotXY()
, and plotXYZ()
functions, which are not being called internally anymore. This was broken on this pull request . When I manually insert those lines back in, I can plot the graph. Any reason this was taken out?
@paulhovey Thanks a lot for raising the issue. @szaydel Can you please look into this and a simple pr to solve this?
Thanks
+1 the same problem. maybe broken something.
@Arafatk: sorry about being slow to reply. Will resolve.
@paulhovey: Would it be possible to have an example use? I am going to say that there's probably not a test for this also, which I will be sure to add.
@Arafatk, these issues are a result of inadequate testing on my part, and premature PR: https://github.com/Arafatk/glot/pull/15. That PR relied too much on the tests that were written and not enough on the author doing functional testing beyond unit tests. I will fix things, but I can see clearly that a number of things will need to be changed in order to avoid breaking functionality that worked before https://github.com/Arafatk/glot/pull/15.
@szaydel testing is good for stuff under tests :) it seems as though perhaps SavePlot()
isn't under test? My first thought would be to use afero as a fake file system and something like imgdiff to compare against a known good image? Would there be an easier way to test it?
Yeah, there's much that probably needs better testing. I think there are a number of ways to do this, one might be to checksum generated plots, though I am not sure if they encode any metadata that's volatile, which would break checksumming methods. One could also compare certain offsets in the file, etc. I am not sure if a fake filesystem is required, since things could be tested against a temp location and just tossed away. But this is definitely testing for side-effects and so some thought needs to be given.