Skip to content

Commit 3431dc4

Browse files
committed
md formatting
1 parent addd597 commit 3431dc4

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

source/bson-binary-vector/bson-binary-vector.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ End Function
181181
#### Validation
182182

183183
Drivers MUST validate vector metadata and raise an error if any invariant is violated:
184-
184+
185185
- When unpacking binary data into a FLOAT32 Vector structure, the length of the binary data following the dtype and
186186
padding MUST be a multiple of 4 bytes.
187-
- Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within \[0, 7\] for PACKED_BIT.
188-
- A PACKED_BIT vector MUST NOT be empty if padding is in the range \[1, 7\].
189-
- For a PACKED_BIT vector with non-zero padding, ignored bits SHOULD be zero.
190-
- When encoding, if ignored bits aren't zero, drivers SHOULD zero out or raise an exception,
191-
but drivers MAY leave them as-is if backwards-compatibility is a concern.
192-
- When decoding, drivers SHOULD raise an error if decoding non-zero ignored bits,
193-
but drivers MAY choose not to for backwards compatibility.
194-
- Drivers SHOULD use the next major release to conform to ignored bits being zero.
187+
- Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within [0, 7] for PACKED_BIT.
188+
- A PACKED_BIT vector MUST NOT be empty if padding is in the range [1, 7].
189+
- For a PACKED_BIT vector with non-zero padding, ignored bits SHOULD be zero.
190+
- When encoding, if ignored bits aren't zero, drivers SHOULD zero out or raise an exception, but drivers MAY leave
191+
them as-is if backwards-compatibility is a concern.
192+
- When decoding, drivers SHOULD raise an error if decoding non-zero ignored bits, but drivers MAY choose not to for
193+
backwards compatibility.
194+
- Drivers SHOULD use the next major release to conform to ignored bits being zero.
195195

196196
Drivers MUST perform this validation when a numeric vector and padding are provided through the API, and when unpacking
197197
binary data (BSON or similar) into a Vector structure.

source/bson-binary-vector/tests/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ MUST assert that the input float array is the same after encoding and decoding.
5959

6060
### Treatment of non-zero ignored bits
6161

62-
Drivers SHOULD test this behavior, whether an error is thrown or bits are preserved,
63-
according to their design and version.
64-
For drivers that haven't been completed, raise an exception.
65-
For those that have, update to this behavior according to semantic versioning rules.
62+
Drivers SHOULD test this behavior, whether an error is thrown or bits are preserved, according to their design and
63+
version. For drivers that haven't been completed, raise an exception. For those that have, update to this behavior
64+
according to semantic versioning rules.
6665

6766
A vector of length 1 with non-zero ignored bits provides a good example to use.
6867

6968
#### 1. Encoding
69+
7070
```python
7171
v = Binary.from_vector([0b11111111], BinaryVectorDtype.PACKED_BIT, padding=7)
7272
```
@@ -80,9 +80,8 @@ v = Binary.from_vector([0b11111111], BinaryVectorDtype.PACKED_BIT, padding=7)
8080

8181
### 3. Comparison
8282

83-
Here is an example that shows that in pymongo < 5.0, one can decode non-zero ignored
84-
bits, but though these vectors are equivalent after ignoring the last 7 bits, we
85-
cannot compare their binary representations directly.
83+
Here is an example that shows that in pymongo < 5.0, one can decode non-zero ignored bits, but though these vectors are
84+
equivalent after ignoring the last 7 bits, we cannot compare their binary representations directly.
8685

8786
```python
8887
b1 = Binary.from_vector([0b10000000], BinaryVectorDtype.PACKED_BIT, padding=7)

0 commit comments

Comments
 (0)