Skip to content

Commit 8a06c74

Browse files
authored
Towards 0.2.0 (#194)
* display_complex_field (#193) * deprecation warning for plot_complex_field in favor of display_complex_field * updated save_video and notebooks * points_on_circle, unit_fibonacci_sphere, circ_mask, bli_function are not private anymore * added css and js files to paths for build_docs action * removed __about__ * removed transformations module * added more tests for signal_processing * update docs and example with display_complex_field
1 parent 2366bf8 commit 8a06c74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+878
-896
lines changed

.github/actions/python-poetry-env/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ runs:
1919
- name: Create virtual environment
2020
run: poetry install --with=dev
2121
shell: bash
22+
- name: Install jaxlib
23+
run: poetry run pip install jax[cpu]
24+
shell: bash

.github/workflows/build_docs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
5+
name: Build Docs
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- 'docs/**'
11+
- 'mkdocs.yml'
12+
- '**.md'
13+
- '**.ipynb'
14+
- '**.sh'
15+
- '**.css'
16+
- '**.js'
17+
18+
jobs:
19+
build-and-publish:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: ./.github/actions/python-poetry-env
24+
- name: Build docs
25+
run: poetry run mkdocs build

.github/workflows/ci_tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow runs both the regression tests and the unit/integration tests.
2+
# It is triggered on push to the main branch.
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
10+
jobs:
11+
full_tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: ./.github/actions/python-poetry-env
16+
- name: Downloading test data
17+
run: |
18+
make get_test_data
19+
- name: Running Regression Tests
20+
run: |
21+
poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests
22+
- name: Remove coverage data from regression tests
23+
run: |
24+
rm ./.coverage
25+
- name: Running Unit and Integration tests
26+
run: |
27+
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
28+
poetry run coverage xml
29+
- name: "Upload coverage to Codecov"
30+
uses: codecov/codecov-action@v3
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
files: ./coverage.xml
34+
name: codecov-umbrella
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This is a workflow for Regression Tests.
2+
# It is triggered by a pull request to the main branch.
3+
4+
name: Regression Tests
5+
6+
on:
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
regression_tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: ./.github/actions/python-poetry-env
16+
- name: Downloading test data
17+
run: |
18+
make get_test_data
19+
- name: Running tests
20+
run: poetry run coverage run --source=jwave -m pytest -xvs ./tests/regression_tests

.github/workflows/tests.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
5+
name: Unit and Integration Tests
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- '**.py'
11+
- '**.m'
12+
- '**.yaml'
13+
- '**Makefile'
14+
15+
jobs:
16+
unit_and_integration_tests:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: ./.github/actions/python-poetry-env
21+
- name: Downloading test data
22+
run: |
23+
make get_test_data
24+
- name: Running tests
25+
run: |
26+
poetry run coverage run --source=jwave -m pytest -xvs --ignore=tests/regression_tests
27+
poetry run coverage xml
28+
- name: "Upload coverage to Codecov"
29+
uses: codecov/codecov-action@v3
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
files: ./coverage.xml
33+
name: codecov-umbrella

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
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).
55

66
## [Unreleased]
7+
### Changed
8+
- Refactored `save_video` to use opencv.
9+
10+
### Deprecated
11+
- `plot_complex_field` has been deprecated in favor of `display_complex_field`
12+
13+
### Removed
14+
- 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)
15+
16+
### Added
17+
- Exposed `points_on_circle` function to generate points on a circle
18+
- Exposed `unit_fibonacci_sphere` function
19+
- Exposed `fibonacci_sphere` function
20+
- Exposed `sphere_mask` function for creating spherical binary masks
21+
- Exposed `circ_mask` function for creating circular binary masks
22+
- Exposed bli_function that is used to compute the band limited interpolant
723

