Skip to content

Commit 36cd1a8

Browse files
committed
Merge remote-tracking branch 'origin/main' into wma/fill-value
2 parents c5fd980 + bc61ea4 commit 36cd1a8

1 file changed

Lines changed: 48 additions & 11 deletions

File tree

spec/latest/index.bs

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,21 +235,58 @@ Data Types {#key_data_types}
235235

236236
The `data_types` key must be present and shall define the data types of all required
237237
arrays based on the [[#key_format]]. The data type declares the type of both the
238-
on-disk array as well as the in-memory array. When these are identical, a simple string
239-
defines the type. When the on-disk and in-memory types differ due to limitations in the
240-
storage container (ex. HDF5 lacks a BOOL type), the type is shown as "on_disk->in_memory".
241-
For the example of storing BOOL type as INT8, this would be "int8->bool" to indicate that
242-
after reading the values array into memory, it should be interpreted as boolean data.
238+
on-disk array as well as the in-memory array.
243239

244240
For a given [[#key_format]], all named binary arrays for that format shall have a
245241
corresponding name in `data_types`.
246242

243+
The following strings shall be used to describe data types:
244+
: "uint8"
245+
:: unsigned 8-bit integer
246+
: "uint16"
247+
:: unsigned 16-bit integer
248+
: "uint32"
249+
:: unsigned 32-bit integer
250+
: "uint64"
251+
:: unsigned 64-bit integer
252+
: "int8"
253+
:: signed 8-bit integer
254+
: "int16"
255+
:: signed 16-bit integer
256+
: "int32"
257+
:: signed 32-bit integer
258+
: "int64"
259+
:: signed 64-bit integer
260+
: "float32"
261+
:: IEEE binary32 floating point number
262+
: "float64"
263+
:: IEEE binary64 floating point number
264+
: "bint8"
265+
:: An unsigned 8-bit integer, to be reinterpreted as a Boolean number, however
266+
that is represented in the host language. The value 0 shall map to false and the
267+
value 1 shall map to true. When parsing, implementations may choose to interpret
268+
values other than 0 or 1 as true, or throw an error.
269+
270+
## Value Modifiers ## {#value_modifiers}
271+
272+
When the value array is meant to be reinterpreted before reading, a special bracket syntax is
273+
provided to indicate modifications to the underlying value array.
274+
275+
### Sparse Array with Complex Values ### {#complex_arrays}
276+
277+
When a value array is composed of alternating real and imaginary components of
278+
complex numbers, the type is written as `complex[<type>]`. For example, a value
279+
array of complex `float64` would have a datatype of `complex[float64]` The real
280+
component of the `i`th element in the modified array shall be stored at position
281+
`2i` in the original array, and the imaginary component of the `i`th element in
282+
the modified array shall be at position `2i + 1` in the underlying array.
283+
247284
### Sparse Array with All Values the Same ### {#iso_arrays}
248285

249-
When all values of a sparse array are the same identical value, a special syntax is
250-
provided to compress the value array to a single value rather than duplicating the same
251-
number unnecessarily. The format of the array is written as `iso[<format>]` to indicate
252-
that the array will store only a single element which is common to all stored indices.
286+
When all values of a sparse array are the same identical value, the type is
287+
written as `iso[<type>]`. This indicates that the array will store only a single
288+
element which is common to all stored indices. All elements in the modified
289+
array shall be stored at position 0 of the underlying array.
253290

254291
<div class=example>
255292

@@ -312,12 +349,12 @@ Example of a CSR Matrix whose values are all 7.
312349

313350
```json
314351
{
315-
"format": "iso\[CSR]",
352+
"format": "CSR",
316353
"shape": [5, 5],
317354
"data_types": {
318355
"pointers_0": "uint64",
319356
"indices_1": "uint64",
320-
"values": "int8"
357+
"values": "iso[int8]"
321358
}
322359
}
323360
```

0 commit comments

Comments
 (0)