I encountered an issue with this when I ran it, the issue was I had a broken kaleido version or something, I dunno exactly, but it highlighted a weakness here:
The deletion happens here but the writing happens later so if there are any failures later on in the script then its already deleted the existing outputs
Checking if you can do the plotly.io.to_image in a try block would fix my specific issue but if any other steps have a problem, maybe one figure having bad data? then it wouldn't make a difference so preferably a broader fix.
- One option would be to save everything to a temporary folder and swap them at the end?
- Another would be to overwrite in place, but this has the risk of if you are no longer creating a file then a stale version will remain from a previous build/
It isn't urgent but its something to keep in mind.
Originally posted by @alasdairwilson in #62 (comment)
Originally posted by @alasdairwilson in #62 (comment)