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
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "gwmemory 3.14",
"image": "mcr.microsoft.com/devcontainers/python:3.14-trixie",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "latest"
}
},
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.vscode-python-envs",
"GitHub.copilot"
]
}
},
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y libgsl-dev && pip install uv"
}
28 changes: 11 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,25 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- uses: s-weigand/setup-conda@v1
- uses: astral-sh/setup-uv@v8.1.0
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.11
python-version: 3.13

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super
conda install pip setuptools
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt --file pages_requirements.txt
python -m pip install nrsur7dq2
- name: Install gwmemory
run: |
pip install .
- name: List installed
run: |
conda list
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super pandoc libgsl-dev
uv sync --extra full --extra docs

- name: Run notebook
run: |
cd examples
jupyter nbconvert --to html --execute *.ipynb
uv run jupyter nbconvert --to html --execute *.ipynb
cd ..

- name: Build documentation
Expand All @@ -51,15 +45,15 @@ jobs:
mv Makefile.gh_pages Makefile
cp ../examples/GWMemory.ipynb ./example.ipynb
cp ../examples/Comparison.ipynb ./comparison.ipynb
make clean
make html
uv run make clean
uv run make html
cd ../
touch _gh-pages/latest/html/.nojekyll
rm -r docs
mv _gh-pages/latest/html docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v6
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: 3.13
- name: Install pypa/build
run: >-
python -m pip install build setuptools_scm --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# uses: pypa/gh-action-pypi-publish@v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
31 changes: 11 additions & 20 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,32 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- name: Setup conda
uses: s-weigand/setup-conda@v1
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.1.0
- name: Setup Python
uses: actions/setup-python@v6
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: Install dependencies
run: |
conda install pip setuptools
conda install flake8 pytest-cov
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt
python -m pip install nrsur7dq2
- name: Install gwmemory
run: |
pip install .
- name: List installed
run: |
conda list
sudo apt-get install libgsl-dev
uv sync --extra full
- name: Test with pytest
run: |
pytest --cov gwmemory -ra --color yes --cov-report=xml --junitxml=pytest.xml
uv run pytest --cov gwmemory -ra --color yes --cov-report=xml --junitxml=pytest.xml
- name: Publish coverage to Codecov
uses: codecov/codecov-action@v1.2.1
uses: codecov/codecov-action@v6
with:
files: coverage.xml
flags: python${{ matrix.python-version }}
- name: Coverage report
run: python -m coverage report --show-missing
run: uv run python -m coverage report --show-missing
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: pytest-${{ matrix.python-version }}
path: pytest.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
uv.lock

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
`GWMemory` is available via `conda-forge` and `pypi`

```console
$ uv pip install gwmemory
$ conda install -c conda-forge gwmemory
$ python -m pip install gwmemory
```
Expand All @@ -20,9 +21,11 @@ You can also install from this repository in the usual way:
```console
$ git clone https://github.com/ColmTalbot/gwmemory.git
$ cd gwmemory
$ python -m pip install .
$ uv sync
```

Use `uv sync --extra full` for the optional runtime and test dependencies, and `uv sync --extra full --extra docs` when building the documentation stack.

## Examples

Demonstrations of how to calculate memory waveforms can be found in the [documentation](https://colmtalbot.github.io/gwmemory/) and in the examples directory.
Expand Down
Loading