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

Add compression algorithms facility to file IO #84

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

nicholasjng
Copy link
Collaborator

@nicholasjng nicholasjng commented Feb 21, 2024

Still work in progress, I'm currently debating which other compressions to add (lzma? xz? ...), and whether to expose the stateful hooks (get_driver_implementation() | get_compression_algorithm()) right now instead of letting people roll their own SerDe registry.


Works similarly to the file driver lookup, except the compression can
also be None, in which case a normal file descriptor is used.

Canonicalizes the extension of the resulting file regardless of which
file name is used based on driver and compression algorithm. This might
be surprising behavior, but simplifies driver and compression inference
significantly on roundtrips.

Scraps the custom registries in FileIO constructor, because we intend to
expose reg/dereg hooks for the default later on.

Available compressions are gzip and bz2, which are cross-platform Python stdlib builtins.

@nicholasjng nicholasjng added the enhancement New feature or request label Feb 21, 2024
@nicholasjng nicholasjng self-assigned this Feb 21, 2024
@nicholasjng nicholasjng linked an issue Feb 21, 2024 that may be closed by this pull request
3 tasks
src/nnbench/reporter/file.py Show resolved Hide resolved
Works similarly to the file driver lookup, except the compression can
also be None, in which case a normal file descriptor is used.

Canonicalizes the extension of the resulting file regardless of which
file name is used based on driver and compression algorithm. This might
be surprising behavior, but simplifies driver and compression inference
significantly on roundtrips.

Scraps the custom registries in FileIO constructor, because we expose
reg/dereg hooks for file drivers and compressions.
@nicholasjng nicholasjng merged commit 6b9d470 into main Feb 22, 2024
5 checks passed
@nicholasjng nicholasjng deleted the add-basic-compressions branch February 22, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support compression for file reading and writing
2 participants