Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-132983: Add documentation for compression.zstd#133911
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
49d9c30
62ef4dc
0b154b1
63f963f
cfe0590
5115b4c
4ab7fd7
5eb5efc
987bd27
615ed7f
0f7bc05
44173f3
8bd5500
24f3761
d04ce4f
e61e9a1
1149832
71ed7c3
2f895dd
f25e6e7
9ff6320
daa9df1
b3fd3cd
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -65,7 +65,7 @@ Reading and writing compressed files | ||
:class:`DecompressionParameter` for detailed information about supported | ||
parameters. The *zstd_dict* argument is a :class:`ZstdDict` instance to be | ||
used during decompression. When opening a file for reading, if the *level* | ||
argument isnot None, a :exc:`!TypeError` will be raised. | ||
When opening a file for writing, the *options* argument can be a dictionary | ||
providing advanced decompression parameters; see | ||
@@ -105,9 +105,9 @@ Reading and writing compressed files | ||
``'w'`` does not truncate the file, and is instead equivalent to ``'a'``. | ||
When opening a file for reading, the *options* argument can be a dictionary | ||
vadmium marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
providing advanced decompression parameters; see | ||
:class:`DecompressionParameter` for detailed information about supported | ||
emmatyping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
parameters. The *zstd_dict* argument is a :class:`ZstdDict` instance to be | ||
emmatyping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page.
emmatyping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
used during decompression. When opening a file for reading, if the *level* | ||
argument is passed a :exc:`!TypeError` will be raised. | ||
@@ -205,7 +205,7 @@ Compressing and decompressing data in memory | ||
parameters. The valid keys and values for compression parameters are | ||
documented as part of the :class:`CompressionParameter` documentation. | ||
The *zstd_dict* argument is anoptionalinstance of :class:`ZstdDict` | ||
containing trained data to improve compression efficiency. The | ||
function :func:`train_dict` can be used to generate a Zstandard dictionary. | ||
@@ -285,7 +285,7 @@ Compressing and decompressing data in memory | ||
The returned data should be concatenated with the output of any previous | ||
calls to :meth:`!decompress`. | ||
If *max_length* is non-negative,the methodreturns at most *max_length* | ||
bytes of decompressed data. If this limit is reached and further | ||
output can be produced, the :attr:`~.needs_input` attribute will | ||
be set to ``False``. In this case, the next call to | ||
@@ -314,7 +314,7 @@ Compressing and decompressing data in memory | ||
.. attribute:: needs_input | ||
``False`` if the :meth:`.decompress` method can provide more | ||
decompressed data before requiring newcompressed input. | ||
Zstandard dictionaries | ||
@@ -330,7 +330,7 @@ Zstandard dictionaries | ||
files), Zstandard dictionaries can improve compression ratios and speed | ||
significantly. | ||
The *samples* argument (an iterable of :class:`bytes` objects), is the population of | ||
samples used to train the Zstandard dictionary. | ||
The *dict_size* argument, an integer, is the maximum size (in bytes) the | ||
@@ -421,7 +421,7 @@ Zstandard dictionaries | ||
.. attribute:: dict_id | ||
Identifier of the Zstandard dictionary,a non-negativeint value. | ||
Non-zero means the dictionary is ordinary, created by Zstandard | ||
functions and following the Zstandard format. | ||
@@ -437,7 +437,7 @@ Zstandard dictionaries | ||
.. attribute:: as_digested_dict | ||
Load as a digested dictionary. | ||
.. attribute:: as_undigested_dict | ||
@@ -450,7 +450,7 @@ Advanced parameter control | ||
.. class:: CompressionParameter() | ||
An :class:`~enum.IntEnum` containing the advanced compression parameter | ||
keys that can be used when compressing data. | ||
The :meth:`~.bounds` method can be used on any attribute to get the valid | ||
values for that parameter. | ||
@@ -472,7 +472,7 @@ Advanced parameter control | ||
A high-level means of setting other compression parameters that affect | ||
the speed and ratio of compressing data. Setting the level to zero uses | ||
:attr:`COMPRESSION_LEVEL_DEFAULT`. | ||
.. attribute:: window_log | ||
@@ -509,7 +509,7 @@ Advanced parameter control | ||
decompression speed, but decrease ratio. Note that Zstandard can still | ||
find matches of smaller size, it just tweaks its search algorithm to look | ||
for this size and larger. For all strategies < :attr:`~Strategy.btopt`, | ||
the effective minimum is ``4``; for all strategies | ||
> :attr:`~Strategy.fast`, the effective maximum is ``6``. | ||
emmatyping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
.. attribute:: target_length | ||
@@ -621,13 +621,13 @@ Advanced parameter control | ||
parameter. This method should be called on the attribute you wish to | ||
retrieve the bounds of. For example, to get the valid values for | ||
:attr:`~.window_log_max`, one may check the result of | ||
``DecompressionParameter.window_log_max.bounds()``. | ||
Both the lower and upper bounds are inclusive. | ||
.. attribute:: window_log_max | ||
Thebase-two logarithmofthe maximum size of the window used during decompression. | ||
This can be useful to limit the amount of memory used when decompressing | ||
data. | ||
Uh oh!
There was an error while loading.Please reload this page.