Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aadcb7e
Adding sphinx_design for tutorial page.
SimoneMartino98 Jan 22, 2026
8994f73
Revising the index.
SimoneMartino98 Jan 22, 2026
99b26a7
Added the first tutorial.
SimoneMartino98 Jan 22, 2026
5a328d5
styling for tutorial cards.
SimoneMartino98 Jan 22, 2026
8c29940
Added dynsight workflow page (WIP).
SimoneMartino98 Jan 22, 2026
01117c8
Added workflow page.
SimoneMartino98 Jan 22, 2026
747ab5e
added doc string.
SimoneMartino98 Jan 22, 2026
1b23a2c
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
6b4cace
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
38bad39
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
5ec3847
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
e78d347
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
82cc4b2
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
aafac9c
Update docs/source/tutorials/getting_started.rst
SimoneMartino98 Jan 23, 2026
c803ccc
Removing unused files and minor fixes.
SimoneMartino98 Jan 23, 2026
fa84054
suppressing link duplicate warning in doc.
SimoneMartino98 Jan 23, 2026
fac432f
minor fixes.
SimoneMartino98 Jan 23, 2026
dcbfd6b
using anonymous links.
SimoneMartino98 Jan 23, 2026
89ccfbe
added new tutorial cards.
SimoneMartino98 Jan 23, 2026
f29d540
fixed typo.
SimoneMartino98 Jan 26, 2026
d7cc023
missing part added.
SimoneMartino98 Jan 26, 2026
851d363
minor.
SimoneMartino98 Jan 26, 2026
48a5b4c
Added spatial denoising tutorial.
SimoneMartino98 Jan 26, 2026
14c975f
updated simulation files and minor changes.
SimoneMartino98 Jan 26, 2026
8874215
link to the github example folder.
SimoneMartino98 Jan 26, 2026
3e80284
added note on the units used.
SimoneMartino98 Jan 26, 2026
1a62e45
minor fixes.
SimoneMartino98 Jan 26, 2026
4752261
minor fixes.
SimoneMartino98 Jan 26, 2026
dfba7b2
excluding .DS_Store file (mac users)
SimoneMartino98 Jan 26, 2026
bf27483
Updating docs.
SimoneMartino98 Jan 26, 2026
b2bff4c
warning on SOAP computation.
SimoneMartino98 Jan 26, 2026
81b7ebf
update readme with the tutorials page.
SimoneMartino98 Jan 26, 2026
3b892c6
doctests added.
SimoneMartino98 Jan 26, 2026
cc8d379
minor fixes.
SimoneMartino98 Jan 27, 2026
a90a727
ignoring simulations offsets.
SimoneMartino98 Jan 27, 2026
8d85707
formatting code-blocks.
SimoneMartino98 Jan 27, 2026
860ea29
added .meta content example.
SimoneMartino98 Jan 27, 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ examples/analysis_workflow/colored_trj.xyz
examples/info_gain/trj_*.npy
tests/systems/coex/.*
tests/systems/.*
.DS_Store
Copy link
Collaborator

Choose a reason for hiding this comment

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

just delete these off your computer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's macOS; every mac user will have this annoying and useless DS_Store. I would ignore it.

If it's a problem, i'll remove that line

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like things you can just delete, but all good.

.ice_water_ox.xtc_offsets.lock
.ice_water_ox.xtc_offsets.npz

.mypy_cache
.pytest_cache
.ruff_cache
.venv

10 changes: 7 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ Developer Setup

.. _`just`: https://github.com/casey/just

Examples
========
Tutorials and examples
======================

We provide and continuously update a set of tutorials to help new users to
get started with ``dynsight``. They are available at the following link:
https://dynsight.readthedocs.io/en/latest/tutorials_menu.html.

There are examples throughout the documentation and available in
There are also examples throughout the documentation and available in
the ``examples/`` directory of this repository.

