-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
- Adds a new convenience class
FourierChebyshevFieldwhich has a couple of methods to be compatible with optimization,init: only resolution infobuild: creates grid and transformsfit: given params and profiles (these change during optimization), fits a new Fourier-Chebyshev series.evaluate: Evaluate the series at requested point.
Example usage will be,
interpolater.build(eq)
data_fit = interpolater.fit(eq.params_dict, {"iota": eq.iota})
rtz, _, aux = _trace_particles(
field=interpolator, # normally you pass eq here
y0=x0,
model=model,
model_args=args,
ts=ts,
params=None, # normally you pass eq.params_dict here
max_steps=int((ts[-1] - ts[0]) / 1e-8),
min_step_size=1e-8,
stepsize_controller=PIDController(rtol=1e-4, atol=1e-4, dtmin=1e-8),
saveat=SaveAt(ts=ts),
solver=Tsit5(),
adjoint=RecursiveCheckpointAdjoint(),
event=event,
chunk_size=None,
options={}, # this passes extra stuff to field computation, not needed here
throw=False,
return_aux=True,
)
Todo:
-
trace_particlesshould initializeFourierChebyshevFieldand by default use it. Add a flag to use Equilibrium field -
plot_particle_trajectoriesetc should also be able to use the interpolated field. - Look at the spectral convergence (ideally lower res for basis vectors might be good, but current code is simpler and with batching might not be inefficient)
- Consider adding spline version too?
Optimization doesn't work yet
the initial conditions. `particle_tracer.py` and `optimization.py` are
adapted to this change.
Optimization doesn't work yet
Updates the requirements on
[nbsphinx](https://github.com/spatialaudio/nbsphinx) to permit the
latest version.
Release notes
Sourced from href="nbsphinx">https://github.com/spatialaudio/nbsphinx/releases">nbsphinx's
releases.
nbsphinx 0.9.8
href="https://pypi.org/project/nbsphinx/0.9.8/
https://pypi.org/project/nbsphinx/0.9.8/">https://pypi.org/project/nbsphinx/0.9.8/>
- Re-enable Sphinx 8.2+
- Support
text/x-rstMIME type in raw cells- Support for
mathjax4_config
Changelog
Sourced from href="nbsphinx">https://github.com/spatialaudio/nbsphinx/blob/master/NEWS.rst">nbsphinx's
changelog.
Version 0.9.8 -- 2025-11-28 -- PyPI__ -- diff__
- Re-enable Sphinx 8.2+
- Support
text/x-rstMIME type in raw cells- Support for
mathjax4_config__ href="https://pypi.org/project/nbsphinx/0.9.8/https://pypi.org/project/nbsphinx/0.9.8/">https://pypi.org/project/nbsphinx/0.9.8/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.7...0.9.8">https://github.com/spatialaudio/nbsphinx/compare/0.9.7...0.9.8>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.7...0.9.8Version 0.9.7 -- 2025-03-03 -- PyPI__ -- diff__
- Disable Sphinx 8.2+ (for now)
__ href="https://pypi.org/project/nbsphinx/0.9.7/https://pypi.org/project/nbsphinx/0.9.7/">https://pypi.org/project/nbsphinx/0.9.7/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.6...0.9.7">https://github.com/spatialaudio/nbsphinx/compare/0.9.6...0.9.7>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.6...0.9.7Version 0.9.6 -- 2024-12-24 -- PyPI__ -- diff__
- Markdown: allow lists without leading blank line
__ href="https://pypi.org/project/nbsphinx/0.9.6/https://pypi.org/project/nbsphinx/0.9.6/">https://pypi.org/project/nbsphinx/0.9.6/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.5...0.9.6">https://github.com/spatialaudio/nbsphinx/compare/0.9.5...0.9.6>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.5...0.9.6Version 0.9.5 -- 2024-08-13 -- PyPI__ -- diff__
- Miscellaneous fixes
__ href="https://pypi.org/project/nbsphinx/0.9.5/https://pypi.org/project/nbsphinx/0.9.5/">https://pypi.org/project/nbsphinx/0.9.5/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.4...0.9.5">https://github.com/spatialaudio/nbsphinx/compare/0.9.4...0.9.5>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.4...0.9.5Version 0.9.4 -- 2024-05-06 -- PyPI__ -- diff__
- Require
docutils >= 0.18.1- Minor fixes, documentation and CI updates
__ href="https://pypi.org/project/nbsphinx/0.9.4/https://pypi.org/project/nbsphinx/0.9.4/">https://pypi.org/project/nbsphinx/0.9.4/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.3...0.9.4">https://github.com/spatialaudio/nbsphinx/compare/0.9.3...0.9.4>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.3...0.9.4Version 0.9.3 -- 2023-08-27 -- PyPI__ -- diff__
- Fix gallery regression in Sphinx 7.2
__ href="https://pypi.org/project/nbsphinx/0.9.3/https://pypi.org/project/nbsphinx/0.9.3/">https://pypi.org/project/nbsphinx/0.9.3/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.2...0.9.3">https://github.com/spatialaudio/nbsphinx/compare/0.9.2...0.9.3>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.2...0.9.3Version 0.9.2 -- 2023-05-24 -- PyPI__ -- diff__
- Improve support for
sphinx_immaterialtheme- Improve support for links starting with
#- Add support for in-text citations
- LaTeX: Add support for admonition titles
__ href="https://pypi.org/project/nbsphinx/0.9.2/https://pypi.org/project/nbsphinx/0.9.2/">https://pypi.org/project/nbsphinx/0.9.2/>
https://github.com/spatialaudio/nbsphinx/compare/0.9.1...0.9.2">https://github.com/spatialaudio/nbsphinx/compare/0.9.1...0.9.2>
__ href="https://github.com/spatialaudio/nbsphinx/compare/0.9.1...0.9.2Version 0.9.1 -- 2023-03-14 -- PyPI__ -- diff__
- pandoc: disable "smart" option only for version 2.0+
... (truncated)
Commits
- href="
4f07420https://github.com/spatialaudio/nbsphinx/commit/4f07420639de321d63681ee8c560f73cb0c4a85f">4f07420>
Release 0.9.8 - href="
75d6770https://github.com/spatialaudio/nbsphinx/commit/75d6770733a5ef44553759449309a769c0329609">75d6770>
Avoid a logging error - href="
dd96f11https://github.com/spatialaudio/nbsphinx/commit/dd96f11edb14f7c2027c7ef50663f8c05a014278">dd96f11>
DOC: Update URL for the <img> element - href="
d97c011https://github.com/spatialaudio/nbsphinx/commit/d97c0111c4af0423216d217234d87ed73013958d">d97c011>
Add support for mathjax4_config (href="#854) https://redirect.github.com/spatialaudio/nbsphinx/issues/854">#854)> - href="
4882668https://github.com/spatialaudio/nbsphinx/commit/4882668244e8c0d7b36d0743f9fbc1a48d3160da">4882668>
Fix nbsphinx_assume_equations to work with newer versions of Sphinx - href="
95372a7https://github.com/spatialaudio/nbsphinx/commit/95372a74c543565b5e02357db5e248fb865a8326">95372a7>
CI: use "uv" for "publish" workflow - href="
9ce8c26https://github.com/spatialaudio/nbsphinx/commit/9ce8c26cfa363a357b760ed1b0cc45ecb92de1f4">9ce8c26>
setup.py -> pyproject.toml - href="
394b9eehttps://github.com/spatialaudio/nbsphinx/commit/394b9ee5611109db6b234e44e2b61da8e939ac8d">394b9ee>
DOC: use anonymous hyperlinks for embedded URLs - href="
ab85921https://github.com/spatialaudio/nbsphinx/commit/ab8592199d6637045b6f77992f10138590130d6b">ab85921>
Bump actions/upload-artifact from 4 to 5 - href="
76122c2https://github.com/spatialaudio/nbsphinx/commit/76122c23c9568305eb6da15abd5278981e8960b1">76122c2>
Bump actions/download-artifact from 4 to 6 - Additional commits viewable in href="compare">https://github.com/spatialaudio/nbsphinx/compare/0.8.12...0.9.8">compare
view
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rory Conlin
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Memory benchmark result| Test Name | %D | Master (MB) | PR (MB) | D (MB) | Time PR (s) | Time Master (s) |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ | test_objective_jac_w7x | 3.78 % | 3.813e+03 | 3.957e+03 | 144.13 | 39.78 | 36.26 | test_proximal_jac_w7x_with_eq_update | -1.27 % | 6.663e+03 | 6.579e+03 | -84.80 | 162.72 | 161.50 | test_proximal_freeb_jac | 0.41 % | 1.316e+04 | 1.321e+04 | 53.79 | 84.83 | 83.43 | test_proximal_freeb_jac_blocked | 0.41 % | 7.461e+03 | 7.492e+03 | 30.73 | 72.51 | 73.21 | test_proximal_freeb_jac_batched | -1.25 % | 7.538e+03 | 7.444e+03 | -94.36 | 72.91 | 73.10 | test_proximal_jac_ripple | -2.37 % | 3.608e+03 | 3.523e+03 | -85.50 | 65.70 | 65.71 | test_proximal_jac_ripple_bounce1d | -0.08 % | 3.566e+03 | 3.564e+03 | -2.77 | 76.55 | 76.55 | test_eq_solve | 0.60 % | 1.992e+03 | 2.004e+03 | 12.00 | 93.79 | 94.69 | For the memory plots, go to the summary of |
Codecov Report Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2012 +/- ## ========================================== - Coverage 95.75% 95.67% -0.09% ========================================== Files 102 102 Lines 28344 28471 +127 ========================================== + Hits 27142 27239 +97 - Misses 1202 1232 +30
New features to boost your workflow:
|
|
For some reason, this suffers from GPU synchronisation miserably, and for more particles, it is slower than direct approach. |
|
Maybe for these kinds of single node Grid creation, we can use a spline for only the radial part of zernike polynomials. The most expensive part of the transform calculation is the recurrence in the r_dense = jnp.linspace(0.01, 1, 1000)
dense_zernike = zernike_radial(r=r_dense, l=l, m=m) radial_spline = interpax.Interpolator1D(x=r_dense, f=dense_zernike) # this should replace zernike call in transform.build transforms = get_transforms(data_keys, eq, grid, jitable=True, radial_spline=radial_spline) I haven't tested it yet, but it should potentially solve the problem other options had. |