File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ coverage:
33 patch :
44 default :
55 target : auto
6+ informational : true
67 project :
78 default :
89 target : auto
Original file line number Diff line number Diff line change 66class Numcodec (Protocol ):
77 """
88 A protocol that models the ``numcodecs.abc.Codec`` interface.
9+
10+ This protocol should be considered experimental; expect the typing for `buf`, and `out` to become stricter.
911 """
1012
1113 codec_id : str
1214
1315 def encode (self , buf : Any ) -> Any : ...
16+ """Encode data in `buf`.
17+
18+ Parameters
19+ ----------
20+ buf
21+ Data to be encoded. May be any object supporting the new-style
22+ buffer protocol.
23+
24+ Returns
25+ -------
26+ enc
27+ Encoded data. May be any object supporting the new-style buffer
28+ protocol.
29+ """
1430
1531 def decode (self , buf : Any , out : Any | None = None ) -> Any : ...
32+ """
33+ Decode data in `buf`.
34+
35+ Parameters
36+ ----------
37+ buf : Any
38+ Encoded data. May be any object supporting the new-style buffer
39+ protocol.
40+ out : Any
41+ Writeable buffer to store decoded data. N.B. if provided, this buffer must
42+ be exactly the right size to store the decoded data.
43+
44+ Returns
45+ -------
46+ dec : Any
47+ Decoded data. May be any object supporting the new-style
48+ buffer protocol.
49+ """
1650
1751 def get_config (self ) -> Any : ...
52+ """
53+ Return a dictionary holding configuration parameters for this
54+ codec. Must include an 'id' field with the codec identifier. All
55+ values must be compatible with JSON encoding.
56+ """
1857
1958 @classmethod
2059 def from_config (cls , config : Any ) -> Self : ...
60+ """
61+ Instantiate codec from a configuration object.
62+ """
2163
2264
2365def _is_numcodec_cls (obj : object ) -> TypeGuard [type [Numcodec ]]:
You can’t perform that action at this time.
0 commit comments