Skip to content

Commit 71ed7c3

Browse files
emmatypingvadmium
andauthored
Apply suggestions from vadmium
Co-authored-by: Martin Panter <[email protected]>
1 parent 1149832 commit 71ed7c3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Doc/library/compression.zstd.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Reading and writing compressed files
6565
:class:`DecompressionParameter` for detailed information about supported
6666
parameters. The *zstd_dict* argument is a :class:`ZstdDict` instance to be
6767
used during decompression. When opening a file for reading, if the *level*
68-
argument is passed, a :exc:`!TypeError` will be raised.
68+
argument is not None, a :exc:`!TypeError` will be raised.
6969

7070
When opening a file for writing, the *options* argument can be a dictionary
7171
providing advanced decompression parameters; see
@@ -105,9 +105,9 @@ Reading and writing compressed files
105105
``'w'`` does not truncate the file, and is instead equivalent to ``'a'``.
106106

107107
When opening a file for reading, the *options* argument can be a dictionary
108-
providing advanced decompression parameters, see
108+
providing advanced decompression parameters; see
109109
:class:`DecompressionParameter` for detailed information about supported
110-
parameters. The *zstd_dict* argument is a :class:`!ZstdDict` instance to be
110+
parameters. The *zstd_dict* argument is a :class:`ZstdDict` instance to be
111111
used during decompression. When opening a file for reading, if the *level*
112112
argument is passed a :exc:`!TypeError` will be raised.
113113

@@ -205,7 +205,7 @@ Compressing and decompressing data in memory
205205
parameters. The valid keys and values for compression parameters are
206206
documented as part of the :class:`CompressionParameter` documentation.
207207

208-
The *zstd_dict* argument is an instance of :class:`ZstdDict`
208+
The *zstd_dict* argument is an optional instance of :class:`ZstdDict`
209209
containing trained data to improve compression efficiency. The
210210
function :func:`train_dict` can be used to generate a Zstandard dictionary.
211211

@@ -285,7 +285,7 @@ Compressing and decompressing data in memory
285285
The returned data should be concatenated with the output of any previous
286286
calls to :meth:`!decompress`.
287287

288-
If *max_length* is non-negative, returns at most *max_length*
288+
If *max_length* is non-negative, the method returns at most *max_length*
289289
bytes of decompressed data. If this limit is reached and further
290290
output can be produced, the :attr:`~.needs_input` attribute will
291291
be set to ``False``. In this case, the next call to
@@ -314,7 +314,7 @@ Compressing and decompressing data in memory
314314
.. attribute:: needs_input
315315

316316
``False`` if the :meth:`.decompress` method can provide more
317-
decompressed data before requiring new uncompressed input.
317+
decompressed data before requiring new compressed input.
318318

319319

320320
Zstandard dictionaries
@@ -330,7 +330,7 @@ Zstandard dictionaries
330330
files), Zstandard dictionaries can improve compression ratios and speed
331331
significantly.
332332

333-
The *samples* argument (an iterable of :class:`bytes`), is the population of
333+
The *samples* argument (an iterable of :class:`bytes` objects), is the population of
334334
samples used to train the Zstandard dictionary.
335335

336336
The *dict_size* argument, an integer, is the maximum size (in bytes) the
@@ -421,7 +421,7 @@ Zstandard dictionaries
421421

422422
.. attribute:: dict_id
423423

424-
Identifier of the Zstandard dictionary, an int value between zero and .
424+
Identifier of the Zstandard dictionary, a non-negative int value.
425425

426426
Non-zero means the dictionary is ordinary, created by Zstandard
427427
functions and following the Zstandard format.
@@ -437,7 +437,7 @@ Zstandard dictionaries
437437

438438
.. attribute:: as_digested_dict
439439

440-
Load as a digested dictionary, see below.
440+
Load as a digested dictionary.
441441

442442
.. attribute:: as_undigested_dict
443443

@@ -450,7 +450,7 @@ Advanced parameter control
450450
.. class:: CompressionParameter()
451451

452452
An :class:`~enum.IntEnum` containing the advanced compression parameter
453-
names that can be used when compressing data.
453+
keys that can be used when compressing data.
454454

455455
The :meth:`~.bounds` method can be used on any attribute to get the valid
456456
values for that parameter.
@@ -472,7 +472,7 @@ Advanced parameter control
472472

473473
A high-level means of setting other compression parameters that affect
474474
the speed and ratio of compressing data. Setting the level to zero uses
475-
the default :attr:`COMPRESSION_LEVEL_DEFAULT`.
475+
:attr:`COMPRESSION_LEVEL_DEFAULT`.
476476

477477
.. attribute:: window_log
478478

@@ -509,7 +509,7 @@ Advanced parameter control
509509
decompression speed, but decrease ratio. Note that Zstandard can still
510510
find matches of smaller size, it just tweaks its search algorithm to look
511511
for this size and larger. For all strategies < :attr:`~Strategy.btopt`,
512-
the effective minimum is ``4``, for all strategies
512+
the effective minimum is ``4``; for all strategies
513513
> :attr:`~Strategy.fast`, the effective maximum is ``6``.
514514

515515
.. attribute:: target_length
@@ -621,13 +621,13 @@ Advanced parameter control
621621
parameter. This method should be called on the attribute you wish to
622622
retrieve the bounds of. For example, to get the valid values for
623623
:attr:`~.window_log_max`, one may check the result of
624-
``CompressionParameter.window_log_max.bounds()``.
624+
``DecompressionParameter.window_log_max.bounds()``.
625625

626626
Both the lower and upper bounds are inclusive.
627627

628628
.. attribute:: window_log_max
629629

630-
The power of two maximum size of the window used during decompression.
630+
The base-two logarithm of the maximum size of the window used during decompression.
631631
This can be useful to limit the amount of memory used when decompressing
632632
data.
633633

0 commit comments

Comments
 (0)