diff --git a/docs/docs/tutorials/analysis.ipynb b/docs/docs/tutorials/analysis.ipynb index 41e6c7ed1..7ba7858b5 100644 --- a/docs/docs/tutorials/analysis.ipynb +++ b/docs/docs/tutorials/analysis.ipynb @@ -255,17 +255,6 @@ "diffusion_analysis.plot_parameters(names=['Lorentzian width', 'Lorentzian area'])" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "eb226c8f", - "metadata": {}, - "outputs": [], - "source": [ - "# It will be possible to fit this to a DiffusionModel, but that will\n", - "# come later." - ] - }, { "cell_type": "code", "execution_count": null, @@ -332,13 +321,13 @@ "outputs": [], "source": [ "# Let us look at the fitted diffusion coefficient\n", - "diffusion_model.get_all_parameters()" + "diffusion_model.get_fittable_parameters()" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -352,9 +341,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.5" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/analysis1d.ipynb b/docs/docs/tutorials/analysis1d.ipynb index 784f2be50..5ee06676d 100644 --- a/docs/docs/tutorials/analysis1d.ipynb +++ b/docs/docs/tutorials/analysis1d.ipynb @@ -81,7 +81,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -95,9 +95,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/component_collection.ipynb b/docs/docs/tutorials/component_collection.ipynb index 54f763871..656fcf59f 100644 --- a/docs/docs/tutorials/component_collection.ipynb +++ b/docs/docs/tutorials/component_collection.ipynb @@ -67,7 +67,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -81,9 +81,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/components.ipynb b/docs/docs/tutorials/components.ipynb index 70070f1e0..eafa88973 100644 --- a/docs/docs/tutorials/components.ipynb +++ b/docs/docs/tutorials/components.ipynb @@ -39,7 +39,9 @@ "gaussian = sm.Gaussian(display_name='Gaussian', width=0.5, area=1)\n", "dho = sm.DampedHarmonicOscillator(display_name='DHO', center=1.0, width=0.3, area=2.0)\n", "lorentzian = sm.Lorentzian(display_name='Lorentzian', center=-1.0, width=0.2, area=1.0)\n", - "polynomial = sm.Polynomial(display_name='Polynomial', coefficients=[0.1, 0, 0.5]) # y=0.1+0.5*x^2\n", + "polynomial = sm.Polynomial(\n", + " display_name='Polynomial', coefficients=[-0.2, 0, 0.5]\n", + ") # y=-0.2+0.5*x^2\n", "exponential = sm.Exponential(display_name='Exponential', amplitude=1.0, rate=-0.5)\n", "\n", "x = np.linspace(-2, 2, 100)\n", @@ -59,6 +61,18 @@ "plt.show()" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "6db00a3e", + "metadata": {}, + "outputs": [], + "source": [ + "# Suppress the warning from the Polynomial:\n", + "polynomial.suppress_warnings = True\n", + "y = polynomial.evaluate(x)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -119,6 +133,14 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "id": "11884136", + "metadata": {}, + "source": [ + "The `ExpressionComponent` can create almost any function you would like. Units are supported and must be given for each parameter either at construction as below, or afterwards as properties. The individual parameters can be accessed by their name in the usual way. You must use `x` fore the x-axis. It will warn if the units are not consistent." + ] + }, { "cell_type": "code", "execution_count": null, @@ -129,6 +151,15 @@ "expr = sm.ExpressionComponent(\n", " 'A * exp(-(x - x0)**2 / (2*sigma**2)) +B*sin(2*pi*x/period)',\n", " parameters={'A': 10, 'x0': 0, 'sigma': 1},\n", + " parameter_units={\n", + " 'A': 'dimensionless',\n", + " 'x0': 'meV',\n", + " 'sigma': 'meV',\n", + " 'B': 'dimensionless',\n", + " 'period': 'meV',\n", + " },\n", + " x_unit='meV',\n", + " y_unit='dimensionless',\n", ")\n", "\n", "expr.A = 5\n", @@ -142,7 +173,9 @@ "plt.figure()\n", "plt.plot(x, y, label='Expression Component')\n", "plt.legend()\n", - "plt.show()" + "plt.show()\n", + "plt.xlabel('Energy (meV)')\n", + "plt.ylabel('Intensity (arb. units)')" ] }, { @@ -172,7 +205,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -186,9 +219,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/convolution.ipynb b/docs/docs/tutorials/convolution.ipynb index d37c38c14..2e9625559 100644 --- a/docs/docs/tutorials/convolution.ipynb +++ b/docs/docs/tutorials/convolution.ipynb @@ -51,8 +51,8 @@ "sample_components.append_component(delta)\n", "\n", "resolution_components = sm.ComponentCollection()\n", - "resolution_gaussian = sm.Gaussian(display_name='Resolution Gaussian', width=0.015, area=0.8)\n", - "resolution_lorentzian = sm.Lorentzian(display_name='Resolution Lorentzian', width=0.025, area=0.2)\n", + "resolution_gaussian = sm.Gaussian(display_name='Resolution Gaussian', width=0.05, area=0.8)\n", + "resolution_lorentzian = sm.Lorentzian(display_name='Resolution Lorentzian', width=0.05, area=0.2)\n", "resolution_components.append_component(resolution_gaussian)\n", "resolution_components.append_component(resolution_lorentzian)\n", "\n", @@ -210,7 +210,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -224,9 +224,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/data/create_fake_data.ipynb b/docs/docs/tutorials/data/create_fake_data.ipynb index e4ed0ee8c..55ac3822c 100644 --- a/docs/docs/tutorials/data/create_fake_data.ipynb +++ b/docs/docs/tutorials/data/create_fake_data.ipynb @@ -59,7 +59,7 @@ "intensity_dataarray.values += noise\n", "intensity_dataarray.variances = noise**2\n", "\n", - "sc.io.save_hdf5(intensity_dataarray, 'fake_simple_data.hdf5')\n", + "# sc.io.save_hdf5(intensity_dataarray, 'fake_simple_data.hdf5')\n", "pp.slicer(intensity_dataarray)" ] }, @@ -105,14 +105,14 @@ "intensity_dataarray.values += noise\n", "intensity_dataarray.variances = noise**2\n", "\n", - "sc.io.save_hdf5(intensity_dataarray, 'fake_advanced_data.hdf5')\n", + "# sc.io.save_hdf5(intensity_dataarray, 'fake_advanced_data.hdf5')\n", "pp.slicer(intensity_dataarray)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -126,7 +126,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/docs/docs/tutorials/data/fake_advanced_data.hdf5 b/docs/docs/tutorials/data/fake_advanced_data.hdf5 index d83903fb0..2a21cb285 100644 Binary files a/docs/docs/tutorials/data/fake_advanced_data.hdf5 and b/docs/docs/tutorials/data/fake_advanced_data.hdf5 differ diff --git a/docs/docs/tutorials/data/fake_simple_data.hdf5 b/docs/docs/tutorials/data/fake_simple_data.hdf5 index 14afb8306..bef9761a8 100644 Binary files a/docs/docs/tutorials/data/fake_simple_data.hdf5 and b/docs/docs/tutorials/data/fake_simple_data.hdf5 differ diff --git a/docs/docs/tutorials/delta_lorentz.ipynb b/docs/docs/tutorials/delta_lorentz.ipynb index 351358124..c1046f984 100644 --- a/docs/docs/tutorials/delta_lorentz.ipynb +++ b/docs/docs/tutorials/delta_lorentz.ipynb @@ -45,7 +45,7 @@ "energy = np.linspace(-2, 2, 501)\n", "scale = 1.0\n", "mean_u_squared = 0.5\n", - "A_0 = 0.2\n", + "A_0 = 0.01\n", "lorentzian_width = 0.2\n", "\n", "diffusion_model = sm.DeltaLorentz(\n", @@ -60,6 +60,25 @@ ")" ] }, + { + "cell_type": "markdown", + "id": "0aee03b1", + "metadata": {}, + "source": [ + "Both `A_0` and `lorentzian_width` are here allowed to vary with Q. We here change a few of them just to show how this impacts the model. The `# noqa` comment is because we are accessing private members of the model (ones beginning with `_`), which is generally discouraged. Because of these changes, in the figure below, the delta function at Q=1.25 Å^-1 is much larger than the other ones, and the Lorentzian at Q=1.75 Å^-1 is much narrower and taller than the other ones." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b9d4113", + "metadata": {}, + "outputs": [], + "source": [ + "diffusion_model._A_0_list[3].value = 0.02 # noqa\n", + "diffusion_model._lorentzian_width_list[5].value = 0.1 # noqa" + ] + }, { "cell_type": "code", "execution_count": null, @@ -96,7 +115,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -110,9 +129,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/detailed_balance.ipynb b/docs/docs/tutorials/detailed_balance.ipynb index 12d926a6d..bd6fccce3 100644 --- a/docs/docs/tutorials/detailed_balance.ipynb +++ b/docs/docs/tutorials/detailed_balance.ipynb @@ -86,7 +86,7 @@ ], "metadata": { "kernelspec": { - "display_name": "easydynamics_newbase", + "display_name": "default", "language": "python", "name": "python3" }, @@ -100,7 +100,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.12" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/docs/docs/tutorials/diffusion_model.ipynb b/docs/docs/tutorials/diffusion_model.ipynb index ddf9e9a0e..ffc26cc09 100644 --- a/docs/docs/tutorials/diffusion_model.ipynb +++ b/docs/docs/tutorials/diffusion_model.ipynb @@ -85,7 +85,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -99,9 +99,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/experiment.ipynb b/docs/docs/tutorials/experiment.ipynb index 0e6b7c5b4..8e265aff8 100644 --- a/docs/docs/tutorials/experiment.ipynb +++ b/docs/docs/tutorials/experiment.ipynb @@ -70,9 +70,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python (Pixi)", + "display_name": "default", "language": "python", - "name": "pixi-kernel-python3" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -84,9 +84,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.12" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/instrument_model.ipynb b/docs/docs/tutorials/instrument_model.ipynb index 27ccbb93a..99e05545a 100644 --- a/docs/docs/tutorials/instrument_model.ipynb +++ b/docs/docs/tutorials/instrument_model.ipynb @@ -75,7 +75,7 @@ ], "metadata": { "kernelspec": { - "display_name": "easydynamics_newbase", + "display_name": "default", "language": "python", "name": "python3" }, @@ -89,9 +89,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.12" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/sample_model.ipynb b/docs/docs/tutorials/sample_model.ipynb index fa34e8da1..0edad8e3e 100644 --- a/docs/docs/tutorials/sample_model.ipynb +++ b/docs/docs/tutorials/sample_model.ipynb @@ -61,7 +61,7 @@ " diffusion_models=diffusion_model,\n", " components=component_collection,\n", " Q=Q,\n", - " unit='meV',\n", + " x_unit='meV',\n", " display_name='MySampleModel',\n", " temperature=10,\n", ")\n", @@ -127,7 +127,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -141,9 +141,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/docs/docs/tutorials/tutorial0_basics.ipynb b/docs/docs/tutorials/tutorial0_basics.ipynb index 548c6c714..7efb5705f 100644 --- a/docs/docs/tutorials/tutorial0_basics.ipynb +++ b/docs/docs/tutorials/tutorial0_basics.ipynb @@ -366,7 +366,8 @@ "id": "d6e8ece6", "metadata": {}, "source": [ - "If you wish to customise the plot beyond what is immediately possible with EasyDynamics, you can get the data and model as a scipp datagroup. You may evaluate the model at different energies than the data like this." + "If you wish to customise the plot beyond what is immediately possible with EasyDynamics, you can get the data and model as a scipp D\n", + "atagroup. You may evaluate the model at different energies than the data like this." ] }, { @@ -386,7 +387,19 @@ "id": "842c1f01", "metadata": {}, "source": [ - "The final step in this tutorial is to fit the are of the `Gaussian` to a straight line. For this, we use the `ParameterAnalysis` class. We create a `Polynomial` with two coefficients for the fit function. We create a `FitBinding`, telling the class we want to fit the parameter named `Gaussian area` with the fit function that we define." + "The final step in this tutorial is to fit the area of the `Gaussian` as a function of Q using a straight line. For this, we use the `ParameterAnalysis` class.\n", + "\n", + "We create a `Polynomial` with two coefficients as the fit function. We then create a `FitBinding` to connect the parameter named `Gaussian area` to the fit function, and pass both to a `ParameterAnalysis` object:\n", + "\n", + "
\n", + " Note\n", + "
\n", + "Two units must be set on the fit function:\n", + "\n", + "- `x_unit='1/angstrom'` — because `ParameterAnalysis` always uses Q as its x-axis.\n", + "- `y_unit='meV'` — because we are fitting `Gaussian area`, which has unit `meV`.\n", + "
\n", + "
" ] }, { @@ -397,10 +410,13 @@ "outputs": [], "source": [ "fit_func = sm.Polynomial(\n", - " coefficients=[3.7, -0.5], name='Straight line', display_name='Straight line'\n", + " coefficients=[3.7, -0.5],\n", + " x_unit='1/angstrom',\n", + " y_unit='meV',\n", + " name='Straight line',\n", ")\n", "\n", - "binding = edyn.FitBinding(parameter_name='Gaussian area', model=fit_func)\n", + "binding = edyn.FitBinding(model=fit_func, targets='Gaussian area')\n", "\n", "parameter_analysis = edyn.ParameterAnalysis(\n", " parameters=analysis,\n", @@ -450,7 +466,7 @@ "id": "dc33728c", "metadata": {}, "source": [ - "To see the parameters we can use the `get_all_parameters()` method. We can also see only the parameters that can be fitted:" + "To see the parameters we can use the `get_all_parameters()` method. We can also see only the parameters that can be fitted using `get_fittable_parameters`:" ] }, { @@ -476,7 +492,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -490,7 +506,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/docs/docs/tutorials/tutorial0_more_advanced.ipynb b/docs/docs/tutorials/tutorial0_more_advanced.ipynb index f203dbdcb..da7469571 100644 --- a/docs/docs/tutorials/tutorial0_more_advanced.ipynb +++ b/docs/docs/tutorials/tutorial0_more_advanced.ipynb @@ -144,6 +144,13 @@ "
\n", " SampleModel, BackgroundModel and ResolutionModel (introduced later) all take components in several different ways: you can add a single component like in the previous tutorial, append components using the `append_component` method, or give a ComponentCollection like we do here. \n", "
\n", + "\n", + "\n", + "
\n", + " 💡 Tip\n", + "
\n", + " Polynomials will warn if they produce negative values, since negative backgrounds are unphysical. To suppress the warning, set suppress_warnings to True, either when constructing the Polynomial (polynomial=sm.Polynomial(coefficients=[0.0], suppress_warnings=True)), or afterwards (polynomial.suppress_warnings = True).\n", + "
\n", "
\n" ] }, @@ -300,7 +307,19 @@ "id": "0eadbd91", "metadata": {}, "source": [ - "With apologies for the lack of creativity, these all appear like straight lines. We can fit them individually or all together using `ParameterAnalysis`" + "With apologies for the lack of creativity, these all appear like straight lines. We can fit them individually or all together using `ParameterAnalysis`.\n", + "\n", + "For each parameter we want to fit, we create a fit function (here a `Polynomial`) and a `FitBinding` connecting the parameter name to the fit function. We then pass all bindings to a single `ParameterAnalysis` object:\n", + "\n", + "
\n", + " Note\n", + "
\n", + "Two units must be set on each fit function:\n", + "\n", + "- `x_unit='1/angstrom'` — because `ParameterAnalysis` always uses Q as its x-axis.\n", + "- `y_unit='meV'` — because all three parameters (`Gaussian area`, `DHO area`, `DHO center`) have unit `meV`.\n", + "
\n", + "
" ] }, { @@ -310,17 +329,21 @@ "metadata": {}, "outputs": [], "source": [ - "gauss_fit_func = sm.Polynomial(coefficients=[3.7, -0.5], unit='1/angstrom', name='Gauss area fit')\n", - "dho_area_fit_func = sm.Polynomial(coefficients=[2.0, 0.12], unit='1/angstrom', name='DHO area fit')\n", + "gauss_fit_func = sm.Polynomial(\n", + " coefficients=[3.7, -0.5], x_unit='1/angstrom', y_unit='meV', name='Gauss area fit'\n", + ")\n", + "dho_area_fit_func = sm.Polynomial(\n", + " coefficients=[2.0, 0.12], x_unit='1/angstrom', y_unit='meV', name='DHO area fit'\n", + ")\n", "dho_center_fit_func = sm.Polynomial(\n", - " coefficients=[1.1, 0.2], unit='1/angstrom', name='DHO center fit'\n", + " coefficients=[1.1, 0.2], x_unit='1/angstrom', y_unit='meV', name='DHO center fit'\n", ")\n", "\n", - "binding1 = edyn.FitBinding(parameter_name='Gaussian area', model=gauss_fit_func)\n", + "binding1 = edyn.FitBinding(model=gauss_fit_func, targets='Gaussian area')\n", "\n", - "binding2 = edyn.FitBinding(parameter_name='DHO area', model=dho_area_fit_func)\n", + "binding2 = edyn.FitBinding(model=dho_area_fit_func, targets='DHO area')\n", "\n", - "binding3 = edyn.FitBinding(parameter_name='DHO center', model=dho_center_fit_func)\n", + "binding3 = edyn.FitBinding(model=dho_center_fit_func, targets='DHO center')\n", "\n", "parameter_analysis = edyn.ParameterAnalysis(\n", " parameters=analysis,\n", @@ -335,7 +358,7 @@ "id": "32bc1efc", "metadata": {}, "source": [ - "The start guesses look reasonable, so we fit:" + "The start guesses look reasonable, so we fit and plot the result:" ] }, { @@ -352,7 +375,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -366,7 +389,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/docs/docs/tutorials/tutorial1_brownian.ipynb b/docs/docs/tutorials/tutorial1_brownian.ipynb index 269bb2599..bb6403252 100644 --- a/docs/docs/tutorials/tutorial1_brownian.ipynb +++ b/docs/docs/tutorials/tutorial1_brownian.ipynb @@ -451,7 +451,7 @@ "$$\n", "where $\\Gamma(Q) = D Q^2$ and $D$ is the diffusion coefficient. $S$ is an overall scale.\n", "\n", - "To fit the Brownian translational diffusion model to the data, we use the `ParameterAnalysis`. This time, we wish to fit the `Lorentzian`, and we wish to fit both its area (scale, $S$) and width to the diffusion model. We do this by creating a `FitBinding`, saying we want to fit both the area an width of the component called `Lorentzian`" + "To fit the Brownian translational diffusion model to the data, we use the `ParameterAnalysis`. This time, we wish to fit the `Lorentzian`, and we wish to fit both its area (scale, $S$) and width to the diffusion model. We do this by creating a `FitBinding`. Because the diffusion model's `lorentzian_name` matches the fitted component's name, the default targets automatically fit both the area and the width against the `Lorentzian area` and `Lorentzian width` parameters" ] }, { @@ -462,18 +462,17 @@ "outputs": [], "source": [ "brownian_diffusion_model = sm.BrownianTranslationalDiffusion(\n", - " name='Brownian Translational Diffusion', diffusion_coefficient=2.4e-9, scale=0.5\n", + " name='Brownian Translational Diffusion',\n", + " lorentzian_name='Lorentzian',\n", + " diffusion_coefficient=2.4e-9,\n", + " scale=0.5,\n", ")\n", "\n", - "binding = edyn.FitBinding(\n", - " parameter_name='Lorentzian',\n", - " model=brownian_diffusion_model,\n", - " modes=['area', 'width'],\n", - ")\n", + "binding = edyn.FitBinding(model=brownian_diffusion_model)\n", "\n", "parameter_analysis = edyn.ParameterAnalysis(\n", " parameters=diffusion_analysis,\n", - " bindings=[binding],\n", + " bindings=binding,\n", ")" ] }, @@ -495,16 +494,6 @@ "parameter_analysis.plot()" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "57b76d06", - "metadata": {}, - "outputs": [], - "source": [ - "parameter_analysis.plot(names=['Polynomial_c0'])" - ] - }, { "cell_type": "markdown", "id": "64babb01", @@ -691,7 +680,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -705,7 +694,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/docs/docs/tutorials/tutorial2_nanoparticles.ipynb b/docs/docs/tutorials/tutorial2_nanoparticles.ipynb index 22de24900..cca884bb2 100644 --- a/docs/docs/tutorials/tutorial2_nanoparticles.ipynb +++ b/docs/docs/tutorials/tutorial2_nanoparticles.ipynb @@ -593,7 +593,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -607,7 +607,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.5" + "version": "3.14.6" } }, "nbformat": 4, diff --git a/tests/performance_tests/convolution/convolution_width_thresholds.ipynb b/tests/performance_tests/convolution/convolution_width_thresholds.ipynb index fbb5df296..543002d54 100644 --- a/tests/performance_tests/convolution/convolution_width_thresholds.ipynb +++ b/tests/performance_tests/convolution/convolution_width_thresholds.ipynb @@ -48,7 +48,7 @@ ")\n", "numerical_convolver.upsample_factor = None\n", "for gwidth in gaussian_widths:\n", - " sample_components.components[0].width = gwidth\n", + " sample_components[0].width = gwidth\n", " y_analytical = analytical_convolver.convolution()\n", "\n", " y_numerical = numerical_convolver.convolution()\n", @@ -106,8 +106,8 @@ ")\n", "numerical_convolver.upsample_factor = None\n", "for gwidth, gcenter in zip(gaussian_widths, gaussian_centers, strict=True):\n", - " sample_components.components[0].width = gwidth\n", - " sample_components.components[0].center = gcenter\n", + " sample_components[0].width = gwidth\n", + " sample_components[0].center = gcenter\n", " y_analytical = analytical_convolver.convolution()\n", "\n", " y_numerical = numerical_convolver.convolution()\n", @@ -135,7 +135,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "default", "language": "python", "name": "python3" }, @@ -149,7 +149,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.14.4" + "version": "3.14.5" } }, "nbformat": 4, diff --git a/tests/performance_tests/utils/detailed_balance_approximations.ipynb b/tests/performance_tests/utils/detailed_balance_approximations.ipynb index f50de3cf5..7b5a75fa0 100644 --- a/tests/performance_tests/utils/detailed_balance_approximations.ipynb +++ b/tests/performance_tests/utils/detailed_balance_approximations.ipynb @@ -42,8 +42,6 @@ "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", - "\n", "x = np.linspace(1e-10, 1e-5, 1000)\n", "\n", "y = x / (1 - np.exp(-x))\n", @@ -62,7 +60,7 @@ ], "metadata": { "kernelspec": { - "display_name": "newdynamics", + "display_name": "default", "language": "python", "name": "python3" }, @@ -76,7 +74,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.13" + "version": "3.14.5" } }, "nbformat": 4,