-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add compress
kwarg to Model.to_file()
and States.to_file()
#150
base: main
Are you sure you want to change the base?
Add compress
kwarg to Model.to_file()
and States.to_file()
#150
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It would be nice to expose some compression level controls as well, or at the very least to specify explicitly what's used (zlib.Z_DEFAULT_COMPRESSION
/6).
@@ -427,6 +427,7 @@ cdef class Model: | |||
def into_file(self, file, *, | |||
Py_ssize_t max_num_states = 0, | |||
bool only_decision = False, | |||
bool compress = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we expose compression level as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but erred on consistency with dwavesystems/dimod#1296 and the others for compatibility. No one has requested finer control for those so 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I can see pros and cons of both approaches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like someone already did the analysis. 🤦
On the one hand, this is a pretty harmless PR, on the other I am underwhelmed with the results. A simple benchmark
|
By default this maintains the existing behavior but allows us to toggle it via a keyword argument.
See also dwavesystems/dimod#1296