Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.10.0
_commit: v0.10.1-2-gd05af4f
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/dynamics-app
app_doi: 10.5281/zenodo.18163581
app_doi: 10.5281/zenodo.18877180
app_package_name: easydynamics_app
app_python: '3.12'
app_repo_name: dynamics-app
home_page_url: https://easyscience.github.io/dynamics
home_repo_name: dynamics
lib_docs_url: https://easyscience.github.io/dynamics-lib
lib_doi: 10.5281/zenodo.18163581
lib_doi: 10.5281/zenodo.18877180
lib_package_name: easydynamics
lib_python_max: '3.12'
lib_python_min: '3.11'
Expand Down
14 changes: 6 additions & 8 deletions docs/docs/assets/javascripts/extra.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(function() {

"use strict"
;(function () {
'use strict'

// Variables
const header = document.getElementsByTagName('header')[0]
Expand All @@ -10,20 +9,19 @@
// Hide-show header shadow
function toggleHeaderShadow() {
if (window.pageYOffset <= 0) {
header.classList.remove("md-header--shadow")
header.classList.remove('md-header--shadow')
} else {
header.classList.add("md-header--shadow")
header.classList.add('md-header--shadow')
}
}

// Onload
window.onload = function() {
window.onload = function () {
toggleHeaderShadow()
}

// Onscroll
window.onscroll = function() {
window.onscroll = function () {
toggleHeaderShadow()
}

})()
18 changes: 12 additions & 6 deletions docs/docs/assets/javascripts/mathjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ window.MathJax = {
//inlineMath: [['\\(', '\\)']],
//displayMath: [['\\[', '\\]']],
// Add support for $...$ and \(...\) delimiters
inlineMath: [['$', '$'], ['\\(', '\\)']],
inlineMath: [
['$', '$'],
['\\(', '\\)'],
],
// Add support for $$...$$ and \[...]\ delimiters
displayMath: [['$$', '$$'], ['\\[', '\\]']],
displayMath: [
['$$', '$$'],
['\\[', '\\]'],
],
processEscapes: true,
processEnvironments: true
processEnvironments: true,
},
options: {
//ignoreHtmlClass: ".*|",
//processHtmlClass: "arithmatex"
// Skip code blocks only
skipHtmlTags: ['script','noscript','style','textarea','pre','code'],
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
// Only ignore explicit opt-out
ignoreHtmlClass: 'no-mathjax|tex2jax_ignore',
}
};
},
}

document$.subscribe(() => {
MathJax.startup.output.clearCache()
Expand Down
35 changes: 9 additions & 26 deletions docs/docs/installation-and-setup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,49 +225,32 @@ Google Colab.

If you decide to run the tutorials locally, you need to download them
first. This can be done individually via the :material-download:
**Download Notebook** button available on each tutorial page, or all at
once using the command line, as shown below.
**Download Notebook** button available on each tutorial page.

### Run Tutorials Locally with Pixi <small>recommended</small> { #running-with-pixi data-toc-label="Run Tutorials Locally with Pixi" }

- Navigate to your existing Pixi project, created as described in the
[Installing with Pixi](#installing-with-pixi) section.
- Add JupyterLab and the Pixi kernel for Jupyter:
- Launch the Jupyter Lab server:
```txt
pixi add --pypi jupyterlab pixi-kernel
```
- Download all the EasyDynamics tutorials to the `tutorials/` directory:
```txt
pixi run easydynamics download-all-tutorials
```
- Start JupyterLab in the `tutorials/` directory to access the
notebooks:
```txt
pixi run jupyter lab tutorials/
pixi run jupyter lab
```
- Your web browser should open automatically. Click on one of the
`*.ipynb` files and select the `Python (Pixi)` kernel to get started.
`*.ipynb` files downloaded previously and select the `Python (Pixi)`
kernel to get started.

### Classical Run Tutorials Locally

- Install Jupyter Notebook and IPython kernel:
```txt
pip install notebook ipykernel
```
- Add the virtual environment as a Jupyter kernel:
```txt
python -m ipykernel install --user --name=venv --display-name "EasyDynamics Python kernel"
```
- Download all the EasyDynamics tutorials to the `tutorials/` directory:
```txt
python -m easydynamics download-all-tutorials
```
- Launch the Jupyter Notebook server (opens browser automatically at
`http://localhost:8888/`):
- Launch the Jupyter Notebook server:
```txt
jupyter notebook tutorials/
jupyter notebook
```
- Open one of the `*.ipynb` files and select the
- Your web browser should open automatically. Click on one of the
`*.ipynb` files downloaded previously and select the
`EasyDynamics Python kernel` to get started.

### Run Tutorials via Google Colab
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Zenodo, each with a version-specific Digital Object Identifier (DOI).

Citation details in various styles (e.g., APA, MLA) and formats (e.g.,
BibTeX, JSON) are available on the
[Zenodo archive page](https://doi.org/10.5281/zenodo.18163581).
[Zenodo archive page](https://doi.org/10.5281/zenodo.18877180).

## Contributing

Expand Down
22 changes: 17 additions & 5 deletions docs/docs/tutorials/analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"outputs": [],
"source": [
"# Imports\n",
"import pooch\n",
"\n",
"from easydynamics.analysis.analysis import Analysis\n",
"from easydynamics.experiment import Experiment\n",
"from easydynamics.sample_model import BrownianTranslationalDiffusion\n",
Expand All @@ -46,7 +48,12 @@
"source": [
"# Load the vanadium data\n",
"vanadium_experiment = Experiment('Vanadium')\n",
"vanadium_experiment.load_hdf5(filename='vanadium_data_example.h5')"
"file_path = pooch.retrieve(\n",
" url='https://github.com/easyscience/dynamics-lib/raw/refs/heads/docs/docs/docs/tutorials/data/vanadium_data_example.h5',\n",
" known_hash='16cc1b327c303feeb88fb9dda5390dc4880b62396b1793f98c6fef0b27c7b873',\n",
")\n",
"\n",
"vanadium_experiment.load_hdf5(filename=file_path)"
]
},
{
Expand Down Expand Up @@ -164,7 +171,12 @@
"# Now it's time to look at the data we want to fit. We first load the\n",
"# data\n",
"diffusion_experiment = Experiment('Diffusion')\n",
"diffusion_experiment.load_hdf5(filename='diffusion_data_example.h5')"
"\n",
"file_path = pooch.retrieve(\n",
" url='https://github.com/easyscience/dynamics-lib/raw/refs/heads/docs/docs/docs/tutorials/data/diffusion_data_example.h5',\n",
")\n",
"\n",
"diffusion_experiment.load_hdf5(filename=file_path)"
]
},
{
Expand Down Expand Up @@ -330,9 +342,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "easydynamics_newbase",
"display_name": "Python (Pixi)",
"language": "python",
"name": "python3"
"name": "pixi-kernel-python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -344,7 +356,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.13"
}
},
"nbformat": 4,
Expand Down
26 changes: 18 additions & 8 deletions docs/docs/tutorials/analysis1d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "bca91d3c",
"metadata": {},
"outputs": [],
"source": [
"import pooch\n",
"\n",
"from easydynamics.analysis.analysis1d import Analysis1d\n",
"from easydynamics.experiment import Experiment\n",
"from easydynamics.sample_model import DeltaFunction\n",
Expand All @@ -31,18 +33,25 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "8deca9b6",
"metadata": {},
"outputs": [],
"source": [
"vanadium_experiment = Experiment('Vanadium')\n",
"vanadium_experiment.load_hdf5(filename='vanadium_data_example.h5')"
"\n",
"file_path = pooch.retrieve(\n",
" url='https://github.com/easyscience/dynamics-lib/raw/refs/heads/docs/docs/docs/tutorials/data/vanadium_data_example.h5',\n",
" known_hash='16cc1b327c303feeb88fb9dda5390dc4880b62396b1793f98c6fef0b27c7b873',\n",
")\n",
"\n",
"\n",
"vanadium_experiment.load_hdf5(filename=file_path)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "41f842f0",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -73,15 +82,16 @@
")\n",
"\n",
"fit_result = my_analysis.fit()\n",
"fig = my_analysis.plot_data_and_model()"
"fig = my_analysis.plot_data_and_model()\n",
"fig"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "easydynamics_newbase",
"display_name": "Python (Pixi)",
"language": "python",
"name": "python3"
"name": "pixi-kernel-python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -93,7 +103,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
"version": "3.12.13"
}
},
"nbformat": 4,
Expand Down
15 changes: 12 additions & 3 deletions docs/docs/tutorials/experiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"metadata": {},
"outputs": [],
"source": [
"import pooch\n",
"\n",
"from easydynamics.experiment import Experiment\n",
"\n",
"%matplotlib widget"
Expand All @@ -29,8 +31,15 @@
"outputs": [],
"source": [
"# Load and plot example vanadium data\n",
"# Load the vanadium data\n",
"vanadium_experiment = Experiment('Vanadium')\n",
"vanadium_experiment.load_hdf5(filename='vanadium_data_example.h5')\n",
"\n",
"file_path = pooch.retrieve(\n",
" url='https://github.com/easyscience/dynamics-lib/raw/refs/heads/docs/docs/docs/tutorials/data/vanadium_data_example.h5',\n",
" known_hash='16cc1b327c303feeb88fb9dda5390dc4880b62396b1793f98c6fef0b27c7b873',\n",
")\n",
"\n",
"vanadium_experiment.load_hdf5(filename=file_path)\n",
"\n",
"vanadium_experiment.plot_data()"
]
Expand Down Expand Up @@ -61,9 +70,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "easydynamics_newbase",
"display_name": "Python (Pixi)",
"language": "python",
"name": "python3"
"name": "pixi-kernel-python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
28 changes: 21 additions & 7 deletions docs/docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,34 @@ The tutorials are organized into the following categories:

## Getting Started

- [Component collection](component_collection.ipynb) – Learn how to
create a collectin of components for fitting.
We are working on expanding the list of tutorials to include advanced
concept such as interpolating `Parameter`s, sharing `Parameter`s at
multiple `Q` and analysing complex inelastic data.

- [Tutorial 1: Brownian Diffusion](tutorial1_brownian.ipynb) - Learn how
to analyse QENS data with elastic incoherent background and Brownian
diffusion.

## Classes and Methods

Here we go into more detail with each class that is used in the
tutorials.

- [Components](components.ipynb) – Learn how to use the EasyDynamics
components.
model components, which are the basic building blocks of your model.
- [Component collection](component_collection.ipynb) – Learn how to
create a collection of components for fitting.
- [Convolution](convolution.ipynb) – Learn how to calculate the
convolution of your resolution function with your model.
- [Detailed balance](detailed_balance.ipynb) – Learn how to apply
detailed balancing to your model.
- [Detailed balance](detailed_balance.ipynb) – Learn about detailed
balancing.
- [Diffusion model](diffusion_model.ipynb) – Learn how to create and use
a model of diffusion.
- [Sample model](sample_model.ipynb) – Learn how to create a model of
the scattering from your sample.
the scattering from your sample including model components and
diffusion models.
- [Instrument model](instrument_model.ipynb) – Learn how to create a.
model of your instrument.
model of your instrument including resolution and background.
- [Experiment](experiment.ipynb) - Learn how to load and bin your data.
- [Analysis](analysis.ipynb) - Learn how to fit a model to your data.
- [Analysis 1D](analysis1d.ipynb) - Learn how to fit a model to your
Expand Down
Loading