diff --git a/augment/augment.py b/augment/augment.py index 1c5d36c5..d0edb679 100755 --- a/augment/augment.py +++ b/augment/augment.py @@ -95,11 +95,11 @@ def write_signal(filename, signal, transforms_text): def augment(signal, filename, output_dir, n, transforms_text): # TODO: sadly, due to Torchsig complexity, literal_eval can't be used. - transforms = eval(transforms_text) # nosec + transforms = eval(transforms_text) # nosec i = 0 base_augment_name = os.path.basename(filename) dot = base_augment_name.find(".") - if dot != "-1": + if dot != -1: base_augment_name = base_augment_name[:dot] for _ in range(n): while True: @@ -114,7 +114,9 @@ def augment(signal, filename, output_dir, n, transforms_text): def argument_parser(): - parser = ArgumentParser() + parser = ArgumentParser( + description="Run transforms on a recording from https://github.com/TorchDSP/torchsig/blob/main/torchsig/transforms/transforms.py" + ) parser.add_argument( "filename", type=str, diff --git a/docker/Dockerfile.torchsig b/docker/Dockerfile.torchsig index aac65d94..4a027092 100644 --- a/docker/Dockerfile.torchsig +++ b/docker/Dockerfile.torchsig @@ -18,4 +18,6 @@ COPY --from=torchsig-builder /usr/local/lib/python3.10/dist-packages /usr/local/ RUN python3 -c "from torchsig.transforms import transforms" RUN python3 -c "from gamutrf import grscan" COPY augment/augment.py /root/augment.py +RUN dd if=/dev/zero of=/tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw bs=8 count=1000 && /root/augment.py /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw /tmp 1 "ST.Compose([ST.Identity()])" && diff -b /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000sps.raw /tmp/augmented-0-gamutrf_recording_ettus__gain40_1_1Hz_1000sps && rm -f /tmp/gamutrf* + ENTRYPOINT ["/root/augment.py"]