Skip to content

Commit 71e213e

Browse files
committed
Adding help for type definitions.
1 parent 49d628f commit 71e213e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pyttb/pyttb_utils.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,20 @@
2727
import pyttb as ttb
2828

2929
Shape = Union[int, Iterable[int]]
30+
"""Shape represents the object size or dimensions. It can be specified as
31+
either a single integer or an iterable of integers, which will be normalized
32+
to a tuple internally."""
33+
3034
OneDArray = Union[int, float, Iterable[int], Iterable[float], np.ndarray]
31-
MemoryLayout = Union[Literal["F"], Literal["C"]]
35+
"""OneDArray represents any one-dimensional array, which can be a single
36+
integer or float, and iterable of integerss or floats, or a NumPy array."""
3237

38+
MemoryLayout = Union[Literal["F"], Literal["C"]]
39+
"""MemoryLayout is the set of options for the layout of a tensor.
40+
It can be "F", meaning Fortran ordered and analogous to column-major for matrices,
41+
or "C", meaning C ordered and analogous to row-major for matrices.
42+
Order "F" is how tensors are stored in MATLAB, and order "C" is the default
43+
for NumPy arrays."""
3344

3445
def tt_union_rows(MatrixA: np.ndarray, MatrixB: np.ndarray) -> np.ndarray:
3546
"""Reproduce functionality of MATLABS intersect(a,b,'rows').

0 commit comments

Comments
 (0)