824
## [0.1.3] - 2023-06-28
925
### Added
@@ -69,4 +85,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6985
[0.0.3]: https://github.com/ucl-bug/jwave/compare/0.0.2...0.0.3
7086
[0.0.2]: https://github.com/ucl-bug/jwave/compare/0.0.1...0.0.2
7187
[0.0.1]: https://github.com/ucl-bug/jwave/releases/tag/0.0.1
72-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Support](https://dcbadge.vercel.app/api/server/VtUb4fFznt?style=flat)](https://discord.gg/VtUb4fFznt)
88
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-blue.svg)](LICENSE)
9-
[![Continous Integration](https://github.com/ucl-bug/jwave/actions/workflows/tests.yml/badge.svg)](https://github.com/ucl-bug/jwave/actions/workflows/tests.yml)
9+
[![Continous Integration](https://github.com/ucl-bug/jwave/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/ucl-bug/jwave/actions/workflows/ci_tests.yml)
1010
[![codecov](https://codecov.io/gh/ucl-bug/jwave/branch/main/graph/badge.svg?token=6J03OMVJS1)](https://codecov.io/gh/ucl-bug/jwave)
1111
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ucl-bug/jwave/main?labpath=docs%2Fnotebooks%2Fivp%2Fhomogeneous_medium.ipynb)
1212
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1xAHAognF1v9un6GNvaGPSfdVeCDK8l9z?usp=sharing)

docs/api_utils.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
handler: python
55
members:
66
- is_numeric
7-
- plot_complex_field
7+
- display_complex_field
88
show_root_heading: true
99
show_source: false

docs/notebooks/harmonic/helmholtz_problem.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"from matplotlib import pyplot as plt\n",
4747
"\n",
4848
"from jwave import FiniteDifferences, FourierSeries\n",
49-
"from jwave.geometry import Domain, Medium, _circ_mask\n",
50-
"from jwave.utils import plot_complex_field, show_positive_field\n",
49+
"from jwave.geometry import Domain, Medium, circ_mask\n",
50+
"from jwave.utils import display_complex_field, show_positive_field\n",
5151
"\n",
5252
"key = random.PRNGKey(42) # Random seed"
5353
]
@@ -104,7 +104,7 @@
104104
"src = FourierSeries(jnp.expand_dims(src_field, -1), domain) * omega\n",
105105
"\n",
106106
"# Plotting\n",
107-
"_ = plot_complex_field(src)"
107+
"_ = display_complex_field(src)"
108108
]
109109
},
110110
{
@@ -119,8 +119,8 @@
119119
"sound_speed = sound_speed.at[20:105, 20:200].set(1.0)\n",
120120
"sound_speed = (\n",
121121
" sound_speed\n",
122-
" * (1 - _circ_mask(N, 90, [64, 180]))\n",
123-
" * (1 - _circ_mask(N, 50, [64, 22]))\n",
122+
" * (1 - circ_mask(N, 90, [64, 180]))\n",
123+
" * (1 - circ_mask(N, 50, [64, 22]))\n",
124124
" * 0.5\n",
125125
" + 1\n",
126126
")\n",
@@ -170,7 +170,7 @@
170170
}
171171
],
172172
"source": [
173-
"_ = plot_complex_field(field, max_intensity=2e5)"
173+
"_ = display_complex_field(field, max_intensity=2e5)"
174174
]
175175
},
176176
{
@@ -272,7 +272,7 @@
272272
"source": [
273273
"# Solve new problem\n",
274274
"field = solve_helmholtz(medium, params)\n",
275-
"_ = plot_complex_field(field, max_intensity=2e5)"
275+
"_ = display_complex_field(field, max_intensity=2e5)"
276276
]
277277
},
278278
{
@@ -316,7 +316,7 @@
316316
"\n",
317317
"# Solve new problem\n",
318318
"field = solve_helmholtz(medium, params)\n",
319-
"_ = plot_complex_field(field, max_intensity=2e5)"
319+
"_ = display_complex_field(field, max_intensity=2e5)"
320320
]
321321
},
322322
{

0 commit comments

Comments
 (0)