Restore auto creation of save dirs in PlotContainer.save #3289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Intent: fix #3210
The patch is not elegant at all, but it works ™️ (at least the tests I wrote for it pass)
Note that in order to make this work I "sacrificed" a feature that was deemed unintuitive in the original disscussion. Namely,
PlotContainer.save("img")
used to interpret"img"
as a file prefix OR an output directory depending on wether such a directory existed already or not. This PR intentionally breaks this undocumented (AFAIK) feature to make room for the one @chummels wanted back in his original report.Following the discussions in the issue, I think the best course of action in the foreseeable future would be rethink the amount of magic we want to support in saving functions, but for now, we've agreed that it's best to just try and restore the old behaviours in time for the 4.0 release.