Skip to content

Commit

Permalink
Update readme and add license and citation (#186)
Browse files Browse the repository at this point in the history
* Added citation and license

* Updated readme

* Fixed pre-commit

* Add test coverage workflow

* Updated gwpy and added coverage

* Added coverage to workflow

* Add coverage to tox installs

* Correct command

* Put relative_files config in correct table

* Retry coverage table

* Include toml extra for coverage

* Include extra in tox table

* Do extra correctly(?)

* Add permissions to workflow

* Move coverage.yaml to correct location

* Make test coverage global

* Fix typo

* Testing

* Pass coverage file env var

* Fix typo

* Remove debugging lines

* Add .coveragerc file

* Added source specification

* Change how source is specified

* Test with directory

* Remove debugging

* Add coverage badge
  • Loading branch information
wbenoit26 authored Jan 19, 2025
1 parent cd372f1 commit 95d1b1e
Show file tree
Hide file tree
Showing 7 changed files with 1,954 additions and 1,049 deletions.
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 }}
46 changes: 45 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 95d1b1e

Please sign in to comment.