-
Notifications
You must be signed in to change notification settings - Fork 0
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
Split into library and executable #60
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.
return packet | ||
|
||
|
||
def encode_file(fhandle=stdin, chunksize=2048, compresslevel=5, |
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.
It is not necessary to deal with this for #60, however at some point, we should check if fhandle is bytes
or bytearray
, in which case we should use it as data rather than opening it as a handle.
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.
added #61
del gzip_compress, gzip_decompress | ||
|
||
|
||
def warn(integer, *argv, **kwargs): |
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.
This does not need to be handled for #60, but in the long run, we should probably use python's logging
library. When we started with Bitshuffle, it was sufficiently small that logging would be overkill, but at this point, we want to make sure we aren't polluting other developer's output streams.
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.
added #62
def decode(message): | ||
'''Decode any number of packets previously encoded with bitshuffle | ||
Assumes all packets are part of the same message''' | ||
_, _, _, compression, seq_num, \ |
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.
This is very nitpicky, and not really related to #60, but these variables names do not make it obvious that these values are indicies. Reading file_hash
, you would expect the variable to hold the hash, not the index thereof.
I think it's been like this for a while, but it just occurred to me.
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.
added #63
Closes #54. Should make #39 much easier to implement. Gets #55 slightly closer to completion.
Highlights:
Minor changes:
shashum
globally toshasum
Note: anything imported in
__init__.py
is accessible programmatically