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
21 changes: 11 additions & 10 deletions .github/actions/python-poetry-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: 'Setup Python + Poetry environment'
description: 'Setup Python + Poetry environment'
name: 'Setup Python + uv environment'
description: 'Setup Python + uv environment'

inputs:
python-version:
required: false
description: 'Python version'
default: '3.10'
default: '3.13'
outputs: {}
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{inputs.python-version}}
- name: Install poetry
run: python -m pip install poetry
shell: bash
- name: Create virtual environment
run: poetry install --with=dev
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: uv sync --dev
shell: bash
- name: Install jaxlib
run: poetry run pip install jax[cpu]
run: uv pip install jax[cpu]
shell: bash
8 changes: 2 additions & 6 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This is a workflow that runs whenever a pull request
# changes some documentation files or the mkdocs.yml file. It
# checks that the documentation builds correctly.

name: Build Docs

on:
Expand All @@ -19,7 +15,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ./.github/actions/python-poetry-env
- name: Build docs
run: poetry run mkdocs build
run: uv run mkdocs build
13 changes: 5 additions & 8 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow runs both the regression tests and the unit/integration tests.
# It is triggered on push to the main branch.

name: CI

on:
Expand All @@ -11,23 +8,23 @@ jobs:
full_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/python-poetry-env
- name: Downloading test data
run: |
make get_test_data
- name: Running Regression Tests
run: |
poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
uv run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
- name: Remove coverage data from regression tests
run: |
rm ./.coverage
- name: Running Unit and Integration tests
run: |
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
poetry run coverage xml
uv run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
uv run coverage xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.5.0
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: ./.github/actions/python-poetry-env
- name: Update version
id: updated_version
shell: bash
run: |
poetry version ${{ github.event.inputs.version }}
version=$(poetry version --short)
echo ::set-output name="version::$version"
# Update version in pyproject.toml
if [[ "${{ github.event.inputs.version }}" =~ ^[0-9] ]]; then
version="${{ github.event.inputs.version }}"
else
echo "Semantic version bumps (patch/minor/major) require manual edit with uv"
exit 1
fi
sed -i "s/^version = .*/version = \"$version\"/" pyproject.toml
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Update changelog
id: changelog
shell: bash
run: |
poetry run kacl-cli release ${{ steps.updated_version.outputs.version }} --modify --auto-link
uv run kacl-cli release ${{ steps.updated_version.outputs.version }} --modify --auto-link
echo "" >> CHANGELOG.md
body=$(poetry run kacl-cli get ${{ steps.updated_version.outputs.version }})
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name="body::$body"
body=$(uv run kacl-cli get ${{ steps.updated_version.outputs.version }})
echo "body<<EOF" >> "$GITHUB_OUTPUT"
echo "$body" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Commit changes
uses: EndBug/add-and-commit@v7
uses: EndBug/add-and-commit@v9
with:
add: 'CHANGELOG.md pyproject.toml'
message: 'Release ${{ steps.updated_version.outputs.version }}'
Expand All @@ -48,11 +53,9 @@ jobs:
git tag ${{ steps.updated_version.outputs.version }}
git push --tags
- name: Create a draft release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.updated_version.outputs.version }}
release_name: Release ${{ steps.updated_version.outputs.version }}
name: Release ${{ steps.updated_version.outputs.version }}
body: ${{ steps.changelog.outputs.body }}
draft: true
7 changes: 2 additions & 5 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This is a workflow for Regression Tests.
# It is triggered by a pull request to the main branch.

name: Regression Tests

on:
Expand All @@ -11,10 +8,10 @@ jobs:
regression_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/python-poetry-env
- name: Downloading test data
run: |
make get_test_data
- name: Running tests
run: poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
run: uv run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ./.github/actions/python-poetry-env
- name: Publish to pypi
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build --no-interaction
- name: Build package
run: uv build
- name: Publish to PyPI
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
- name: Deploy docs
run: poetry run mkdocs gh-deploy --force
run: uv run mkdocs gh-deploy --force
12 changes: 4 additions & 8 deletions .github/workflows/unit_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This is a workflow for Unit, Integration, and Regression Tests
# It is used to test the code on every pull request, whenever a
# python, matlab, yaml, makefile, or markdown file is changed.

name: Unit and Integration Tests

