diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00236c7..8d11e40 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,18 +35,18 @@ repos: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: "v3.15.0" + rev: "v3.15.2" hooks: - id: pyupgrade args: ["--py38-plus"] - repo: https://github.com/psf/black - rev: "23.12.1" + rev: "24.3.0" hooks: - id: black-jupyter - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.8.0" + rev: "v1.9.0" hooks: - id: mypy files: src @@ -59,7 +59,7 @@ repos: args: ["--all"] - repo: https://github.com/PyCQA/flake8 - rev: "6.1.0" + rev: "7.0.0" hooks: - id: flake8 additional_dependencies: [ @@ -69,7 +69,7 @@ repos: ] - repo: https://github.com/kynan/nbstripout - rev: "0.6.1" + rev: "0.7.1" hooks: - id: nbstripout args: ["--drop-empty-cells", @@ -88,7 +88,7 @@ repos: args: ["-L", "nd,unparseable,compiletime"] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: "v0.9.0.6" + rev: "v0.10.0.1" hooks: - id: shellcheck diff --git a/src/daq2lh5/cli.py b/src/daq2lh5/cli.py index 59b9bc8..0a9474c 100644 --- a/src/daq2lh5/cli.py +++ b/src/daq2lh5/cli.py @@ -1,4 +1,5 @@ """legend-daq2lh5's command line interface utilities.""" + from __future__ import annotations import argparse diff --git a/src/daq2lh5/data_decoder.py b/src/daq2lh5/data_decoder.py index 7d1934c..b784e9f 100644 --- a/src/daq2lh5/data_decoder.py +++ b/src/daq2lh5/data_decoder.py @@ -1,6 +1,7 @@ """ Base classes for decoding data into raw LGDO Tables or files """ + from __future__ import annotations import lgdo diff --git a/src/daq2lh5/data_streamer.py b/src/daq2lh5/data_streamer.py index b6ab386..f7277ce 100644 --- a/src/daq2lh5/data_streamer.py +++ b/src/daq2lh5/data_streamer.py @@ -1,6 +1,7 @@ """ Base classes for streaming data. """ + from __future__ import annotations import fnmatch diff --git a/src/daq2lh5/logging.py b/src/daq2lh5/logging.py index 8271dc0..7c494ba 100644 --- a/src/daq2lh5/logging.py +++ b/src/daq2lh5/logging.py @@ -1,4 +1,5 @@ """This module implements some helpers for setting up logging.""" + import logging import colorlog diff --git a/src/daq2lh5/orca/orca_flashcam.py b/src/daq2lh5/orca/orca_flashcam.py index d3871a0..a556c27 100644 --- a/src/daq2lh5/orca/orca_flashcam.py +++ b/src/daq2lh5/orca/orca_flashcam.py @@ -421,13 +421,13 @@ def decode_packet( (fd0 + i_card) * 5 + j ] = packet[i_cd + 14 + j] for j in range(5): - tbl["card_temps"].flattened_data.nda[ - (fd0 + i_card) * 5 + j - ] = int_packet[i_cd + 19 + j] + tbl["card_temps"].flattened_data.nda[(fd0 + i_card) * 5 + j] = ( + int_packet[i_cd + 19 + j] + ) for j in range(6): - tbl["card_voltages"].flattened_data.nda[ - (fd0 + i_card) * 6 + j - ] = int_packet[i_cd + 24 + j] + tbl["card_voltages"].flattened_data.nda[(fd0 + i_card) * 6 + j] = ( + int_packet[i_cd + 24 + j] + ) tbl["card_main_current"].flattened_data.nda[fd0 + i_card] = int_packet[ i_cd + 30 ] @@ -435,14 +435,14 @@ def decode_packet( i_cd + 31 ] for j in range(2): - tbl["card_adc_temps"].flattened_data.nda[ - (fd0 + i_card) * 2 + j - ] = int_packet[i_cd + 32 + j] + tbl["card_adc_temps"].flattened_data.nda[(fd0 + i_card) * 2 + j] = ( + int_packet[i_cd + 32 + j] + ) # packet[34] is empty / dummy for j in range(4): - tbl["card_cti_links"].flattened_data.nda[ - (fd0 + i_card) * 4 + j - ] = packet[i_cd + 35 + j] + tbl["card_cti_links"].flattened_data.nda[(fd0 + i_card) * 4 + j] = ( + packet[i_cd + 35 + j] + ) for j in range(256): value = packet[i_cd + 39 + j] if j < n_link_states else 0 tbl["card_link_states"].flattened_data.nda[ diff --git a/src/daq2lh5/orca/orca_packet.py b/src/daq2lh5/orca/orca_packet.py index 2b0c94f..9160f22 100644 --- a/src/daq2lh5/orca/orca_packet.py +++ b/src/daq2lh5/orca/orca_packet.py @@ -4,6 +4,7 @@ An ORCA packet is represented by a one-dimensional :class:`numpy.ndarray` of type :class:`numpy.uint32`. """ + from __future__ import annotations import logging diff --git a/src/daq2lh5/raw_buffer.py b/src/daq2lh5/raw_buffer.py index 6cfe5fd..ac45122 100644 --- a/src/daq2lh5/raw_buffer.py +++ b/src/daq2lh5/raw_buffer.py @@ -62,6 +62,7 @@ } } """ + from __future__ import annotations import os