Repository navigation
Add sphere and isotropic rotational diffusion models - #280
Open
markbujehein wants to merge 22 commits into
Open
markbujehein wants to merge 22 commits into
markbujehein wants to merge 22 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clarify equations, parameters, and references across multiple classes.
- Introduced a new tutorial notebook for the equivalent sites on a circle model, detailing the mathematical framework and providing visualizations. - Added a tutorial for the 3D Gaussian model, explaining diffusion in a harmonic potential and including relevant plots. - Created a tutorial for jump sites with a log-normal distribution, extending the equivalent sites model to disordered environments with log-normal jump rates. - Updated mkdocs.yml to include links to the new tutorials. - Enhanced documentation in the equivalent sites circle model and jump sites log-normal distribution code to clarify model parameters and references.
Clarify diffusion model details more clearly and explicitly
Solves Ruff throwing 'useless-expression' during notebook-lint-check
Test that the circle, log-normal and 3D Gaussian models reject a non-float Q, and test the delta_name and delta_display_name setters of the base class. Rename the base-class test model from Toy to DummyDiffusionModel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
numba is an optional extra ('fast'), and a dev dependency so the fast
path is tested. The lock adds conda numba and llvmlite for the dev
environments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ties for clarity and accuracy
Fixes failing patch coverage reported by Codecov
- Introduced the IsotropicRotationalDiffusion class for modeling isotropic rotational diffusion of scatterers. - Updated the mkdocs.yml to include a tutorial for the new model. - Modified the __init__.py files to import the new model and include it in the public API. - Added unit and integration tests for the IsotropicRotationalDiffusion model, covering construction, parameter validation, physics calculations, and component behavior. - Ensured that the model adheres to expected physical properties and provides accurate outputs for various input parameters.
Contributor
|
Label error. Requires at least 1 of: [bot] release, [scope] bug, [scope] documentation, [scope] enhancement, [scope] maintenance, [scope] significant. Found: |
markbujehein
marked this pull request as ready for review
October 26, 2026 15:31
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #280 +/- ##
===========================================
+ Coverage 98.23% 98.40% +0.17%
===========================================
Files 61 70 +9
Lines 6227 7160 +933
Branches 1039 1121 +82
===========================================
+ Hits 6117 7046 +929
- Misses 57 61 +4
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two diffusion models, both build on
DeltaLorentzianDiffusionModelBasefrom #279.The models
DiffusionInSphere: a particle diffusing inside a sphere it cannot leave. [Volino and Dianoux]IsotropicRotationalDiffusion: a scatterer at a fixed distance from a centre, such as a hydrogen atom in a freely tumbling molecule, moving over the surface of that sphere by rotational diffusion. [Sears]Both give an elastic line plus a series of Lorentzians. In theory the series is infinite, so each model keeps a limited number of terms (based on how this is handled in other libraries)
l_max: 6 by default (enough up to QR of about 4.3), and at most 20.The defaults are kept low for speed. Every term adds two dependent Parameters per Q, and updating dependent Parameters slows down as their number grows, a known issue.
Users who need higher Q or a larger sphere can raise the number of terms (a warning tells them when that is needed).
Spherical Bessel functions
Both models need the Spherical Bessel Function of the First Kind:
spherical_bessel_expressionwrites each function out as an ordinary formula.easydynamics.utils.spherical_bessel.spherical_jn. Numba is added as an optional dependency, which offers a speed-up in some cases. Without numba it usesscipy.special.spherical_jnand gives the same values.The Spherical Bessel Function of the First Kind allow a bunch of rotational diffusion models to now be added.
Related: