Skip to content

Commit

Permalink
Merge pull request #21 from NTIA/drop-python-3.8
Browse files Browse the repository at this point in the history
Drop Python 3.8 support, add Python 3.13 support
  • Loading branch information
jhazentia authored Nov 8, 2024
2 parents c257bd5 + 1661c6c commit d145b0a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 29 deletions.
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
default_language_version:
python: python3.8
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-ast
types: [file, python]
Expand All @@ -16,10 +14,10 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
args: ["--py39-plus"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
Expand All @@ -28,12 +26,12 @@ repos:
types: [file, python]
args: ["--profile", "black", "--filter-files", "--gitignore"]
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
types: [file, python]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.40.0
rev: v0.42.0
hooks:
- id: markdownlint
types: [file, markdown]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ instead of using this wrapper.

## Installation

Requires `python>=3.8`, `numpy>=1.22`, and the Tektronix RSA API for Linux.
Requires `python>=3.9`, `numpy>=1.25`, and the Tektronix RSA API for Linux.

First, download and install the
[RSA API for Linux](https://www.tek.com/spectrum-analyzer/rsa306-software/rsa-application-programming-interface--api-for-64bit-linux--v100014)
Expand Down Expand Up @@ -128,7 +128,7 @@ as errors and handled as configured in `IQSTREAM_StatusParser`.

Set up a development environment using a tool like
[Conda](https://docs.conda.io/en/latest/)
or [venv](https://docs.python.org/3/library/venv.html#module-venv), with `python>=3.8`.
or [venv](https://docs.python.org/3/library/venv.html#module-venv).
Then, from the cloned directory, install the development dependencies by running:

```bash
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "tekrsa-api-wrap"
dynamic = ["version"]
description = "NTIA/ITS Python wrapper for the Tektronix RSA API for Linux"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = { file = "LICENSE.md" }

authors = [
Expand All @@ -31,22 +31,22 @@ classifiers = [
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

dependencies = [
"numpy>=1.22",
"numpy>=1.25",
]

[project.optional-dependencies]
dev = [
"hatchling>=1.6.0,<2.0",
"pre-commit>=2.20.0",
"twine>=4.0.1,<5.0",
"pre-commit>=4.0,<5.0",
"twine>=5.0,<6.0",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion src/rsa_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .rsa_api import *

__version__ = "1.3.3"
__version__ = "2.0.0"
28 changes: 14 additions & 14 deletions src/rsa_api/rsa_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from enum import Enum
from os.path import abspath, join
from time import sleep
from typing import Any, Tuple, Union
from typing import Any, Union

import numpy as np

Expand Down Expand Up @@ -1016,7 +1016,7 @@ def DEVICE_Stop(self) -> None:
"""
self.err_check(self.rsa.DEVICE_Stop())

def DEVICE_GetEventStatus(self, event_id: str) -> Tuple[bool, int]:
def DEVICE_GetEventStatus(self, event_id: str) -> tuple[bool, int]:
"""
Return global device real-time event status.
Expand Down Expand Up @@ -1057,7 +1057,7 @@ def DEVICE_GetEventStatus(self, event_id: str) -> Tuple[bool, int]:

# IQ BLOCK METHODS

def IQBLK_GetIQAcqInfo(self) -> Tuple[int, int, int, int]:
def IQBLK_GetIQAcqInfo(self) -> tuple[int, int, int, int]:
"""
Return IQ acquisition status info for the most recent IQ block.
Expand Down Expand Up @@ -1133,7 +1133,7 @@ def IQBLK_GetIQData(self, req_length: int) -> np.ndarray:

def IQBLK_GetIQDataDeinterleaved(
self, req_length: int
) -> Tuple[np.ndarray, np.ndarray]:
) -> tuple[np.ndarray, np.ndarray]:
"""
Retrieve an IQ block data record in separate I and Q array format.
Expand Down Expand Up @@ -1316,7 +1316,7 @@ def IQSTREAM_ClearAcqStatus(self) -> None:
"""
self.err_check(self.rsa.IQSTREAM_ClearAcqStatus())

def IQSTREAM_GetAcqParameters(self) -> Tuple[float, float]:
def IQSTREAM_GetAcqParameters(self) -> tuple[float, float]:
"""
Retrieve the processing parameters of IQ streaming output bandwidth
and sample rate, resulting from the user's requested bandwidth.
Expand Down Expand Up @@ -1394,7 +1394,7 @@ def IQSTREAM_GetDiskFileInfo(self) -> _IQStreamFileInfo:
self.err_check(self.rsa.IQSTREAM_GetDiskFileInfo(byref(file_info)))
return file_info

def IQSTREAM_GetDiskFileWriteStatus(self) -> Tuple[bool, bool]:
def IQSTREAM_GetDiskFileWriteStatus(self) -> tuple[bool, bool]:
"""
Allow monitoring the progress of file output.
Expand Down Expand Up @@ -1430,7 +1430,7 @@ def IQSTREAM_GetEnable(self) -> bool:

def IQSTREAM_GetIQData(
self, dtype: str, buffer_size: int
) -> Tuple[np.ndarray, int, _IQStreamIQInfo]:
) -> tuple[np.ndarray, int, _IQStreamIQInfo]:
"""
Retrieve interleaved IQ data generated by IQ Stream processing.
Expand Down Expand Up @@ -1761,7 +1761,7 @@ def SPECTRUM_GetSettings(self) -> dict:

def SPECTRUM_GetTrace(
self, trace: str, max_trace_points: int
) -> Tuple[np.ndarray, int]:
) -> tuple[np.ndarray, int]:
"""
Return the spectrum trace data.
Expand Down Expand Up @@ -1825,7 +1825,7 @@ def SPECTRUM_GetTraceInfo(self) -> dict:
}
return info_dict

def SPECTRUM_GetTraceType(self, trace: str) -> Tuple[bool, str]:
def SPECTRUM_GetTraceType(self, trace: str) -> tuple[bool, str]:
"""
Query the trace settings.
Expand Down Expand Up @@ -2211,7 +2211,7 @@ def DEVICE_SearchAndConnect(self, verbose: bool = False) -> None:

def IQSTREAM_Tempfile_NoConfig(
self, duration_msec: int, return_status: bool = False
) -> Union[np.ndarray, Tuple[np.ndarray, str]]:
) -> Union[np.ndarray, tuple[np.ndarray, str]]:
"""
Retrieve IQ data from device by first writing to a tempfile.
Does not perform any device configuration: only captures data.
Expand Down Expand Up @@ -2304,7 +2304,7 @@ def IQSTREAM_Tempfile(
bw: Union[float, int],
duration_msec: int,
return_status: bool = False,
) -> Union[np.ndarray, Tuple[np.ndarray, str]]:
) -> Union[np.ndarray, tuple[np.ndarray, str]]:
"""
Retrieve IQ data from device by first writing to a tempfile.
Tunes device parameters before recording: center frequency,
Expand Down Expand Up @@ -2509,7 +2509,7 @@ def IQSTREAMIQInfo_StatusParser(

def SPECTRUM_Acquire(
self, trace: str = "Trace1", trace_points: int = 801, timeout_msec: int = 50
) -> Tuple[np.ndarray, int]:
) -> tuple[np.ndarray, int]:
"""
Acquire spectrum trace.
Expand Down Expand Up @@ -2567,7 +2567,7 @@ def IQBLK_Configure(

def IQBLK_Acquire(
self, rec_len: int = 1024, timeout_ms: int = 50
) -> Tuple[np.ndarray, np.ndarray]:
) -> tuple[np.ndarray, np.ndarray]:
"""
Acquire IQBLK data using IQBLK_GetIQDataDeinterleaved.
Expand Down Expand Up @@ -2637,7 +2637,7 @@ def DEVICE_GetTemperature(self, unit: str = "celsius") -> float:

def IQSTREAM_Acquire(
self, duration_msec: int, return_status: bool
) -> Union[np.ndarray, Tuple[np.ndarray, str]]:
) -> Union[np.ndarray, tuple[np.ndarray, str]]:
"""
Stream IQ data to a NumPy array.
Expand Down

0 comments on commit d145b0a

Please sign in to comment.