summaryrefslogtreecommitdiff
path: root/numpy/lib/format.pyi
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-04-25 14:17:42 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-04-26 16:41:04 +0200
commitbb34344242097b95db2be2e938c0ce14db225db3 (patch)
tree66924ba276a0d8e3613c75c1dcde29936a6fa79f /numpy/lib/format.pyi
parent775d243be65f36564580ed5fcf038f384c61ce4d (diff)
downloadnumpy-bb34344242097b95db2be2e938c0ce14db225db3.tar.gz
ENH: Add improved placeholder annotations for `np.lib`
Diffstat (limited to 'numpy/lib/format.pyi')
-rw-r--r--numpy/lib/format.pyi28
1 files changed, 28 insertions, 0 deletions
diff --git a/numpy/lib/format.pyi b/numpy/lib/format.pyi
new file mode 100644
index 000000000..4c44d57bf
--- /dev/null
+++ b/numpy/lib/format.pyi
@@ -0,0 +1,28 @@
+import sys
+from typing import Any, List, Set
+
+if sys.version_info >= (3, 8):
+ from typing import Literal, Final
+else:
+ from typing_extensions import Literal, Final
+
+__all__: List[str]
+
+EXPECTED_KEYS: Final[Set[str]]
+MAGIC_PREFIX: Final[bytes]
+MAGIC_LEN: Literal[8]
+ARRAY_ALIGN: Literal[64]
+BUFFER_SIZE: Literal[262144] # 2**18
+
+def magic(major, minor): ...
+def read_magic(fp): ...
+def dtype_to_descr(dtype): ...
+def descr_to_dtype(descr): ...
+def header_data_from_array_1_0(array): ...
+def write_array_header_1_0(fp, d): ...
+def write_array_header_2_0(fp, d): ...
+def read_array_header_1_0(fp): ...
+def read_array_header_2_0(fp): ...
+def write_array(fp, array, version=..., allow_pickle=..., pickle_kwargs=...): ...
+def read_array(fp, allow_pickle=..., pickle_kwargs=...): ...
+def open_memmap(filename, mode=..., dtype=..., shape=..., fortran_order=..., version=...): ...