Skip to content

Commit

Permalink
Merge pull request #232 from ap--/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
ap-- committed Jan 29, 2024
2 parents 64afcaa + 2928a8f commit 0be9fcb
Show file tree
Hide file tree
Showing 18 changed files with 170 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: '23.12.1'
rev: '24.1.1'
hooks:
- id: black
language_version: python3
Expand Down
1 change: 1 addition & 0 deletions dev/pretty_print_obp_pcapng.py
@@ -1,4 +1,5 @@
"""pretty print pcapng files"""

from __future__ import annotations

import enum
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -8,6 +8,7 @@
Email: andreas@poehlmann.io
"""

import logging
import os
import platform
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/__init__.py
Expand Up @@ -48,6 +48,7 @@
requires installing the drivers
"""

from seabreeze._version import __version__ as _version
from seabreeze.backends import use

Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/_cli.py
Expand Up @@ -18,6 +18,7 @@
author: Andreas Poehlmann
"""

import itertools
import operator
from importlib import import_module
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/cseabreeze/__init__.py
@@ -1,6 +1,7 @@
"""This is a wrapper for the c-implementation of the seabreeze-library
"""

# noinspection PyProtectedMember
from seabreeze.cseabreeze._wrapper import SeaBreezeAcquisitionDelayFeature
from seabreeze.cseabreeze._wrapper import SeaBreezeAPI
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/__init__.py
@@ -1,6 +1,7 @@
"""This is a wrapper for the pyusb-implementation of the seabreeze-library
"""

from seabreeze.pyseabreeze.api import SeaBreezeAPI
from seabreeze.pyseabreeze.devices import SeaBreezeDevice
from seabreeze.pyseabreeze.exceptions import SeaBreezeError
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/api.py
Expand Up @@ -6,6 +6,7 @@
http://github.com/ap--/python-oceanoptics
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/config.py
@@ -1,4 +1,5 @@
"""modify some behavior of pyseabreeze"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/devices.py
Expand Up @@ -2,6 +2,7 @@
Author: Andreas Poehlmann
"""

from __future__ import annotations

import enum
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/exceptions.py
@@ -1,4 +1,5 @@
"""custom seabreeze exceptions"""

# DO NOT DIRECTLY IMPORT EXCEPTIONS FROM HERE!
# ALWAYS IMPORT FROM `seabreeze.spectrometers`

Expand Down
6 changes: 3 additions & 3 deletions src/seabreeze/pyseabreeze/features/fpga.py
Expand Up @@ -15,9 +15,9 @@ class _FPGARegisterFeatureOOI:

class Codes(enum.IntEnum):
FIRMWARE_VERSION = 0x04
V1_CONTINUOUS_STROBE_TIMER_INTERVAL_DIVISOR = (
V3_CONTINUOUS_STROBE_TIMER_MSB
) = 0x08
V1_CONTINUOUS_STROBE_TIMER_INTERVAL_DIVISOR = V3_CONTINUOUS_STROBE_TIMER_MSB = (
0x08
)
V1_CONTINUOUS_STROBE_BASE_CLOCK_DIVISOR = V3_CONTINUOUS_STROBE_TIMER_LSB = 0x0C

def __init__(self, protocol: PySeaBreezeProtocol) -> None:
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/features/rawusb.py
Expand Up @@ -32,6 +32,7 @@ class SeaBreezeRawUSBBusAccessFeature(SeaBreezeFeature):
# extract by providing the data format from the developer datasheet and `output` to struct.unpack
"""

identifier = "raw_usb_bus_access"
_required_protocol_cls = PySeaBreezeProtocol

Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/protocol.py
Expand Up @@ -5,6 +5,7 @@
- the other one 'OOI protocol' # ??? OceanOpticsInterface ??? maybe
"""

from __future__ import annotations

import functools
Expand Down
1 change: 1 addition & 0 deletions src/seabreeze/pyseabreeze/transport.py
Expand Up @@ -3,6 +3,7 @@
Some spectrometers can support different transports (usb, network, rs232, etc.)
"""

from __future__ import annotations

import importlib
Expand Down
24 changes: 8 additions & 16 deletions src/seabreeze/pyseabreeze/types.py
Expand Up @@ -25,17 +25,15 @@ def send(
payload: tuple[int | str | float, ...] | str | int | float = (),
timeout_ms: int | None = None,
**kwargs: Any,
) -> int:
...
) -> int: ...

@abstractmethod
def receive(
self,
size: int | None = None,
timeout_ms: int | None = None,
**kwargs: Any,
) -> bytes:
...
) -> bytes: ...

@abstractmethod
def query(
Expand All @@ -44,8 +42,7 @@ def query(
payload: tuple[int | str | float, ...] | str | int | float = (),
timeout_ms: int | None = None,
**kwargs: Any,
) -> bytes:
...
) -> bytes: ...


DT = TypeVar("DT")
Expand Down Expand Up @@ -102,23 +99,19 @@ def read(

@property
@abstractmethod
def default_timeout_ms(self) -> int:
...
def default_timeout_ms(self) -> int: ...

@property
@abstractmethod
def protocol(self) -> PySeaBreezeProtocol:
...
def protocol(self) -> PySeaBreezeProtocol: ...

@classmethod
@abstractmethod
def list_devices(cls) -> Iterable[DT]:
...
def list_devices(cls) -> Iterable[DT]: ...

@classmethod
@abstractmethod
def register_model(cls, model_name: str, **kwargs: str) -> None:
...
def register_model(cls, model_name: str, **kwargs: str) -> None: ...

@classmethod
@abstractmethod
Expand All @@ -135,5 +128,4 @@ def supported_model(cls, device: DT) -> str | None:
@abstractmethod
def specialize(
cls, model_name: str, **kwargs: str
) -> type[PySeaBreezeTransport[Any]]:
...
) -> type[PySeaBreezeTransport[Any]]: ...
1 change: 1 addition & 0 deletions src/seabreeze/spectrometers.py
Expand Up @@ -6,6 +6,7 @@
Email: andreas@poehlmann.io
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down

0 comments on commit 0be9fcb

Please sign in to comment.