Skip to content

Commit

Permalink
Re-run ni-python-styleguide on examples (#600)
Browse files Browse the repository at this point in the history
* Update game of life style

* Fix DAQmx example

* Fix examples
  • Loading branch information
dixonjoel authored Jan 29, 2024
1 parent bb1ce67 commit 009b783
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions examples/game_of_life/measurement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Source the XY data for Conway's Game of Life."""

import pathlib
import random
import threading
Expand Down
1 change: 1 addition & 0 deletions examples/nidaqmx_analog_input/teststand_nidaqmx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-DAQmx devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-DCPower devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
5 changes: 4 additions & 1 deletion examples/nidigital_spi/teststand_nidigital.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI Digital Pattern instruments in NI TestStand."""

from typing import Any, Iterable

from _helpers import TestStandSupport
Expand All @@ -10,7 +11,9 @@
SessionInitializationBehavior,
SessionManagementClient,
)
from ni_measurementlink_service.session_management._reservation import MultiSessionReservation
from ni_measurementlink_service.session_management._reservation import (
MultiSessionReservation,
)


def create_nidigital_sessions(sequence_context: Any) -> None:
Expand Down
1 change: 1 addition & 0 deletions examples/nidmm_measurement/teststand_nidmm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-DMM devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
1 change: 1 addition & 0 deletions examples/nifgen_standard_function/teststand_nifgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-FGEN devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
1 change: 1 addition & 0 deletions examples/niscope_acquire_waveform/teststand_niscope.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-Scope devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
1 change: 1 addition & 0 deletions examples/niswitch_control_relays/teststand_niswitch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-Switch devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
8 changes: 2 additions & 6 deletions examples/nivisa_dmm_measurement/_visa_dmm.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
"""Custom instrument driver for MeasurementLink NI-VISA DMM examples."""

from __future__ import annotations

import pathlib
import sys
from enum import Enum
from types import TracebackType
from typing import (
TYPE_CHECKING,
Optional,
Type,
)
from typing import TYPE_CHECKING, Optional, Type

import pyvisa
import pyvisa.resources
import pyvisa.typing


if TYPE_CHECKING:
if sys.version_info >= (3, 11):
from typing import Self
Expand Down
1 change: 1 addition & 0 deletions examples/nivisa_dmm_measurement/teststand_nivisa_dmm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down NI-VISA DMM sessions in NI TestStand."""

import pathlib
from typing import Any

Expand Down
8 changes: 2 additions & 6 deletions examples/output_voltage_measurement/_visa_dmm.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
"""Custom instrument driver for MeasurementLink NI-VISA DMM examples."""

from __future__ import annotations

import pathlib
import sys
from enum import Enum
from types import TracebackType
from typing import (
TYPE_CHECKING,
Optional,
Type,
)
from typing import TYPE_CHECKING, Optional, Type

import pyvisa
import pyvisa.resources
import pyvisa.typing


if TYPE_CHECKING:
if sys.version_info >= (3, 11):
from typing import Self
Expand Down
1 change: 1 addition & 0 deletions examples/output_voltage_measurement/teststand_nidcpower.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down sessions of NI-DCPower devices in NI TestStand."""

from typing import Any

from _helpers import TestStandSupport
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to set up and tear down NI-VISA DMM sessions in NI TestStand."""

import pathlib
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions examples/sample_measurement/measurement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Perform a loopback measurement with various data types."""

import logging
import pathlib
import sys
Expand Down

0 comments on commit 009b783

Please sign in to comment.