Skip to content

Commit

Permalink
Exposing private functions (#195)
Browse files Browse the repository at this point in the history
* 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__
  • Loading branch information
astanziola committed Jun 29, 2023
1 parent 7d895b1 commit b470e41
Show file tree
Hide file tree
Showing 22 changed files with 332 additions and 190 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- '**.md'
- '**.ipynb'
- '**.sh'
- '**.css'
- '**.js'

jobs:
build-and-publish:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### 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
- Exposed `sphere_mask` function for creating spherical binary masks
- Exposed `circ_mask` function for creating circular binary masks
- Exposed bli_function that is used to compute the band limited interpolant

## [0.1.3] - 2023-06-28
### Added
- Added off grid sensors [@tomelse]
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/harmonic/helmholtz_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"from matplotlib import pyplot as plt\n",
"\n",
"from jwave import FiniteDifferences, FourierSeries\n",
"from jwave.geometry import Domain, Medium, _circ_mask\n",
"from jwave.geometry import Domain, Medium, circ_mask\n",
"from jwave.utils import plot_complex_field, show_positive_field\n",
"\n",
"key = random.PRNGKey(42) # Random seed"
Expand Down Expand Up @@ -119,8 +119,8 @@
"sound_speed = sound_speed.at[20:105, 20:200].set(1.0)\n",
"sound_speed = (\n",
" sound_speed\n",
" * (1 - _circ_mask(N, 90, [64, 180]))\n",
" * (1 - _circ_mask(N, 50, [64, 22]))\n",
" * (1 - circ_mask(N, 90, [64, 180]))\n",
" * (1 - circ_mask(N, 50, [64, 22]))\n",
" * 0.5\n",
" + 1\n",
")\n",
Expand Down
55 changes: 27 additions & 28 deletions docs/notebooks/ivp/3d.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/notebooks/ivp/custom_sensors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"from jwave import FourierSeries\n",
"from jwave.acoustics import simulate_wave_propagation\n",
"from jwave.geometry import *\n",
"from jwave.geometry import _circ_mask\n",
"from jwave.geometry import circ_mask\n",
"from jwave.utils import show_field\n",
"\n",
"domain = Domain((128, 128), (0.1e-3, 0.1e-3))\n",
Expand All @@ -48,10 +48,10 @@
"# Defining the initial pressure\n",
"\n",
"N = domain.N\n",
"mask1 = _circ_mask(N, 8, (50, 50))\n",
"mask2 = _circ_mask(N, 5, (80, 60))\n",
"mask3 = _circ_mask(N, 10, (64, 64))\n",
"mask4 = _circ_mask(N, 30, (64, 64))\n",
"mask1 = circ_mask(N, 8, (50, 50))\n",
"mask2 = circ_mask(N, 5, (80, 60))\n",
"mask3 = circ_mask(N, 10, (64, 64))\n",
"mask4 = circ_mask(N, 30, (64, 64))\n",
"p0 = 5.0 * mask1 + 3.0 * mask2 + 4.0 * mask3 + 0.5 * mask4\n",
"\n",
"p0 = 1.0 * jnp.expand_dims(p0, -1)\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/ivp/different_discretizations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"metadata": {},
"outputs": [],
"source": [
"from jwave.geometry import Domain, Medium, TimeAxis, _circ_mask\n",
"from jwave.geometry import Domain, Medium, TimeAxis, circ_mask\n",
"from jwave.acoustics.time_varying import simulate_wave_propagation\n",
"from jwave import FiniteDifferences, FourierSeries\n",
"from jwave.signal_processing import smooth\n",
Expand Down Expand Up @@ -50,7 +50,7 @@
"\n",
"# Smoothed initial pressure distribution\n",
"Nx = domain.N\n",
"p0 = 5.0 * _circ_mask(Nx, 5, (128, 40))\n",
"p0 = 5.0 * circ_mask(Nx, 5, (128, 40))\n",
"p0 = smooth(p0)\n",
"\n",
"# Getting time axis\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/ivp/heterogeneous_medium.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"from jwave import FourierSeries\n",
"from jwave.acoustics import simulate_wave_propagation\n",
"from jwave.geometry import *\n",
"from jwave.geometry import _circ_mask\n",
"from jwave.geometry import circ_mask\n",
"from jwave.utils import show_field, show_positive_field\n",
"\n",
"domain = Domain((128, 128), (0.1e-3, 0.1e-3))"
Expand Down Expand Up @@ -87,7 +87,7 @@
"# Defining the initial pressure\n",
"\n",
"N = domain.N\n",
"p0 = _circ_mask(N, 3, (64, 30))\n",
"p0 = circ_mask(N, 3, (64, 30))\n",
"\n",
"p0 = 1.0 * jnp.expand_dims(p0, -1)\n",
"p0 = FourierSeries(p0, domain)"
Expand Down Expand Up @@ -244,7 +244,7 @@
"density = FiniteDifferences(np.expand_dims(density, -1), domain, accuracy=8)\n",
"\n",
"N = domain.N\n",
"p0 = _circ_mask(N, 3, (64, 30))\n",
"p0 = circ_mask(N, 3, (64, 30))\n",
"\n",
"p0 = 1.0 * jnp.expand_dims(p0, -1)\n",
"p0 = FiniteDifferences(p0, domain, accuracy=8)"
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/ivp/homogeneous_medium.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@
"from jax import numpy as jnp\n",
"\n",
"from jwave import FourierSeries\n",
"from jwave.geometry import _circ_mask\n",
"from jwave.geometry import circ_mask\n",
"\n",
"p0 = 1.0 * jnp.expand_dims(_circ_mask(N, 4, (80, 60)), -1)\n",
"p0 = 1.0 * jnp.expand_dims(circ_mask(N, 4, (80, 60)), -1)\n",
"p0 = FourierSeries(p0, domain)"
]
},
Expand Down
50 changes: 27 additions & 23 deletions docs/notebooks/ivp/homogeneous_medium_sensors.ipynb

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions docs/notebooks/ivp/off_grid_sensors.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/notebooks/others/save_video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"from jwave import FourierSeries\n",
"from jwave.geometry import Domain, Medium, TimeAxis\n",
"from jwave.acoustics import simulate_wave_propagation\n",
"from jwave.geometry import _circ_mask\n",
"from jwave.geometry import circ_mask\n",
"\n",
"domain = Domain((128, 128), (0.1e-3, 0.1e-3))"
]
Expand Down Expand Up @@ -54,7 +54,7 @@
"\n",
"# Defining the initial pressure\n",
"N = domain.N\n",
"p0 = _circ_mask(N, 3, (64, 30))\n",
"p0 = circ_mask(N, 3, (64, 30))\n",
"p0 = 1.0 * jnp.expand_dims(p0, -1)\n",
"p0 = FourierSeries(p0, domain)"
]
Expand Down
63 changes: 29 additions & 34 deletions docs/notebooks/time_varying/FWI.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion jwave/__about__.py

This file was deleted.

Loading

0 comments on commit b470e41

Please sign in to comment.