Skip to content

Commit fc3c11e

Browse files
Documentation typos.
1 parent bd15eaf commit fc3c11e

12 files changed

+32
-23
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ News
2121
----
2222
**April 2024**: bitstring 4.2.0 released.
2323

24-
New in 4.2:
24+
New in version 4.2:
2525

2626
* Dropped support for Python 3.7. Minimum version is now 3.8.
2727
* A new `Dtype` class can be optionally used to specify types.
2828
* The `bitstring.options` object is now the preferred method for changing module options.
2929
* New `fromstring` method as another way to create bitstrings from formatted strings.
3030
* More types can now be pretty printed.
31-
* A range of 8-bit, 6-bit and even 4-bit float formats added (beta):
31+
* A range of 8-bit, 6-bit and even 4-bit floating point formats added (beta):
3232
* Performance improvements.
3333

3434
See the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt) for details. Please let me know if you encounter any problems.

doc/array.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ The dtype of the resulting ``Array`` is calculated by applying these rules:
343343

344344
**Rule 0**: For comparison operators (``<``, ``>=``, ``==``, ``!=`` etc.) the result is always an ``Array`` of dtype ``'bool'``.
345345

346-
For other operators, one of the two input ``Array`` dtypes is used as the ouput dtype by applying the remaining rules in order until a winner is found:
346+
For other operators, one of the two input ``Array`` dtypes is used as the output dtype by applying the remaining rules in order until a winner is found:
347347

348348
* **Rule 1**: Floating point types always win against integer types.
349349
* **Rule 2**: Signed integer types always win against unsigned integer types.

doc/bits.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
328328
:type: str
329329

330330
Property for the representation of the bitstring as a binary string.
331-
Can be shortend to just ``b``.
331+
Can be shortened to just ``b``.
332332

333333
.. attribute:: Bits.bool
334334
:type: bool
@@ -354,7 +354,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
354354
:type: str
355355

356356
Property representing the hexadecimal value of the bitstring.
357-
Can be shortend to just ``h``.
357+
Can be shortened to just ``h``.
358358

359359
If the bitstring is not a multiple of four bits long then getting its hex value will raise an :exc:`InterpretError`. ::
360360

@@ -366,7 +366,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
366366
:type: int
367367

368368
Property for the signed two’s complement integer representation of the bitstring.
369-
Can be shortend to just ``i``.
369+
Can be shortened to just ``i``.
370370

371371
.. attribute:: Bits.intbe
372372
:type: int
@@ -395,7 +395,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
395395
:type: float
396396

397397
Property for the floating point representation of the bitstring.
398-
Can be shortend to just ``f``.
398+
Can be shortened to just ``f``.
399399

400400
The bitstring must be 16, 32 or 64 bits long to support the floating point interpretations, otherwise an :exc:`InterpretError` will be raised.
401401

@@ -427,7 +427,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
427427
:type: str
428428

429429
Property for the octal representation of the bitstring.
430-
Can be shortend to just ``o``.
430+
Can be shortened to just ``o``.
431431

432432
If the bitstring is not a multiple of three bits long then getting its octal value will raise a :exc:`InterpretError`. ::
433433

@@ -443,7 +443,7 @@ Note that the ``bin``, ``oct``, ``hex``, ``int``, ``uint`` and ``float`` propert
443443
:type: int
444444

445445
Property for the unsigned base-2 integer representation of the bitstring.
446-
Can be shortend to just ``u``.
446+
Can be shortened to just ``u``.
447447

448448
.. attribute:: Bits.uintbe
449449
:type: int

doc/bitstream.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BitStream
1212

1313
The ``pos`` will also used as a default for the :meth:`BitArray.overwrite` and :meth:`BitArray.insert` methods.
1414

15-
The bit position is modifed by methods that read bits, as described in :attr:`~ConstBitStream.pos`, but for the mutable ``BitStream`` it is also modified by other methods:
15+
The bit position is modified by methods that read bits, as described in :attr:`~ConstBitStream.pos`, but for the mutable ``BitStream`` it is also modified by other methods:
1616

1717
* If a methods extends the bitstring (``+=``, ``append``) the ``pos`` will move to the end of the bitstring.
1818
* If a method otherwise changes the length of the bitstring (``prepend``, ``insert``, sometimes ``replace``) the ``pos`` becomes invalid and will be reset to ``0``.

doc/constbitstream.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ This position will be set to zero by default on construction, and will be modifi
172172

173173
Using :meth:`~Bits.find` or :meth:`~Bits.rfind` will move ``pos`` to the start of the substring if it is found.
174174

175-
Note that the ``pos`` property isn’t considered a part of the bitstring's identity; this allows it to vary for immutable ``ConstBitStream`` objects and means that it doesnt affect equality or hash values.
175+
Note that the ``pos`` property isn’t considered a part of the bitstring's identity; this allows it to vary for immutable ``ConstBitStream`` objects and means that it doesn't affect equality or hash values.
176176
It also will be reset to zero if a bitstring is copied.
177177

