Skip to content

Commit 864bfa3

Browse files
committed
generated: Regenerate code
1 parent 7709d2b commit 864bfa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2073
-1917
lines changed

generated/nidaqmx/__init__.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
from nidaqmx.errors import DaqError, DaqReadError, DaqWriteError, DaqWarning, DaqResourceWarning
2-
from nidaqmx.grpc_session_options import *
1+
"""The NI-DAQmx API for Python."""
2+
3+
from nidaqmx.errors import (
4+
DaqError,
5+
DaqReadError,
6+
DaqResourceWarning,
7+
DaqWarning,
8+
DaqWriteError,
9+
)
10+
from nidaqmx.grpc_session_options import * # noqa: F403 - 'from nidaqmx.grpc_session_options import *' used; unable to detect undefined names (auto-generated noqa)
311
from nidaqmx.scale import Scale
412
from nidaqmx.task import Task
513
from nidaqmx.types import CtrFreq, CtrTick, CtrTime
@@ -11,7 +19,13 @@
1119

1220
__version__ = version(__name__)
1321

14-
__all__ = ["errors", "scale", "stream_readers", "stream_writers", "task"]
22+
__all__ = [ # noqa: F405 - 'errors' may be undefined, or defined from star imports: nidaqmx.grpc_session_options (auto-generated noqa)
23+
"errors",
24+
"scale",
25+
"stream_readers",
26+
"stream_writers",
27+
"task",
28+
]
1529

1630
# Do not add a null logging handler. If the application has not configured logging, the
1731
# default behavior is to log warnings and errors to stderr.

generated/nidaqmx/__main__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
"""'nidaqmx' command line utility."""
2+
13
from __future__ import annotations
24

35
import logging
4-
from typing import Optional
56

67
import click
78

@@ -16,12 +17,14 @@
1617
count=True,
1718
help="Enable verbose logging. Repeat to increase verbosity.",
1819
)
19-
def main(verbosity: int) -> None:
20+
def main( # noqa: D103 - Missing docstring in public function (auto-generated noqa)
21+
verbosity: int,
22+
) -> None:
2023
_configure_logging(verbosity)
2124

2225

2326
@main.command()
24-
def installdriver():
27+
def installdriver(): # noqa: D103 - Missing docstring in public function (auto-generated noqa)
2528
_install_daqmx.installdriver()
2629

2730

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
1-
def enum_bitfield_to_list(bitfield_value, bitfield_enum_type,
2-
actual_enum_type):
3-
"""
4-
Converts a bitfield value to a list of enums.
1+
def enum_bitfield_to_list(bitfield_value, bitfield_enum_type, actual_enum_type):
2+
"""Converts a bitfield value to a list of enums.
53
64
Args:
75
bitfield_value (int): Specifies the value of the bitfield.
86
bitfield_enum_type (enum.Enum): Specifies the bitfield enum type
97
from which to mask and extract the enum values.
108
actual_enum_type (enum.Enum): Specifies the actual enum type.
9+
1110
Returns:
1211
List[enum.Enum]: Indicates the converted list of enums.
1312
"""
1413
supported_values = []
1514
for bitfield_mask in bitfield_enum_type:
1615
if bitfield_value & bitfield_mask.value:
17-
enum_value = next(
18-
e for e in actual_enum_type if e.name == bitfield_mask.name)
16+
enum_value = next(e for e in actual_enum_type if e.name == bitfield_mask.name)
1917
supported_values.append(enum_value)
2018

2119
return supported_values
2220

2321

2422
def enum_list_to_bitfield(enum_list, bitfield_enum_type):
25-
"""
26-
Converts a list of enums to a bitfield value.
23+
"""Converts a list of enums to a bitfield value.
2724
2825
Args:
2926
enum_list (List[enum.Enum]): Specifies the list of enums.
3027
bitfield_enum_type (enum.Enum): Specifies the bitfield enum type
3128
from which to mask and extract the enum values.
29+
3230
Returns:
3331
int: Indicates the value of the bitfield.
3432
"""
3533
bitfield_value = 0
3634
for enum_value in enum_list:
37-
bitfield_mask = next(
38-
b for b in bitfield_enum_type if b.name == enum_value.name)
35+
bitfield_mask = next(b for b in bitfield_enum_type if b.name == enum_value.name)
3936
bitfield_value |= bitfield_mask.value
4037

41-
return bitfield_value
38+
return bitfield_value

