Skip to content

Commit

Permalink
Merge pull request #1043 from anarkiwi/zmql
Browse files Browse the repository at this point in the history
Common gamutrflib for non gnuradio code.
  • Loading branch information
anarkiwi authored Dec 15, 2023
2 parents d340b8e + 973f484 commit 8a97e99
Show file tree
Hide file tree
Showing 11 changed files with 501 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
done && \
sudo ldconfig -v && \
poetry config virtualenvs.create false && \
cd gamutrflib && \
poetry install --no-interaction && \
cd .. && \
poetry install --no-interaction && \
poetry install --no-interaction -C utils/mavlink-api && \
sudo dpkg -r --force-depends python3-numpy
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ RUN apt-get update && apt-get install --no-install-recommends -y -q \
poetry config virtualenvs.create false && \
python3 -m pip install --no-cache-dir --upgrade pip
COPY --from=iqtlabs/gamutrf-base:latest /usr/local /usr/local
COPY gamutrflib /gamutrflib/
WORKDIR /gamutrflib
RUN poetry install --no-interaction --no-ansi --no-dev
WORKDIR /gamutrf
RUN python3 -c "from gamutrflib.zmqbucket import *"
COPY poetry.lock pyproject.toml README.md /gamutrf/
RUN poetry run pip install --no-cache-dir pandas=="$(grep pandas pyproject.toml | grep -Eo '[0-9\.]+')"
# dependency install is cached for faster rebuild, if only gamutrf source changed.
Expand Down Expand Up @@ -82,9 +86,13 @@ RUN if [ "$(arch)" = "x86_64" ] ; then \
COPY --from=iqtlabs/gnuradio:3.10.8 /usr/share/uhd/images /usr/share/uhd/images
COPY --from=installer /usr/local /usr/local
COPY --from=installer /gamutrf /gamutrf
COPY --from=installer /gamutrflib /gamutrflib
COPY --from=installer /root/.local /root/.local
RUN ldconfig -v
WORKDIR /gamutrflib
RUN poetry install --no-interaction --no-ansi --no-dev
WORKDIR /gamutrf
RUN python3 -c "from gamutrflib.zmqbucket import *"
RUN echo "$(find /gamutrf/gamutrf -type f -name \*py -print)"|xargs grep -Eh "^(import|from)\s"|grep -Ev "gamutrf"|sort|uniq|python3
RUN ldd /usr/local/bin/uhd_sample_recorder
# nosemgrep:github.workflows.config.missing-user
Expand Down
2 changes: 1 addition & 1 deletion gamutrf/sigfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from gamutrf.sigwindows import find_sig_windows
from gamutrf.sigwindows import ROLLING_FACTOR
from gamutrf.utils import http_get, rotate_file_n, SCAN_FRES
from gamutrf.zmqreceiver import ZmqReceiver, parse_scanners
from gamutrflib.zmqbucket import ZmqReceiver, parse_scanners


MB = int(1.024e6)
Expand Down
2 changes: 1 addition & 1 deletion gamutrf/sigwindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import defaultdict

import numpy as np
from gamutrf.peak_finder import get_peak_finder
from gamutrflib.peak_finder import get_peak_finder
from gamutrf.utils import SCAN_FRES, SCAN_FROLL


Expand Down
4 changes: 2 additions & 2 deletions gamutrf/waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from matplotlib import style
from scipy.ndimage import gaussian_filter

from gamutrf.peak_finder import get_peak_finder
from gamutrflib.peak_finder import get_peak_finder
from gamutrf.utils import SCAN_FRES
from gamutrf.zmqreceiver import ZmqReceiver, parse_scanners, frame_resample
from gamutrflib.zmqbucket import ZmqReceiver, parse_scanners, frame_resample

warnings.filterwarnings(action="ignore", message="Mean of empty slice")
warnings.filterwarnings(action="ignore", message="All-NaN slice encountered")
Expand Down
File renamed without changes.
File renamed without changes.
460 changes: 460 additions & 0 deletions gamutrflib/poetry.lock

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions gamutrflib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tool.poetry]
name = "gamutrflib"
version = "0.5.40"
description = "gamutrf non-gnuradio common code"
authors = ["cglewis <[email protected]>"]
license = "Apache-2.0"
packages = [
{ include = "gamutrflib" },
]

[tool.poetry.dependencies]
numpy = "1.26.2"
scipy = "1.11.4"
pandas = "2.1.4"
python = ">=3.9,<3.13"
pyzmq = "^25.1.0"
zstandard = "0.22.0"

[tool.poetry.urls]
homepage = "https://github.com/IQTLabs/gamutRF"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion tests/test_sigfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from gamutrf.sigfinder import process_scans
from gamutrf.sigwindows import ROLLING_FACTOR
from gamutrf.utils import rotate_file_n
from gamutrf.zmqreceiver import fft_proxy, ZmqReceiver, parse_scanners
from gamutrflib.zmqbucket import fft_proxy, ZmqReceiver, parse_scanners


def null_proxy(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import unittest
import pandas as pd
from gamutrf.waterfall import argument_parser, waterfall
from gamutrf.peak_finder import get_peak_finder
from gamutrflib.peak_finder import get_peak_finder


class FakeZmqReceiver:
Expand Down

0 comments on commit 8a97e99

Please sign in to comment.