Skip to content

Commit 3b0e0fa

Browse files
committed
Migrate from Poetry to uv, bump Python to >=3.11
1 parent 9d114ac commit 3b0e0fa

10 files changed

Lines changed: 3061 additions & 131 deletions

File tree

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
name: 'Setup Python + Poetry environment'
2-
description: 'Setup Python + Poetry environment'
1+
name: 'Setup Python + uv environment'
2+
description: 'Setup Python + uv environment'
33

44
inputs:
55
python-version:
66
required: false
77
description: 'Python version'
8-
default: '3.10'
8+
default: '3.13'
99
outputs: {}
1010
runs:
1111
using: 'composite'
1212
steps:
13-
- uses: actions/setup-python@v4
13+
- uses: actions/setup-python@v5
1414
with:
1515
python-version: ${{inputs.python-version}}
16-
- name: Install poetry
17-
run: python -m pip install poetry
18-
shell: bash
19-
- name: Create virtual environment
20-
run: poetry install --with=dev
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
18+
with:
19+
enable-cache: true
20+
- name: Install dependencies
21+
run: uv sync --dev
2122
shell: bash
2223
- name: Install jaxlib
23-
run: poetry run pip install jax[cpu]
24+
run: uv pip install jax[cpu]
2425
shell: bash

.github/workflows/build_docs.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This is a workflow that runs whenever a pull request
2-
# changes some documentation files or the mkdocs.yml file. It
3-
# checks that the documentation builds correctly.
4-
51
name: Build Docs
62

73
on:
@@ -19,7 +15,7 @@ jobs:
1915
build-and-publish:
2016
runs-on: ubuntu-latest
2117
steps:
22-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
2319
- uses: ./.github/actions/python-poetry-env
2420
- name: Build docs
25-
run: poetry run mkdocs build
21+
run: uv run mkdocs build

.github/workflows/ci_tests.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow runs both the regression tests and the unit/integration tests.
2-
# It is triggered on push to the main branch.
3-
41
name: CI
52

63
on:
@@ -11,23 +8,23 @@ jobs:
118
full_tests:
129
runs-on: ubuntu-latest
1310
steps:
14-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1512
- uses: ./.github/actions/python-poetry-env
1613
- name: Downloading test data
1714
run: |
1815
make get_test_data
1916
- name: Running Regression Tests
2017
run: |
21-
poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
18+
uv run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
2219
- name: Remove coverage data from regression tests
2320
run: |
2421
rm ./.coverage
2522
- name: Running Unit and Integration tests
2623
run: |
27-
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
28-
poetry run coverage xml
24+
uv run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
25+
uv run coverage xml
2926
- name: "Upload coverage to Codecov"
30-
uses: codecov/codecov-action@v3
27+
uses: codecov/codecov-action@v5
3128
with:
3229
token: ${{ secrets.CODECOV_TOKEN }}
3330
files: ./coverage.xml

.github/workflows/draft_release.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,38 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Set up SSH agent
16-
uses: webfactory/ssh-agent@v0.5.0
16+
uses: webfactory/ssh-agent@v0.9.1
1717
with:
1818
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
with:
2121
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
2222
- uses: ./.github/actions/python-poetry-env
2323
- name: Update version
2424
id: updated_version
2525
shell: bash
2626
run: |
27-
poetry version ${{ github.event.inputs.version }}
28-
version=$(poetry version --short)
29-
echo ::set-output name="version::$version"
27+
# Update version in pyproject.toml
28+
if [[ "${{ github.event.inputs.version }}" =~ ^[0-9] ]]; then
29+
version="${{ github.event.inputs.version }}"
30+
else
31+
echo "Semantic version bumps (patch/minor/major) require manual edit with uv"
32+
exit 1
33+
fi
34+
sed -i "s/^version = .*/version = \"$version\"/" pyproject.toml
35+
echo "version=$version" >> "$GITHUB_OUTPUT"
3036
- name: Update changelog
3137
id: changelog
3238
shell: bash
3339
run: |
34-
poetry run kacl-cli release ${{ steps.updated_version.outputs.version }} --modify --auto-link
40+
uv run kacl-cli release ${{ steps.updated_version.outputs.version }} --modify --auto-link
3541
echo "" >> CHANGELOG.md
36-
body=$(poetry run kacl-cli get ${{ steps.updated_version.outputs.version }})
37-
body="${body//'%'/'%25'}"
38-
body="${body//$'\n'/'%0A'}"
39-
body="${body//$'\r'/'%0D'}"
40-
echo ::set-output name="body::$body"
42+
body=$(uv run kacl-cli get ${{ steps.updated_version.outputs.version }})
43+
echo "body<<EOF" >> "$GITHUB_OUTPUT"
44+
echo "$body" >> "$GITHUB_OUTPUT"
45+
echo "EOF" >> "$GITHUB_OUTPUT"
4146
- name: Commit changes
42-
uses: EndBug/add-and-commit@v7
47+
uses: EndBug/add-and-commit@v9
4348
with:
4449
add: 'CHANGELOG.md pyproject.toml'
4550
message: 'Release ${{ steps.updated_version.outputs.version }}'
@@ -48,11 +53,9 @@ jobs:
4853
git tag ${{ steps.updated_version.outputs.version }}
4954
git push --tags
5055
- name: Create a draft release
51-
uses: actions/create-release@v1
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
uses: softprops/action-gh-release@v2
5457
with:
5558
tag_name: ${{ steps.updated_version.outputs.version }}
56-
release_name: Release ${{ steps.updated_version.outputs.version }}
59+
name: Release ${{ steps.updated_version.outputs.version }}
5760
body: ${{ steps.changelog.outputs.body }}
5861
draft: true
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This is a workflow for Regression Tests.
2-
# It is triggered by a pull request to the main branch.
3-
41
name: Regression Tests
52

