From 34dc15f014c787ff0d3a67c912ab00bdcff58266 Mon Sep 17 00:00:00 2001 From: Harsh Narola Date: Fri, 10 Apr 2026 11:37:21 +0200 Subject: [PATCH 1/5] Fix the tests.yml --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c3e28d..4bd1422 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,9 @@ jobs: - name: Install system dependencies (required by lalsuite/pycbc) run: | + sudo apt-get update -q + sudo apt-get install -y -q software-properties-common + sudo add-apt-repository -y ppa:ligo-software/ligo-stable sudo apt-get update -q sudo apt-get install -y -q \ libhdf5-dev \ From 9a1e99079e7ae2ab544903659e9e59846f585ba1 Mon Sep 17 00:00:00 2001 From: Harsh Narola Date: Fri, 10 Apr 2026 11:49:51 +0200 Subject: [PATCH 2/5] Remove ligo-stable PPA installation step Removed the installation of the ligo-stable PPA from the workflow. --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bd1422..cd2971c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,8 +23,6 @@ jobs: run: | sudo apt-get update -q sudo apt-get install -y -q software-properties-common - sudo add-apt-repository -y ppa:ligo-software/ligo-stable - sudo apt-get update -q sudo apt-get install -y -q \ libhdf5-dev \ libfftw3-dev \ From f4fa9726532d930767f74d594f7b475cdbcf8cf0 Mon Sep 17 00:00:00 2001 From: Narola Harsh <51940885+narolaharsh@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:58:26 +0200 Subject: [PATCH 3/5] Fix workflow attempt 2 --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd2971c..f5f3369 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -23,6 +23,8 @@ jobs: run: | sudo apt-get update -q sudo apt-get install -y -q software-properties-common + sudo add-apt-repository -y ppa:ligo-software/ligo-stable + sudo apt-get update -q sudo apt-get install -y -q \ libhdf5-dev \ libfftw3-dev \ From 4d15308c3097087d02695b32388b27d26ca23259 Mon Sep 17 00:00:00 2001 From: Narola Harsh <51940885+narolaharsh@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:01:28 +0200 Subject: [PATCH 4/5] Fix workflow attempt 3 --- .github/workflows/tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f5f3369..62930f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -21,16 +21,11 @@ jobs: - name: Install system dependencies (required by lalsuite/pycbc) run: | - sudo apt-get update -q - sudo apt-get install -y -q software-properties-common - sudo add-apt-repository -y ppa:ligo-software/ligo-stable sudo apt-get update -q sudo apt-get install -y -q \ libhdf5-dev \ libfftw3-dev \ libgsl-dev \ - libframel-dev \ - libmetaio-dev \ pkg-config - name: Install package and dev dependencies From 0b1e666d08731ab0e734b66526581c851197355a Mon Sep 17 00:00:00 2001 From: Narola Harsh <51940885+narolaharsh@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:39:10 +0200 Subject: [PATCH 5/5] Fix pipeline --- src/deepextractor/data/__init__.py | 3 ++ src/deepextractor/data/datasets.py | 52 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/deepextractor/data/__init__.py create mode 100644 src/deepextractor/data/datasets.py diff --git a/src/deepextractor/data/__init__.py b/src/deepextractor/data/__init__.py new file mode 100644 index 0000000..9e90206 --- /dev/null +++ b/src/deepextractor/data/__init__.py @@ -0,0 +1,3 @@ +from deepextractor.data.datasets import SpectrogramDataset, TimeSeriesDataset + +__all__ = ["SpectrogramDataset", "TimeSeriesDataset"] diff --git a/src/deepextractor/data/datasets.py b/src/deepextractor/data/datasets.py new file mode 100644 index 0000000..2e45b63 --- /dev/null +++ b/src/deepextractor/data/datasets.py @@ -0,0 +1,52 @@ +import numpy as np +import torch +from torch.utils.data import Dataset + + +class TimeSeriesDataset(Dataset): + """Dataset for 1-D time-series arrays stored as .npy files. + + Each array is expected to have shape ``(N, L)`` where *N* is the number + of samples and *L* is the signal length. Items are returned as + ``(1, L)`` float32 tensors (channel dimension added). + """ + + def __init__(self, input_npy, target_npy, transform=None): + self.inputs = np.load(input_npy) + self.targets = np.load(target_npy) + self.transform = transform + + def __len__(self): + return len(self.inputs) + + def __getitem__(self, idx): + x = torch.from_numpy(self.inputs[idx]).float().unsqueeze(0) + y = torch.from_numpy(self.targets[idx]).float().unsqueeze(0) + if self.transform: + x = self.transform(x) + y = self.transform(y) + return x, y + + +class SpectrogramDataset(Dataset): + """Dataset for 2-D spectrogram arrays stored as .npy files. + + Each array is expected to have shape ``(N, H, W)``. Items are returned + as ``(1, H, W)`` float32 tensors (channel dimension added). + """ + + def __init__(self, input_npy, target_npy, transform=None): + self.inputs = np.load(input_npy) + self.targets = np.load(target_npy) + self.transform = transform + + def __len__(self): + return len(self.inputs) + + def __getitem__(self, idx): + x = torch.from_numpy(self.inputs[idx]).float().unsqueeze(0) + y = torch.from_numpy(self.targets[idx]).float().unsqueeze(0) + if self.transform: + x = self.transform(x) + y = self.transform(y) + return x, y