Repository navigation
docs: write the 0.7.0 changelog - #86
Merged
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
np.int8,np.int16,np.int32,np.uint8,np.uint16,np.uint32,np.uint64,np.float16,np.float32,np.complex64andnp.datetime64as field types, record members, collection elements and stream items,
stored at their own width as kinds 13 to 23 of box layout 3.1 and stream
layout 1.1. A field reads back as its numpy type, and a value that does not
fit the width raises
OverflowError. Anp.datetime64field storesnanoseconds since 1970. (#66)
sbx_read_float16,sbx_write_float16,sbx_read_float32andsbx_write_float32insharedbox_c.h. (#66)X | Noneas a field, record member or stream item,holding
Noneor an array of its sizes, as inscan: npt.NDArray[np.uint8] | None = field(default=None, shape=(32, 32)).receive_intodoes not fill one. (#67)field(capacity=...): the capacity of a box field of text, bytes,bytearray,Decimalor a collection, as insamples: list[float] = field(capacity=16). (#68)metadata={"shape": (32, 32)}on its field. (#68)BoundedList[T]: a list value that keeps the stored bytes of a list field,as in
samples: Annotated[BoundedList[float], Capacity(65536)]. It takesevery element type
list[T]takes and is stored aslist[T]is. A readcopies the bytes without decoding an element, a write of a
BoundedListofthe field's element type copies them back, indexing decodes or encodes one
element, and a change past the capacity raises
ValueError. Subclasses,generic or with a fixed element type, can be declared in its place. (#73)
BoundedSet[T]: a set value that keeps the stored bytes of a set field,as in
seen: Annotated[BoundedSet[int], Capacity(65536)]. It is stored asset[T]is. A read copies the bytes without decoding an element, a writeof a
BoundedSetof the field's element type copies them back, andin,addandremoveencode one key and compare stored bytes, through anindex after 64 lookups in a set of more than 8 elements. The set operators take any set and return a
BoundedSetof the same class and capacity, the comparisons take any set,and a change past the capacity raises
ValueError. A declaration raisesTypeErrorfor an element type whose equal values could be storeddifferently, such as
Decimalorint | float. Subclasses, generic orwith a fixed element type, can be declared in its place. (#77)
BoundedDict[K, V]: a dict value that keeps the stored bytes of a dictfield, as in
weights: Annotated[BoundedDict[int, float], Capacity(4096)].It is stored as
dict[K, V]is. A read copies the bytes without decodingan item, a write of a
BoundedDictof the field's key and value typescopies them back, and
d[key],getandinencode one key and comparestored bytes, through an index after 64 lookups in a dict of more than 8
keys. It keeps insertion order,
|takes any mapping and returns aBoundedDictof the same class and capacity, and a change past thecapacity raises
ValueError. Keys follow the rules ofBoundedSetelements, and values can be of any type a
dictfield holds. Subclasses,generic or with fixed key and value types, can be declared in its place. (#82)
BoundedListofint,float,bool,complexor NumPy integer, float,complex or
bool_elements supports the buffer protocol:np.asarray(value)and
memoryview(value)share its elements without decoding them, read onlyfor
boolandbool_, and a change of length raisesBufferErrorwhilesuch a view exists. (#85)
Changed
list,tuple,set,frozensetordictfield allocates andcopies less, and reading a record whose class takes every member by position
no longer builds a dict of keyword arguments. (#65)
number, so
np.int64(5)written tofloat | intreads back as5. (#66)int,float,complexandboolfields take numpy's integer, floating,complex and bool scalars, and read back the Python type.
np.int64,np.float64,np.complex128andnp.bool_fields read back as those typesand hash as
int,float,complexandbool. (#66)list,setor
dictfield, and reading, indexing or looking up aBoundedListorBoundedSet, take less time. The wheels are about 75 KB larger on Linux and17 KB larger on Windows. (#79)
Fixed
list,setordictwhose slots end short of its alignment, such asAnnotated[list[Color], Capacity(3)]for anEnumColor, is accepted;its size is rounded up to the alignment.
sharedbox0.6 refuses a segmentthat holds one. (#66)
TypeErrorabout the sizes of an array member of a dataclass or attrsrecord names its metadata shape, as in
metadata shape (3), instead offield(shape=...). (#70)