generated/nidaqmx/_dotenvpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ def _get_package_path() -> Path:
7070
"""Get the path of this package."""
7171
module = sys.modules[__package__]
7272
assert module.__file__ and module.__file__.endswith("__init__.py")
73-
return Path(module.__file__).parent
73+
return Path(module.__file__).parent

generated/nidaqmx/_feature_toggles.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
import functools
66
import sys
7-
from decouple import AutoConfig, Undefined, undefined
87
from enum import Enum
98
from typing import TYPE_CHECKING, Callable, TypeVar
9+
10+
from decouple import AutoConfig, Undefined, undefined
11+
1012
from nidaqmx._dotenvpath import get_dotenv_search_path
1113
from nidaqmx.errors import FeatureNotSupportedError
1214

@@ -36,6 +38,7 @@ def _config(
3638
cast: Callable[[str], _T] | Undefined = undefined,
3739
) -> _T: ...
3840

41+
3942
# Based on the recipe at https://docs.python.org/3/howto/enum.html
4043
class _OrderedEnum(Enum):
4144
def __ge__(self, other: Self) -> bool:
@@ -156,4 +159,4 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _T:
156159
# Define feature toggle constants here:
157160
# --------------------------------------
158161

159-
WAVEFORM_SUPPORT = FeatureToggle("WAVEFORM_SUPPORT", CodeReadiness.INCOMPLETE)
162+
WAVEFORM_SUPPORT = FeatureToggle("WAVEFORM_SUPPORT", CodeReadiness.INCOMPLETE)

generated/nidaqmx/_grpc_time.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
from __future__ import annotations
22

3-
from datetime import timezone
4-
from datetime import datetime as std_datetime
5-
from datetime import tzinfo as dt_tzinfo
6-
from hightime import datetime as ht_datetime
7-
from hightime import timedelta as ht_timedelta
8-
from typing import Optional, Union
9-
from nidaqmx._time import _convert_to_desired_timezone
3+
from datetime import datetime as std_datetime, timezone, tzinfo as dt_tzinfo
104

115
from google.protobuf.timestamp_pb2 import Timestamp as GrpcTimestamp
6+
from hightime import datetime as ht_datetime, timedelta as ht_timedelta
7+
8+
from nidaqmx._time import _convert_to_desired_timezone
129

1310
# 66 years, 17 leap days = 24107 days = 2082844800 seconds
1411
_BIAS_FROM_1970_EPOCH = 2082844800
@@ -22,7 +19,10 @@
2219

2320
_EPOCH_1970 = ht_datetime(1970, 1, 1, tzinfo=timezone.utc)
2421

25-
def convert_time_to_timestamp(dt: std_datetime | ht_datetime, ts: GrpcTimestamp | None = None) -> GrpcTimestamp:
22+
23+
def convert_time_to_timestamp( # noqa: D103 - Missing docstring in public function (auto-generated noqa)
24+
dt: std_datetime | ht_datetime, ts: GrpcTimestamp | None = None
25+
) -> GrpcTimestamp:
2626
seconds_since_1970 = 0
2727

2828
if ts is None:
@@ -44,10 +44,13 @@ def convert_time_to_timestamp(dt: std_datetime | ht_datetime, ts: GrpcTimestamp
4444
ts.FromNanoseconds(seconds_since_1970 * _NS_PER_S + nanos)
4545
return ts
4646

47-
def convert_timestamp_to_time(ts: GrpcTimestamp, tzinfo: dt_tzinfo | None = None) -> ht_datetime:
47+
48+
def convert_timestamp_to_time( # noqa: D103 - Missing docstring in public function (auto-generated noqa)
49+
ts: GrpcTimestamp, tzinfo: dt_tzinfo | None = None
50+
) -> ht_datetime:
4851
total_nanos = ts.ToNanoseconds()
4952
seconds, nanos = divmod(total_nanos, _NS_PER_S)
5053
# Convert the nanoseconds to yoctoseconds.
5154
total_yoctoseconds = int(round(_YS_PER_NS * nanos))
52-
dt = _EPOCH_1970 + ht_timedelta(seconds = seconds) + ht_timedelta(yoctoseconds=total_yoctoseconds)
55+
dt = _EPOCH_1970 + ht_timedelta(seconds=seconds) + ht_timedelta(yoctoseconds=total_yoctoseconds)
5356
return _convert_to_desired_timezone(dt, tzinfo)

0 commit comments

Comments
 (0)