63
on:
@@ -11,10 +8,10 @@ jobs:
118
regression_tests:
129
runs-on: ubuntu-latest
1310
steps:
14-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1512
- uses: ./.github/actions/python-poetry-env
1613
- name: Downloading test data
1714
run: |
1815
make get_test_data
1916
- name: Running tests
20-
run: poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
17+
run: uv run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
build-and-publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- uses: ./.github/actions/python-poetry-env
13-
- name: Publish to pypi
14-
run: |
15-
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
16-
poetry publish --build --no-interaction
13+
- name: Build package
14+
run: uv build
15+
- name: Publish to PyPI
16+
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
1717
- name: Deploy docs
18-
run: poetry run mkdocs gh-deploy --force
18+
run: uv run mkdocs gh-deploy --force

.github/workflows/unit_integration_tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This is a workflow for Unit, Integration, and Regression Tests
2-
# It is used to test the code on every pull request, whenever a
3-
# python, matlab, yaml, makefile, or markdown file is changed.
4-
51
name: Unit and Integration Tests
62

73
on:
@@ -16,17 +12,17 @@ jobs:
1612
unit_and_integration_tests:
1713
runs-on: ubuntu-latest
1814
steps:
19-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
2016
- uses: ./.github/actions/python-poetry-env
2117
- name: Downloading test data
2218
run: |
2319
make get_test_data
2420
- name: Running tests
2521
run: |
26-
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
27-
poetry run coverage xml
22+
uv run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
23+
uv run coverage xml
2824
- name: "Upload coverage to Codecov"
29-
uses: codecov/codecov-action@v3
25+
uses: codecov/codecov-action@v4
3026
with:
3127
token: ${{ secrets.CODECOV_TOKEN }}
3228
files: ./coverage.xml

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,68 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
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).
56

67
## [Unreleased]
78

9+
### Changed
10+
11+
- Migrated from Poetry to uv for dependency management and builds
12+
- Minimum Python version bumped to 3.11
13+
- Upgraded plumkdocs to >=1.0.0 and mkdocstrings to >=1.0.0
14+
815
## [0.2.1] - 2024-09-17
16+
917
### Changed
18+
1019
- Upgraded `jaxdf` dependency
1120

1221
## [0.2.0] - 2023-12-18
22+
1323
### Fixed
24+
1425
- Fixed arguments error in helmholtz notebook
1526

1627
### Changed
28+
1729
- `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.
1830
- 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.
1931

2032
### Added
33+
2134
- Added a logger in `jwave.logger`
2235

2336
### Removed
37+
2438
- Removed `pressure_from_density` from `jwave.acoustics.conversion`, as it was a duplicate
2539

2640
## [0.1.5] - 2023-09-27
41+
2742
### Added
43+
2844
- Added `numbers_with_smallest_primes` utility to find grids with small primes for efficient FFT when using FourierSeries
2945

3046
### Fixed
47+
3148
- Restored `default_params` for the helmholtz operators that wen missing since the last jaxdf update
3249

3350
## [0.1.4] - 2023-06-29
51+
3452
### Changed
53+
3554
- Refactored `save_video` to use opencv.
3655

3756
### Deprecated
57+
3858
- `plot_complex_field` has been deprecated in favor of `display_complex_field`
3959

4060
### Removed
61+
4162
- 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)
4263

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

5173
## [0.1.3] - 2023-06-28
74+
5275
### Added
76+
5377
- Added off grid sensors [@tomelse]
5478

5579
## [0.1.2] - 2023-06-22
80+
5681
### Changed
82+
5783
- updated documentation
5884
- made imageio and tqdm optional dependencies
5985

6086
## [0.1.1] - 2023-06-22
87+
6188
### Fixed
89+
6290
- fixed pypi classifiers
6391

6492
## [0.1.0] - 2023-06-22
93+
6594
### Added
95+
6696
- `k0` is automatically calculated in the Convergent Born Series, if not given, using the fromula from Osnabrugge et al.
6797

6898
### Fixed
99+
69100
- updated for new `Array` type in `jax` 0.4.x
70101

71102
### Changed
103+
72104
- reverted checkpoint to only step checkpoints for time varying simulations. Soon jwave will use diffrax for advanced checkpointing
73105

74106
## [0.0.4] - 2022-11-04
107+
75108
### Added
109+
76110
- Convergent Born series.
77111

78112
### Fixed
113+
79114
- Correctly handles Nyquist frequency for Helmholtz operator, to improve agreement with k-Wave.
80115
- Fixed incorrect domain size for angular spectrum.
81116
- Angular spectrum is only dispatched on `pressure` types.
82117

83118
## [0.0.3] - 2022-07-05
119+
84120
### Added
121+
85122
- Angular spectrum method for single frequency sources.
86123
- Differentiable rayleigh integral (from a plane)
87124

88125
## [0.0.2] - 2022-06-23
126+
89127
### Added
128+
90129
- Generate `TimeHarmonicSource` from point sources.
91130

92131
### Fixed
132+
93133
- Helmholtz notebook parameters bug.
94134

95135
## [0.0.1] - 2022-06-07
136+
96137
### Added
138+
97139
- Finite differences helmholtz tested.
98140
- Extract time varying params without running the simulation.
99141
- Windows one-line installer
100142

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

0 commit comments

Comments
 (0)