Optionally pass an IO instead of filename to vtree saving #62
+52
−37
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.
Hi,
I'm working on ensemble of PSDDs, and to make life easier I decided to save ensembles as zip files with
.psdd
and.vtree
files in them. The current versions of LogicCircuits and ProbabilisticCircuits don't let you pass anIO
, making you use the filename instead. The wayZipFile
(https://github.com/fhs/ZipFile.jl/blob/master/src/ZipFile.jl) is implemented, I'd need to pass an IO instead. This PR gives saving/loading more flexibility by allowing you to alternatively pass anIO
. I added a few tests just to make sure I didn't break anything and they're all green. :)Thanks,
Renato