Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"
- uses: pre-commit/action@v3.0.1
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version
rev: 0.6.12
rev: 0.9.26
hooks:
- id: uv-lock
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -20,7 +20,3 @@ repos:
rev: v0.1.15
hooks:
- id: helmlint
- repo: https://github.com/dhruvmanila/remove-print-statements
rev: v0.5.2
hooks:
- id: remove-print-statements
4 changes: 2 additions & 2 deletions libs/utils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name = "utils"
version = "0.1.0"
description = "General utility functions for Aframe"
authors = [{ name = "Ethan Jacob Marx", email = "ethan.marx@ligo.org" }]
requires-python = ">=3.9,<3.13"
requires-python = ">=3.10,<3.13"
license = "MIT"
dependencies = [
"h5py~=3.6",
"numpy>=1.26.4,<2",
"s3fs>=2024,<2025",
"ml4gw>=0.7.2",
"ml4gw==0.7.8",
"astropy>=6.0.1",
]

Expand Down
7 changes: 4 additions & 3 deletions libs/utils/utils/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from ml4gw.transforms import (
SpectralDensity,
Whiten,
Decimator,
SingleQTransform,
)
from ml4gw.transforms.decimator import Decimator
from ml4gw.utils.slicing import unfold_windows


Expand Down Expand Up @@ -506,13 +506,14 @@ def __init__(
self.stride_size = int(sample_rate / inference_sampling_rate)
self.kernel_size = int(kernel_length * sample_rate)
self.schedule = torch.tensor(schedule, dtype=torch.int)
self.split = split
if self.schedule.shape[0] != 2:
raise ValueError(
"BatchWhitenerTimeSpectrogramDecimate requires exactly "
f"2 schedule views, but got {self.schedule.shape[0]}."
)
self.decimator = Decimator(
sample_rate=sample_rate, schedule=self.schedule, split=split
sample_rate=sample_rate, schedule=self.schedule
)
self.qtransform = SingleQTransform(
duration=self.schedule[0, 1].item(),
Expand Down Expand Up @@ -583,7 +584,7 @@ def forward(self, x: Tensor) -> Tensor:
x = x.reshape(-1, num_channels, self.kernel_size)

# decimate the timeseries
x = self.decimator(x)
x = self.decimator(x, split=self.split)
# convert first segment into spectrogram
spec = self.qtransform(x[0])

Expand Down
1,828 changes: 655 additions & 1,173 deletions libs/utils/uv.lock

Large diffs are not rendered by default.

Loading