Skip to content

Commit

Permalink
add changes from black
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-marshall-amp committed Jul 21, 2024
1 parent 7b574bc commit b62ef01
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ repos:
rev: 24.4.2
hooks:
- id: black

1 change: 1 addition & 0 deletions src/fixate/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Drivers are hard coded into the config to prevent issues arising from auto discovery
Must ensure driver imports are infallible to prevent program crash on start
"""

from fixate.config.helper import (
load_dict_config,
load_yaml_config,
Expand Down
1 change: 1 addition & 0 deletions src/fixate/core/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module is used to allow for tests to test values against criteria.
It should implement necessary logging functions and report success or failure.
"""

from dataclasses import dataclass, field
from typing import Any, Callable, Iterable, Optional
import logging
Expand Down
1 change: 1 addition & 0 deletions src/fixate/core/ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module details user input api
"""

import time
from queue import Queue, Empty
from pubsub import pub
Expand Down
1 change: 1 addition & 0 deletions src/fixate/drivers/daq/daqmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h
"""

from collections import namedtuple
from fixate.core.common import ExcThread
from queue import Queue, Empty
Expand Down
1 change: 1 addition & 0 deletions src/fixate/drivers/dmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
dmm.measure(*mode, **mode_params)
dmm.reset()
"""

import pyvisa

import fixate.drivers
Expand Down
1 change: 1 addition & 0 deletions src/fixate/drivers/funcgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
output_ch3
output_ch4
"""

import pyvisa

import fixate.drivers
Expand Down
1 change: 1 addition & 0 deletions src/fixate/drivers/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module implements concrete AddressHandler type, that
can be used to implement IO for the fixate.core.switching module.
"""

from __future__ import annotations

from typing import Sequence, Optional
Expand Down
1 change: 1 addition & 0 deletions src/fixate/drivers/lcr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Functions are dictated by the metaclass in helper.py
"""

import pyvisa

import fixate.drivers
Expand Down
6 changes: 3 additions & 3 deletions src/fixate/drivers/pps/bk_178x.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def _packet_encode(self, command, *data_tuples):
packet[2] = command
packet_index = 3
for data, num_bytes in data_tuples:
packet[
packet_index : packet_index + num_bytes
] = self._little_endian_encode(data)[0:num_bytes]
packet[packet_index : packet_index + num_bytes] = (
self._little_endian_encode(data)[0:num_bytes]
)
packet_index += num_bytes
if packet_index >= self.PACKET_LENGTH:
raise ValueError("Too many bytes to pack into packet")
Expand Down
1 change: 1 addition & 0 deletions src/fixate/examples/function_generator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Examples on how to use the function generator driver
"""

import time

from fixate.core.common import TestClass, TestList
Expand Down
1 change: 1 addition & 0 deletions src/fixate/examples/jig_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This file is just a test playground that shows how the update jig classes will
fit together.
"""

from __future__ import annotations
from dataclasses import dataclass, field
from fixate import (
Expand Down
1 change: 1 addition & 0 deletions src/fixate/examples/programmable_power_supply.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Examples on how to use the programmable power supply driver works
"""

import time

from fixate.core.common import TestClass, TestList
Expand Down
1 change: 1 addition & 0 deletions src/fixate/examples/test_script.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This is a test script that shows basic use case for the fixate library
"""

from fixate.core.common import TestClass, TestList
from fixate.core.checks import *
from fixate.core.ui import *
Expand Down
1 change: 1 addition & 0 deletions src/fixate/reporting/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
Test End
<Time Elapsed (s)>,Test <index>,end,<PASS FAIL ERROR>,checks-passed=<passed>,checks-failed<failed>,checks-error=<errors>
"""

import csv
import datetime
import sys
Expand Down
3 changes: 2 additions & 1 deletion src/fixate/sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ def retry_prompt(self):
"""Prompt the user when something goes wrong.
For retry return True, to fail return False and to abort raise and abort exception. Respect the
non_interactive flag, which can be set by the command line option --non-interactive"""
non_interactive flag, which can be set by the command line option --non-interactive
"""

if self.non_interactive:
return False
Expand Down
4 changes: 1 addition & 3 deletions test/drivers/test_keysight_DSOX1102G.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,7 @@ def test_measure_vrms_dc_cycle(dso, funcgen, rm):
dso.stop()
funcgen.channel1(False)

assert measured_vrms_cycle == pytest.approx(
(vrms**2 + offset**2) ** 0.5, abs=0.05
)
assert measured_vrms_cycle == pytest.approx((vrms**2 + offset**2) ** 0.5, abs=0.05)


@pytest.mark.drivertest
Expand Down
1 change: 1 addition & 0 deletions test/manual/test_serial_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Make sure local_config.json has been configured to include the required instruments
"""

from pubsub import pub
from fixate.drivers import dmm, lcr, dso, funcgen, pps
import time
Expand Down

0 comments on commit b62ef01

Please sign in to comment.