Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference data loader #81

Open
wants to merge 53 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
61ae3f3
Integrate spline interp into qtransform
Sep 28, 2024
715d536
Better case handling
Sep 29, 2024
3ea3886
Did time interpolation more efficiently
Sep 29, 2024
6a43b58
Make interpolation method an argument
wbenoit26 Oct 21, 2024
910617c
Correct location of qtile stacking
wbenoit26 Oct 21, 2024
e7534ec
Added error tests
wbenoit26 Oct 23, 2024
6b075bd
Updates to `IMRPhenomP` api (#167)
EthanMarx Dec 11, 2024
15acf2f
add precessing spin conversion (#168)
EthanMarx Dec 12, 2024
da310aa
IMRPhenomPv2 fix (#176)
ravioli1369 Dec 29, 2024
7e64865
update minor version to 0.6.2
EthanMarx Jan 4, 2025
368d0dd
Restrict scipy in env and for tox
wbenoit26 Jan 7, 2025
13f61f6
fix batch inputs bug
ravioli1369 Jan 6, 2025
ce0438b
Added demo notebook
wbenoit26 Jan 6, 2025
a3ba42d
Create tensor on proper device in `IMRPhenomPv2` (#183)
EthanMarx Jan 10, 2025
b96f95b
add read the docs file
EthanMarx Jan 10, 2025
cd372f1
Increment version to `v0.6.3` (#184)
EthanMarx Jan 11, 2025
01a46c5
Add option to lowpass filter during whitening
wbenoit26 Jan 15, 2025
d6fc836
Adapted tests for lowpassing
wbenoit26 Jan 15, 2025
95d1b1e
Update readme and add license and citation (#186)
wbenoit26 Jan 19, 2025
55cf55a
Fix typo
wbenoit26 Jan 21, 2025
ded9196
Merge pull request #185 from wbenoit26/lowpass-whitening
wbenoit26 Jan 21, 2025
00e0f22
use relative imports everywhere (#190)
ravioli1369 Jan 25, 2025
da52ee0
Renamed directory
wbenoit26 Jan 30, 2025
7f49127
Merge pull request #180 from wbenoit26/add-tutorial-notebook
wbenoit26 Jan 30, 2025
03beee4
Increased waveform tolerance (#192)
wbenoit26 Jan 31, 2025
b0548be
Add `fnames_per_batch` argument to `HDF5Dataset` (#191)
EthanMarx Jan 31, 2025
6f0514e
Add `IIRFilter` transform for building and applying scipy filters (#189)
ravioli1369 Feb 4, 2025
16b0248
Adds `TimeDomainCBCWaveformGenerator` (#188)
EthanMarx Feb 6, 2025
d2ee746
Set random seed for unit tests
wbenoit26 Feb 5, 2025
3629932
Add seeding to fixture args
wbenoit26 Feb 5, 2025
556cfe3
Use num_samples fixture everywhere
wbenoit26 Feb 6, 2025
e7743f5
Add num_samples into generator test
wbenoit26 Feb 6, 2025
097361d
Merge pull request #196 from wbenoit26/seed-tests
wbenoit26 Feb 6, 2025
8755501
Fix flaky tests (#197)
EthanMarx Feb 6, 2025
b9895af
Update pyproject.toml to version `0.7.0` (#198)
EthanMarx Feb 6, 2025
a55d194
Fixes issue where tensors in waveform generator not getting built on …
EthanMarx Feb 7, 2025
85f60c9
Added lowpass option to SNR operations
wbenoit26 Feb 7, 2025
4eb87a8
Add additional tests for gw.py
wbenoit26 Feb 7, 2025
9f77be1
Add tests for raising value error
wbenoit26 Feb 7, 2025
949a516
Fix typo
wbenoit26 Feb 7, 2025
6e14e7c
Merge pull request #202 from wbenoit26/add-lowpass-option
wbenoit26 Feb 10, 2025
c01a5d9
Increment version
wbenoit26 Feb 12, 2025
78f572a
Merge pull request #203 from wbenoit26/v0.7.2
wbenoit26 Feb 12, 2025
6c25a35
Moved scipy out of dev dependencies
wbenoit26 Feb 14, 2025
cd5631f
Merge pull request #204 from wbenoit26/move-scipy-dep
wbenoit26 Feb 14, 2025
ee6312f
Switched pyproject format
wbenoit26 Feb 26, 2025
b657335
Got pre-commit passing
wbenoit26 Feb 26, 2025
9f7c9e5
Update documentation
wbenoit26 Feb 26, 2025
446e708
Get tests running
wbenoit26 Feb 27, 2025
cf70e30
Merge pull request #205 from wbenoit26/uv-ruff
wbenoit26 Feb 27, 2025
2ff3f99
initial commit of inference dataloader
EthanMarx Nov 27, 2023
f3882a9
update documentation
EthanMarx Nov 27, 2023
05d4736
add simple inference dataloader
EthanMarx Nov 27, 2023
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
Binary file added .coverage
Binary file not shown.
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Post coverage comment

on:
workflow_run:
workflows: ["unit-tests"]
types:
- completed

jobs:
test:
name: Run tests & display coverage
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for editing existing comments
contents: write
# Gives the action the necessary permissions for looking up the
# workflow that launched this workflow, and download the related
# artifact that contains the comment to be published
actions: read
steps:
# DO NOT run actions/checkout here, for security reasons
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
10 changes: 3 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install and Build Docs
run: |
poetry install
uv sync
cd docs
make clean
make html
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ jobs:
runs-on: ubuntu-latest
environment: PyPI
steps:
- uses: actions/checkout@v2
-
name: Build and publish to pypi
uses: JRubics/[email protected]
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python_version: "3.10.9"
pypi_token: ${{ secrets.PYPI_TOKEN }}
enable-cache: true
cache-dependency-glob: uv.lock

- name: Set up Python
run: uv python install 3.12

- name: Build
run: uv build

- name: Publish
run: uv publish -t ${{ secrets.PYPI_TOKEN }}
50 changes: 47 additions & 3 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# set up our environment
-
Expand All @@ -33,4 +33,48 @@ jobs:
name: run tests
env:
pyver: ${{ matrix.python-version }}
run: tox -e py${pyver//./}
COVERAGE_FILE: .coverage.${{ matrix.python-version }}
run: |
tox -e py${pyver//./}

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: .coverage.${{ matrix.python-version }}
include-hidden-files: true

coverage:
name: Coverage
runs-on: ubuntu-latest
needs: test
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
id: download
with:
pattern: coverage-*
merge-multiple: true

- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_COVERAGE_FILES: true

- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
33 changes: 15 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 22.3.0
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version
rev: 0.6.0
hooks:
- id: black
additional_dependencies: ["click==8.0.4"]
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- id: uv-lock

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/python-poetry/poetry
rev: 1.2.2

- repo: https://github.com/dhruvmanila/remove-print-statements
rev: v0.5.2
hooks:
- id: poetry-check
- id: poetry-lock
args: [--check, --no-update]
- id: remove-print-statements
36 changes: 36 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

jobs:
post_create_environment:
# Install uv
- pip install uv
post_install:
# Install dependencies
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
37 changes: 37 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: ml4gw
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Ethan
family-names: Marx
email: [email protected]
affiliation: MIT
orcid: 'https://orcid.org/0009-0000-4183-7876'
- given-names: William
family-names: Benoit
email: [email protected]
affiliation: University of Minnesota
orcid: 'https://orcid.org/0000-0003-4750-9413'
- given-names: Deep
family-names: Chatterjee
email: [email protected]
affiliation: MIT
orcid: 'https://orcid.org/0000-0003-0038-5468'
- given-names: Ravi
family-names: Kumar
email: [email protected]
affiliation: Indian Institute of Technology Bombay
- given-names: Alec
family-names: Gunny
repository-code: 'https://github.com/ML4GW/ml4gw'
abstract: >-
Torch utilities for doing machine learning in gravitational wave physics
keywords:
- Gravitational waves
- Machine learning
Loading