on:
Expand All @@ -16,17 +12,17 @@ jobs:
unit_and_integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/python-poetry-env
- name: Downloading test data
run: |
make get_test_data
- name: Running tests
run: |
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
poetry run coverage xml
uv run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
uv run coverage xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
Expand Down
44 changes: 43 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Migrated from Poetry to uv for dependency management and builds
- Minimum Python version bumped to 3.11
- Upgraded plumkdocs to >=1.0.0 and mkdocstrings to >=1.0.0

## [0.2.1] - 2024-09-17

### Changed

- Upgraded `jaxdf` dependency

## [0.2.0] - 2023-12-18

### Fixed

- Fixed arguments error in helmholtz notebook

### Changed

- `Medium` objects are now `jaxdf.Module`s, which is based on `equinox` modules. It is also a [parametric module for dispatching operators](https://beartype.github.io/plum/parametric.html), meaning that there's a type difference betwee `Medium[FourierSeries]` and `Medium[FiniteDifferences]`, for example.
- The settings of time domain acoustic simulations are now set using a `TimeWavePropagationSettings`. This also includes an attribute to explicity set the reference sound speed.

### Added

- Added a logger in `jwave.logger`

### Removed

- Removed `pressure_from_density` from `jwave.acoustics.conversion`, as it was a duplicate

## [0.1.5] - 2023-09-27

### Added

- Added `numbers_with_smallest_primes` utility to find grids with small primes for efficient FFT when using FourierSeries

### Fixed

- Restored `default_params` for the helmholtz operators that wen missing since the last jaxdf update

## [0.1.4] - 2023-06-29

### Changed

- Refactored `save_video` to use opencv.

### Deprecated

- `plot_complex_field` has been deprecated in favor of `display_complex_field`

### Removed

- Removed the uncertainty propagation notebook example. For a more in depth example of using linear uncertainty propagation see [this repository](https://github.com/ucl-bug/linear-uncertainty)

### Added

- Exposed `points_on_circle` function to generate points on a circle
- Exposed `unit_fibonacci_sphere` function
- Exposed `fibonacci_sphere` function
Expand All @@ -49,56 +71,77 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Exposed bli_function that is used to compute the band limited interpolant

## [0.1.3] - 2023-06-28

### Added

- Added off grid sensors [@tomelse]

## [0.1.2] - 2023-06-22

### Changed

- updated documentation
- made imageio and tqdm optional dependencies

## [0.1.1] - 2023-06-22

### Fixed

- fixed pypi classifiers

## [0.1.0] - 2023-06-22

### Added

- `k0` is automatically calculated in the Convergent Born Series, if not given, using the fromula from Osnabrugge et al.

### Fixed

- updated for new `Array` type in `jax` 0.4.x

### Changed

- reverted checkpoint to only step checkpoints for time varying simulations. Soon jwave will use diffrax for advanced checkpointing

## [0.0.4] - 2022-11-04

### Added

- Convergent Born series.

### Fixed

- Correctly handles Nyquist frequency for Helmholtz operator, to improve agreement with k-Wave.
- Fixed incorrect domain size for angular spectrum.
- Angular spectrum is only dispatched on `pressure` types.

## [0.0.3] - 2022-07-05

### Added

- Angular spectrum method for single frequency sources.
- Differentiable rayleigh integral (from a plane)

## [0.0.2] - 2022-06-23

### Added

- Generate `TimeHarmonicSource` from point sources.

### Fixed

- Helmholtz notebook parameters bug.

## [0.0.1] - 2022-06-07

### Added

- Finite differences helmholtz tested.
- Extract time varying params without running the simulation.
- Windows one-line installer

### Fixed

- Using numpy operations in TimeAxis for static fields.
- Pml for 1D and 3D simulations.
- Plotting functions of `jwave.utils` now work with both `Field`s and arrays.
Expand All @@ -116,4 +159,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
[0.0.3]: https://github.com/ucl-bug/jwave/compare/0.0.2...0.0.3
[0.0.2]: https://github.com/ucl-bug/jwave/compare/0.0.1...0.0.2
[0.0.1]: https://github.com/ucl-bug/jwave/releases/tag/0.0.1

3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ plugins:
default_handler: python
handlers:
python:
rendering:
options:
show_source: false
custom_templates: templates
- search
- mermaid2
- macros:
Expand Down
Loading
Loading