Related works and packages
Expand Down
Empty file removed docs/source/_static/empty
Empty file.
45 changes: 45 additions & 0 deletions docs/source/_static/recipes/getting_started.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Code from the Getting Started tutorial."""

from pathlib import Path

from dynsight.trajectory import Trj


def main() -> None:
"""Code from the Getting Started tutorial."""
# Loading an example trajectory
files_path = Path("Path/to/the/folder/where/files/are/stored")
trj = Trj.init_from_xtc(
traj_file=files_path / "ice_water_ox.xtc",
topo_file=files_path / "ice_water_ox.gro",
)
# Computing a descriptor
# Adjust n_jobs according to your computer capabilities
lens = trj.get_lens(r_cut=10, n_jobs=4)

# Performing Onion Clustering on the descriptor computed
lens_onion = lens.get_onion_smooth(delta_t=10)

# Plotting the results
lens_onion.plot_output(
file_path=files_path / "output_plot.png",
data_insight=lens,
)
lens_onion.plot_one_trj(
file_path=files_path / "single_trj.png",
data_insight=lens,
particle_id=1234,
)

# Exporting a colored trajectory based on the clustering results
trajslice = slice(0, -1, 1)
sliced_trj = trj.with_slice(trajslice=trajslice)

lens_onion.dump_colored_trj(
trj=sliced_trj,
file_path=files_path / "colored_trj.xyz",
)


if __name__ == "__main__":
main()
68 changes: 68 additions & 0 deletions docs/source/_static/recipes/spatial_denoising.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"""Code from the Spatial Denoising tutorial."""

from pathlib import Path

from dynsight.trajectory import Trj


def main() -> None:
"""Code from the Spatial Denoising tutorial."""
# Loading an example trajectory
files_path = Path("INPUT")
trj = Trj.init_from_xtc(
traj_file=files_path / "ice_water_ox.xtc",
topo_file=files_path / "ice_water_ox.gro",
)

# Computing SOAP descriptor
soap = trj.get_soap(
r_cut=10,
n_max=8,
l_max=8,
n_jobs=4, # Adjust n_jobs according to your computer capabilities
)

# Computing TimeSOAP descriptor
_, tsoap = trj.get_timesoap(
soap_insight=soap,
)

# Performing Onion Clustering on the descriptor computed
tsoap.get_onion_analysis(
delta_t_min=2,
delta_t_num=20,
fig1_path=files_path / "onion_analysis.png",
)

# Applying Spatial Denoising
sliced_trj = trj.with_slice(slice(0, -1, 1))
sp_denoised_tsoap = tsoap.spatial_average(
trj=sliced_trj,
r_cut=10,
n_jobs=4, # Adjust n_jobs according to your computer capabilities
)

# Performing Onion Clustering on the descriptor computed
sp_denoised_tsoap.get_onion_analysis(
delta_t_min=2,
delta_t_num=20,
fig1_path=files_path / "denoised_onion_analysis.png",
)

single_point_onion = tsoap.get_onion_smooth(
delta_t=37,
)
single_point_onion.dump_colored_trj(
sliced_trj, files_path / "onion_trj.xyz"
)

denoised_single_point_onion = sp_denoised_tsoap.get_onion_smooth(
delta_t=37,
)
denoised_single_point_onion.dump_colored_trj(
sliced_trj, files_path / "onion_trj_denoised.xyz"
)


if __name__ == "__main__":
main()
2,051 changes: 2,051 additions & 0 deletions docs/source/_static/simulations/ice_water_ox.gro

Large diffs are not rendered by default.

Binary file added docs/source/_static/simulations/ice_water_ox.xtc
Binary file not shown.
24 changes: 24 additions & 0 deletions docs/source/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,27 @@
top: 0;
}
}

.tutorial-card {
height: 280px;
display: flex;
flex-direction: column;
text-align: center;
}

.tutorial-card-img {
height: 180px;
width: 100%;
object-fit: contain;
margin: 0 auto;
display: block;
}


.tutorial-card-title {
margin-top: auto;
padding-top: 10px;
font-weight: 600;
text-align: center;
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/workflow.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx.ext.mathjax",
"sphinx_design",
]

# Check if SOAPify is available
Expand Down
96 changes: 0 additions & 96 deletions docs/source/example_analysis_workflow.rst

This file was deleted.

Loading