Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 73 additions & 75 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/nitypes/_numpy1x.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


def asarray( # noqa: D103 - missing docstring in public function
a: npt.ArrayLike, dtype: npt.DTypeLike = None, *, copy: builtins.bool | None = None
a: npt.ArrayLike, dtype: npt.DTypeLike | None = None, *, copy: builtins.bool | None = None
) -> npt.NDArray[Any]:
b = np.asarray(a, dtype)
made_copy = b is not a and b.base is None
Expand Down
12 changes: 6 additions & 6 deletions src/nitypes/waveform/_analog.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def from_array_1d(
def from_array_1d(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -270,7 +270,7 @@ def from_array_1d(
def from_array_1d( # pyright: ignore[reportIncompatibleMethodOverride]
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -341,7 +341,7 @@ def from_array_2d(
def from_array_2d(
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -356,7 +356,7 @@ def from_array_2d(
def from_array_2d( # pyright: ignore[reportIncompatibleMethodOverride]
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -448,7 +448,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa)
self: AnalogWaveform[Any],
sample_count: SupportsIndex | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
raw_data: npt.NDArray[Any] | None = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -462,7 +462,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
raw_data: npt.NDArray[Any] | None = None,
start_index: SupportsIndex | None = None,
Expand Down
12 changes: 6 additions & 6 deletions src/nitypes/waveform/_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def from_array_1d(
def from_array_1d(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -174,7 +174,7 @@ def from_array_1d(
def from_array_1d( # pyright: ignore[reportIncompatibleMethodOverride]
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -245,7 +245,7 @@ def from_array_2d(
def from_array_2d(
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -260,7 +260,7 @@ def from_array_2d(
def from_array_2d( # pyright: ignore[reportIncompatibleMethodOverride]
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -352,7 +352,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa)
self: ComplexWaveform[Any],
sample_count: SupportsIndex | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
raw_data: npt.NDArray[Any] | None = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -366,7 +366,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
raw_data: npt.NDArray[Any] | None = None,
start_index: SupportsIndex | None = None,
Expand Down
8 changes: 4 additions & 4 deletions src/nitypes/waveform/_digital/_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def port_to_line_data(
if bitorder != sys.byteorder and port_data.dtype.itemsize > 1:
port_data = port_data.byteswap()

line_data = np.unpackbits(port_data.view(np.uint8), bitorder=bitorder)
line_data = line_data.reshape(len(port_data), port_size)
line_data_1d = np.unpackbits(port_data.view(np.uint8), bitorder=bitorder)
line_data_2d = line_data_1d.reshape(len(port_data), port_size)

if mask == bit_mask(port_size):
return line_data
return line_data_2d
else:
return line_data[:, _mask_to_column_indices(mask, port_size, bitorder)]
return line_data_2d[:, _mask_to_column_indices(mask, port_size, bitorder)]


def _mask_to_column_indices(
Expand Down
20 changes: 10 additions & 10 deletions src/nitypes/waveform/_digital/_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def from_lines(
def from_lines(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -337,7 +337,7 @@ def from_lines(
def from_lines(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -433,7 +433,7 @@ def from_port(
cls,
array: npt.NDArray[Any] | Sequence[Any],
mask: SupportsIndex | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
bitorder: Literal["big", "little"] = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -447,7 +447,7 @@ def from_port(
cls,
array: npt.NDArray[Any] | Sequence[Any],
mask: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
bitorder: Literal["big", "little"] = "big",
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -575,7 +575,7 @@ def from_ports(
cls,
array: npt.NDArray[Any] | Sequence[Any],
masks: Sequence[SupportsIndex] | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
bitorder: Literal["big", "little"] = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -589,7 +589,7 @@ def from_ports(
cls,
array: npt.NDArray[Any] | Sequence[Any],
masks: Sequence[SupportsIndex] | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
bitorder: Literal["big", "little"] = "big",
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -765,7 +765,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
self: DigitalWaveform[Any],
sample_count: SupportsIndex | None = ...,
signal_count: SupportsIndex | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
default_value: bool | int | DigitalState | None = ...,
*,
data: npt.NDArray[Any] | None = ...,
Expand All @@ -780,7 +780,7 @@ def __init__(
self,
sample_count: SupportsIndex | None = None,
signal_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
default_value: bool | int | DigitalState | None = None,
*,
data: npt.NDArray[Any] | None = None,
Expand Down Expand Up @@ -860,7 +860,7 @@ def _init_with_new_array(
self,
sample_count: SupportsIndex | None = None,
signal_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
default_value: bool | int | DigitalState | None = None,
*,
start_index: SupportsIndex | None = None,
Expand Down Expand Up @@ -895,7 +895,7 @@ def _init_with_new_array(
def _init_with_provided_array(
self,
data: npt.NDArray[TDigitalState],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = None,
sample_count: SupportsIndex | None = None,
Expand Down
12 changes: 6 additions & 6 deletions src/nitypes/waveform/_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _get_supported_scaled_dtypes() -> tuple[npt.DTypeLike, ...]:
def from_array_1d(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -147,7 +147,7 @@ def from_array_1d(
def from_array_2d(
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -221,7 +221,7 @@ def from_array_2d(
def __init__(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
raw_data: npt.NDArray[_TRaw] | None = None,
start_index: SupportsIndex | None = None,
Expand Down Expand Up @@ -284,7 +284,7 @@ def __init__(
def _init_with_new_array(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = None,
capacity: SupportsIndex | None = None,
Expand All @@ -311,7 +311,7 @@ def _init_with_new_array(
def _init_with_provided_array(
self,
data: npt.NDArray[_TRaw],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = None,
sample_count: SupportsIndex | None = None,
Expand Down Expand Up @@ -420,7 +420,7 @@ def get_scaled_data( # noqa: D107 - Missing docstring in __init__ (auto-generat

def get_scaled_data(
self,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = 0,
sample_count: SupportsIndex | None = None,
Expand Down
16 changes: 8 additions & 8 deletions src/nitypes/waveform/_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def from_array_1d(
def from_array_1d(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -153,7 +153,7 @@ def from_array_1d(
def from_array_1d(
cls,
array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -235,7 +235,7 @@ def from_array_2d(
def from_array_2d(
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
copy: bool = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -249,7 +249,7 @@ def from_array_2d(
def from_array_2d(
cls,
array: npt.NDArray[Any] | Sequence[Sequence[Any]],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
copy: bool = True,
start_index: SupportsIndex | None = 0,
Expand Down Expand Up @@ -370,7 +370,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa)
self: Spectrum[Any],
sample_count: SupportsIndex | None = ...,
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
data: npt.NDArray[Any] | None = ...,
start_index: SupportsIndex | None = ...,
Expand All @@ -384,7 +384,7 @@ def __init__( # noqa: D107 - Missing docstring in __init__ (auto-generated noqa
def __init__(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
data: npt.NDArray[Any] | None = None,
start_index: SupportsIndex | None = None,
Expand Down Expand Up @@ -442,7 +442,7 @@ def __init__(
def _init_with_new_array(
self,
sample_count: SupportsIndex | None = None,
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = None,
capacity: SupportsIndex | None = None,
Expand All @@ -469,7 +469,7 @@ def _init_with_new_array(
def _init_with_provided_array(
self,
data: npt.NDArray[_TData],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
start_index: SupportsIndex | None = None,
sample_count: SupportsIndex | None = None,
Expand Down
6 changes: 3 additions & 3 deletions src/nitypes/xy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def from_arrays_1d(
cls,
x_array: npt.NDArray[Any] | Sequence[Any],
y_array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = ...,
dtype: npt.DTypeLike | None = ...,
*,
x_units: str = ...,
y_units: str = ...,
Expand All @@ -140,7 +140,7 @@ def from_arrays_1d(
cls,
x_array: npt.NDArray[Any] | Sequence[Any],
y_array: npt.NDArray[Any] | Sequence[Any],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
*,
x_units: str = "",
y_units: str = "",
Expand Down Expand Up @@ -264,7 +264,7 @@ def _init_with_provided_arrays(
self,
x_data: npt.NDArray[TData],
y_data: npt.NDArray[TData],
dtype: npt.DTypeLike = None,
dtype: npt.DTypeLike | None = None,
) -> None:
if not isinstance(x_data, np.ndarray):
raise invalid_arg_type("x-axis input array", "one-dimensional array", x_data)
Expand Down
Loading