178178

doc/dtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The first parameter is a format token string that can optionally include a lengt
1515
If the first parameter doesn't include a length and one is appropriate, the `length` parameter can be used to specify the length of the dtype.
1616

1717
The `scale` parameter can be used to specify a multiplicative scaling factor for the interpretation of the data.
18-
This is primarily inteded for use with floating point formats of 8 bits or less, but can be used on other types.
18+
This is primarily intended for use with floating point formats of 8 bits or less, but can be used on other types.
1919

2020
In most situations the token string can be used instead of `Dtype` object when it is needed, and the `Dtype` will be constructed automatically,
2121
which is why the `Dtype` object is rarely used directly in this documentation.

doc/exotic_floats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ IEEE 8-bit Floating Point Types
6969

7070

7171
The 'binary8' formats are part of an ongoing IEEE standardisation process.
72-
This implementation here is based on a publically available draft of the standard.
72+
This implementation here is based on a publicly available draft of the standard.
7373
There are seven formats defined in the draft standard, but only two are supported here.
7474
If you'd like the other precisions supported then raise a feature request!
7575

doc/functions.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Note how you can use some tokens without sizes (such as ``bin`` and ``bits`` in
6262
If the size had been specified then a :exc:`ValueError` would be raised if the parameter given was the wrong length.
6363
Note also how bitstring literals can be used (the ``0b110`` in the bitstring returned by ``foo``) and these don't consume any of the items in ``*values``.
6464

65-
You can also include keyword, value pairs (or an equivalent dictionary) as the final parameter(s). The values are then packed according to the positions of the keywords in the format string. This is most easily explained with some examples. Firstly the format string needs to contain parameter names::
65+
You can also include keyword, value pairs (or an equivalent dictionary) as the final parameter(s).
66+
The values are then packed according to the positions of the keywords in the format string.
67+
This is most easily explained with some examples. Firstly the format string needs to contain parameter names::
6668

6769
format = 'hex32=start_code, uint12=width, uint12=height'
6870

doc/interpretation.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
Interpreting Bitstrings
44
=======================
55

6-
Bitstrings don't know or care how they were created; they are just collections of bits. This means that you are quite free to interpret them in any way that makes sense.
6+
Bitstrings don't know or care how they were created; they are just collections of bits.
7+
This means that you are quite free to interpret them in any way that makes sense.
78

8-
Several Python properties are used to create interpretations for the bitstring. These properties call private functions which will calculate and return the appropriate interpretation. These don’t change the bitstring in any way and it remains just a collection of bits. If you use the property again then the calculation will be repeated.
9+
Several Python properties are used to create interpretations for the bitstring.
10+
These properties call private functions which will calculate and return the appropriate interpretation.
11+
These don’t change the bitstring in any way and it remains just a collection of bits.
12+
If you use the property again then the calculation will be repeated.
913

10-
Note that these properties can potentially be very expensive in terms of both computation and memory requirements. For example if you have initialised a bitstring from a 10 GiB file object and ask for its binary string representation then that string will be around 80 GiB in size!
14+
Note that these properties can potentially be very expensive in terms of both computation and memory requirements.
15+
For example if you have initialised a bitstring from a 10 GiB file object and ask for its binary string representation then that string will be around 80 GiB in size!
1116

1217
If you're in an interactive session then the pretty-print method :meth:`~Bits.pp` can be useful as it will only convert the bitstring one chunk at a time for display.
1318

doc/introduction.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ For example::
6464

6565
Note that some types need a length to be specified, some don't need one, and others can infer the length from the value.
6666

67-
Another way to create a bitstring is via the ``pack`` function, which packs multiple values accoring to a given format.
67+
Another way to create a bitstring is via the ``pack`` function, which packs multiple values according to a given format.
6868
See the entry on :func:`pack` for more information.
6969

7070
.. _auto_init:
@@ -198,7 +198,9 @@ From an integer
198198
>>> f.bin
199199
'1111111'
200200

201-
For initialisation with signed and unsigned binary integers (``int`` and ``uint`` respectively) the ``length`` parameter is mandatory, and must be large enough to contain the integer. So for example if ``length`` is 8 then ``uint`` can be in the range 0 to 255, while ``int`` can range from -128 to 127. Two's complement is used to represent negative numbers.
201+
For initialisation with signed and unsigned binary integers (``int`` and ``uint`` respectively) the ``length`` parameter is mandatory, and must be large enough to contain the integer.
202+
So for example if ``length`` is 8 then ``uint`` can be in the range 0 to 255, while ``int`` can range from -128 to 127.
203+
Two's complement is used to represent negative numbers.
202204

203205
The 'auto' initialiser can be used by giving the length in bits immediately after the ``int`` or ``uint`` token, followed by an equals sign then the value::
204206

0 commit comments

Comments
 (0)