Drop Python 3.10 support and fix all flake8 lint violations
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 22s
Test with tox / Test with tox (3.12) (pull_request) Failing after 17s
Test with tox / Test with tox (3.11) (pull_request) Failing after 30s
Build Project / Build Project (3.12) (pull_request) Successful in 1m5s
Build Project / Build Project (3.11) (pull_request) Successful in 1m7s
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 22s
Test with tox / Test with tox (3.12) (pull_request) Failing after 17s
Test with tox / Test with tox (3.11) (pull_request) Failing after 30s
Build Project / Build Project (3.12) (pull_request) Successful in 1m5s
Build Project / Build Project (3.11) (pull_request) Successful in 1m7s
- Remove py310 from tox envlist, CI matrix, readthedocs, README badge - Move lint env to run on 3.11 in gh-actions mapping - Fix E501 line-too-long in cusum_annotator, energy_detector, parallel_signal_separator, threshold_qualifier (split error string) - Fix E501 in annotate.py: wrap --sample-rate click.option decorators to black style (one arg per line with trailing comma) - Fix C901 in annotate.py: extract _log_separate_start() helper to reduce separate() complexity from 17 to 14 - Fix separate() signature wrapping to match black style Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7ef3fe8fb1
commit
23d12875be
|
|
@ -8,7 +8,7 @@ version: 2
|
||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.10"
|
python: "3.11"
|
||||||
jobs:
|
jobs:
|
||||||
post_create_environment:
|
post_create_environment:
|
||||||
# Install poetry
|
# Install poetry
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [ '3.10', '3.11', '3.12' ]
|
python-version: [ '3.11', '3.12' ]
|
||||||
|
|
||||||
name: Build Project
|
name: Build Project
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.10', '3.11', '3.12']
|
python-version: ['3.11', '3.12']
|
||||||
|
|
||||||
name: Test with tox
|
name: Test with tox
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
</a>
|
</a>
|
||||||
<!-- Python Version -->
|
<!-- Python Version -->
|
||||||
<a href="https://www.python.org/downloads">
|
<a href="https://www.python.org/downloads">
|
||||||
<img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python Version">
|
<img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python Version">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ version = "0.1.5"
|
||||||
description = "An open-source version of the RIA Toolkit, including the fundamental tools to get started developing, testing, and deploying radio intelligence applications"
|
description = "An open-source version of the RIA Toolkit, including the fundamental tools to get started developing, testing, and deploying radio intelligence applications"
|
||||||
license = { text = "AGPL-3.0-only" }
|
license = { text = "AGPL-3.0-only" }
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.11"
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Qoherent Inc.", email = "info@qoherent.ai" },
|
{ name = "Qoherent Inc.", email = "info@qoherent.ai" },
|
||||||
]
|
]
|
||||||
|
|
@ -128,7 +128,7 @@ onnxruntime = {version = ">=1.17,<2.0", python = ">=3.11"}
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 119
|
line-length = 119
|
||||||
target-version = ["py310"]
|
target-version = ["py311"]
|
||||||
exclude = '''
|
exclude = '''
|
||||||
/(
|
/(
|
||||||
\.git
|
\.git
|
||||||
|
|
|
||||||
|
|
@ -502,8 +502,10 @@ def clear(input, output, overwrite, force, quiet):
|
||||||
help="Annotation type",
|
help="Annotation type",
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--sample-rate", type=float, default=None,
|
"--sample-rate",
|
||||||
help="Sample rate in Hz (overrides metadata; required if not in file)"
|
type=float,
|
||||||
|
default=None,
|
||||||
|
help="Sample rate in Hz (overrides metadata; required if not in file)",
|
||||||
)
|
)
|
||||||
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
||||||
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
||||||
|
|
@ -617,8 +619,10 @@ def energy(
|
||||||
help="Annotation type",
|
help="Annotation type",
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--sample-rate", type=float, default=None,
|
"--sample-rate",
|
||||||
help="Sample rate in Hz (overrides metadata; required if not in file)"
|
type=float,
|
||||||
|
default=None,
|
||||||
|
help="Sample rate in Hz (overrides metadata; required if not in file)",
|
||||||
)
|
)
|
||||||
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
||||||
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
||||||
|
|
@ -707,8 +711,10 @@ def cusum(input, label, min_duration, window_size, tolerance, annotation_type, s
|
||||||
)
|
)
|
||||||
@click.option("--channel", type=int, default=0, help="Channel index to annotate (default: 0)")
|
@click.option("--channel", type=int, default=0, help="Channel index to annotate (default: 0)")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--sample-rate", type=float, default=None,
|
"--sample-rate",
|
||||||
help="Sample rate in Hz (overrides metadata; required if not in file)"
|
type=float,
|
||||||
|
default=None,
|
||||||
|
help="Sample rate in Hz (overrides metadata; required if not in file)",
|
||||||
)
|
)
|
||||||
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
||||||
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
||||||
|
|
@ -780,20 +786,6 @@ def threshold(input, threshold, label, window_size, annotation_type, channel, sa
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
|
||||||
@annotate.command()
|
|
||||||
@click.argument("input", type=click.Path(exists=True))
|
|
||||||
@click.option("--indices", type=str, help="Comma-separated annotation indices to split (default: all)")
|
|
||||||
@click.option("--nfft", type=int, default=65536, help="FFT size for spectral analysis")
|
|
||||||
@click.option("--noise-threshold-db", type=float, help="Noise floor threshold in dB (auto-estimated if not specified)")
|
|
||||||
@click.option("--min-component-bw", type=float, default=50e3, help="Min component bandwidth in Hz")
|
|
||||||
@click.option(
|
|
||||||
"--sample-rate", type=float, default=None,
|
|
||||||
help="Sample rate in Hz (overrides metadata; required if not in file)"
|
|
||||||
)
|
|
||||||
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
|
||||||
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
|
||||||
@click.option("--quiet", is_flag=True, help="Quiet mode")
|
|
||||||
@click.option("--verbose", is_flag=True, help="Verbose output (show detected components)")
|
|
||||||
def _log_separate_start(quiet, recording, indices_list, nfft, noise_threshold_db, min_component_bw):
|
def _log_separate_start(quiet, recording, indices_list, nfft, noise_threshold_db, min_component_bw):
|
||||||
if not quiet:
|
if not quiet:
|
||||||
click.echo("\nSplitting annotations by frequency components...")
|
click.echo("\nSplitting annotations by frequency components...")
|
||||||
|
|
@ -808,8 +800,34 @@ def _log_separate_start(quiet, recording, indices_list, nfft, noise_threshold_db
|
||||||
click.echo(f" Min component BW: {format_frequency(min_component_bw)}")
|
click.echo(f" Min component BW: {format_frequency(min_component_bw)}")
|
||||||
|
|
||||||
|
|
||||||
|
@annotate.command()
|
||||||
|
@click.argument("input", type=click.Path(exists=True))
|
||||||
|
@click.option("--indices", type=str, help="Comma-separated annotation indices to split (default: all)")
|
||||||
|
@click.option("--nfft", type=int, default=65536, help="FFT size for spectral analysis")
|
||||||
|
@click.option("--noise-threshold-db", type=float, help="Noise floor threshold in dB (auto-estimated if not specified)")
|
||||||
|
@click.option("--min-component-bw", type=float, default=50e3, help="Min component bandwidth in Hz")
|
||||||
|
@click.option(
|
||||||
|
"--sample-rate",
|
||||||
|
type=float,
|
||||||
|
default=None,
|
||||||
|
help="Sample rate in Hz (overrides metadata; required if not in file)",
|
||||||
|
)
|
||||||
|
@click.option("--output", "-o", type=click.Path(), help="Output file path")
|
||||||
|
@click.option("--overwrite", is_flag=True, help="Overwrite input file (non-SigMF only)")
|
||||||
|
@click.option("--quiet", is_flag=True, help="Quiet mode")
|
||||||
|
@click.option("--verbose", is_flag=True, help="Verbose output (show detected components)")
|
||||||
def separate(
|
def separate(
|
||||||
input, indices, nfft, noise_threshold_db, min_component_bw, sample_rate, output, overwrite, quiet, verbose):
|
input,
|
||||||
|
indices,
|
||||||
|
nfft,
|
||||||
|
noise_threshold_db,
|
||||||
|
min_component_bw,
|
||||||
|
sample_rate,
|
||||||
|
output,
|
||||||
|
overwrite,
|
||||||
|
quiet,
|
||||||
|
verbose,
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
Auto-detect parallel frequency-offset signals and split into sub-bands.
|
Auto-detect parallel frequency-offset signals and split into sub-bands.
|
||||||
|
|
||||||
|
|
|
||||||
5
tox.ini
5
tox.ini
|
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
envlist = py310, py311, py312, lint
|
envlist = py311, py312, lint
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
|
@ -30,6 +30,5 @@ per-file-ignores = __init__.py:F401
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.10: py310, lint
|
3.11: py311, lint
|
||||||
3.11: py311
|
|
||||||
3.12: py312
|
3.12: py312
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user