Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally pass an IO instead of filename to vtree saving #62

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

RenatoGeh
Copy link
Contributor

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 an IO, making you use the filename instead. The way ZipFile (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 an IO. I added a few tests just to make sure I didn't break anything and they're all green. :)

Thanks,
Renato

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #62 (5e12911) into master (0ae3412) will decrease coverage by 2.12%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
- Coverage   84.04%   81.92%   -2.13%     
==========================================
  Files          29       29              
  Lines        2369     2373       +4     
==========================================
- Hits         1991     1944      -47     
- Misses        378      429      +51     
Impacted Files Coverage Δ
src/LoadSave/circuit_savers.jl 98.19% <80.00%> (-0.45%) ⬇️
src/LoadSave/vtree_loaders.jl 100.00% <100.00%> (ø)
src/LoadSave/vtree_savers.jl 90.90% <100.00%> (+0.34%) ⬆️
src/Utils/cubitvector.jl 28.57% <0.00%> (-18.10%) ⬇️
src/Utils/data.jl 65.66% <0.00%> (-14.46%) ⬇️
src/satisfies_flow.jl 32.52% <0.00%> (-7.62%) ⬇️
src/bit_circuit.jl 78.84% <0.00%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ae3412...5e12911. Read the comment docs.

@khosravipasha
Copy link
Collaborator

Thanks for the PR. The changes and tests look good so I am merging it.
The codecoverage going down does not seem to be because of these changes. The last codecoverage report was run on gpu machine so the change of coverage is due to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants