Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8dfeb08
overhaul units
henrikjacobsenfys Jun 22, 2026
5a2d9ce
claude review
henrikjacobsenfys Jun 23, 2026
a6c6294
Claude second review
henrikjacobsenfys Jun 23, 2026
cd6fcfe
claude third review
henrikjacobsenfys Jun 23, 2026
bac24e9
Simplifications
henrikjacobsenfys Jun 23, 2026
eced18a
claude 4th review
henrikjacobsenfys Jun 23, 2026
44e7a25
Merge develop into feature/unit-system-overhaul
henrikjacobsenfys Jun 23, 2026
4758439
Fix post-merge issues from develop's old unit API
henrikjacobsenfys Jun 23, 2026
f02845e
Claude 5th review
henrikjacobsenfys Jun 23, 2026
e90c9b1
Claude 6th review
henrikjacobsenfys Jun 23, 2026
3f59e3e
Claude 7th review
henrikjacobsenfys Jun 24, 2026
ced344a
Added regression tests
henrikjacobsenfys Jun 24, 2026
477a2bf
Clear notebooks
henrikjacobsenfys Jun 24, 2026
a42aa84
remove metadata from notebooks
henrikjacobsenfys Jun 24, 2026
4e5512d
Add missing tests
henrikjacobsenfys Jun 24, 2026
c241ac1
Claude's response to my comments
henrikjacobsenfys Jun 25, 2026
837fb6b
Bug fix
henrikjacobsenfys Jun 25, 2026
55b5e01
simplify unit conversion
henrikjacobsenfys Jun 25, 2026
4aeca78
Cluade responds to review
henrikjacobsenfys Jun 26, 2026
055c969
Update tests
henrikjacobsenfys Jun 29, 2026
d56814e
Add WHEN THEN EXPECT to tests
henrikjacobsenfys Jun 29, 2026
89c727a
Update tests
henrikjacobsenfys Jun 29, 2026
79fac86
Update test
henrikjacobsenfys Jun 29, 2026
684a105
Update tests
henrikjacobsenfys Jun 29, 2026
aec7d58
update tests
henrikjacobsenfys Jun 30, 2026
25bd85d
human review part 1
henrikjacobsenfys Jun 30, 2026
7c4c193
Claude fix impacted tests
henrikjacobsenfys Jun 30, 2026
4f7483e
Humar review part 2
henrikjacobsenfys Jun 30, 2026
dcc4e79
claude and pixi
henrikjacobsenfys Jun 30, 2026
f8c5c01
fix ParameterAnalysis units
henrikjacobsenfys Jun 30, 2026
80ca5fc
update tutorial
henrikjacobsenfys Jun 30, 2026
b20cd24
add tests to close codecov/patch coverage gap
henrikjacobsenfys Jun 30, 2026
6313bf8
fix ModelComponent.x_unit/y_unit returning str(None) and replace all …
henrikjacobsenfys Jun 30, 2026
da71f4f
FIx notebooks
henrikjacobsenfys Jun 30, 2026
83e1c8c
Show example of how to suppress warnings from polynomial
henrikjacobsenfys Jun 30, 2026
acd5d15
Update tests
henrikjacobsenfys Jul 1, 2026
6a00c25
Move Q index check completely to utils
henrikjacobsenfys Jul 1, 2026
97fece1
Fix test warnings
henrikjacobsenfys Jul 1, 2026
676ba93
Fable review
henrikjacobsenfys Jul 2, 2026
3baf4e2
improve expression_component and add some tests
henrikjacobsenfys Jul 2, 2026
dda98e1
ensure convert unit doesn't regenerate component collections
henrikjacobsenfys Jul 3, 2026
1e9651e
Update ParameterAnalysis to fix some unit bugs
henrikjacobsenfys Jul 3, 2026
adad8af
Use scipp to store Q
henrikjacobsenfys Jul 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/docs/tutorials/analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -351,10 +351,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
9 changes: 4 additions & 5 deletions docs/docs/tutorials/analysis1d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -94,10 +94,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.5"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
9 changes: 4 additions & 5 deletions docs/docs/tutorials/component_collection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -80,10 +80,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
20 changes: 17 additions & 3 deletions docs/docs/tutorials/components.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -172,7 +186,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "default",
"language": "python",
"name": "python3"
},
Expand All @@ -191,4 +205,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
9 changes: 4 additions & 5 deletions docs/docs/tutorials/convolution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -223,10 +223,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Binary file modified docs/docs/tutorials/data/fake_advanced_data.hdf5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be rebuilt, outcomment relevant parts of notebook

Binary file not shown.
Binary file modified docs/docs/tutorials/data/fake_simple_data.hdf5
Binary file not shown.
9 changes: 4 additions & 5 deletions docs/docs/tutorials/delta_lorentz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -109,10 +109,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
7 changes: 3 additions & 4 deletions docs/docs/tutorials/detailed_balance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "easydynamics_newbase",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -99,8 +99,7 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
9 changes: 4 additions & 5 deletions docs/docs/tutorials/diffusion_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -98,10 +98,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.4"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
9 changes: 4 additions & 5 deletions docs/docs/tutorials/experiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (Pixi)",
"language": "python",
"name": "pixi-kernel-python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -83,10 +83,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
9 changes: 4 additions & 5 deletions docs/docs/tutorials/instrument_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "easydynamics_newbase",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -88,10 +88,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
11 changes: 5 additions & 6 deletions docs/docs/tutorials/sample_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -127,9 +127,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -140,10 +140,9 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.5"
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
}
25 changes: 20 additions & 5 deletions docs/docs/tutorials/tutorial0_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,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",
"<details>\n",
" <summary><strong>Note</strong></summary>\n",
"<div style=\"border-left: 4px solid #2196F3; background:#e3f2fd; padding:10px;\">\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",
"</div>\n",
"</details>"
]
},
{
Expand All @@ -397,10 +409,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",
Expand Down Expand Up @@ -450,7 +465,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`:"
]
},
{
Expand All @@ -476,7 +491,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "default",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading