From a333754d6234dad43c178b345ca0d494f3e5685d Mon Sep 17 00:00:00 2001 From: sici17 Date: Sun, 4 Oct 2026 16:19:03 +0200 Subject: [PATCH 1/2] DOC: explain boolean frame masks in trajectory analysis Signed-off-by: sici17 --- .../analysis/custom_trajectory_analysis.ipynb | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/source/examples/analysis/custom_trajectory_analysis.ipynb b/doc/source/examples/analysis/custom_trajectory_analysis.ipynb index cc9675527..14e47e989 100644 --- a/doc/source/examples/analysis/custom_trajectory_analysis.ipynb +++ b/doc/source/examples/analysis/custom_trajectory_analysis.ipynb @@ -410,6 +410,38 @@ "plt.xlabel('Frame')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also select frames by passing a mask to the `frames` argument of the `run()` method. The mask contains one boolean value per frame; only frames marked `True` are analysed. The mask can be a NumPy boolean array or a Python list of booleans.\n", + "\n", + "For example, the following mask selects every second frame:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "mask = np.zeros(len(u.trajectory), dtype=bool)\n", + "mask[::2] = True\n", + "\n", + "rog_masked = AnalysisFromFunction(\n", + " radgyr, u.trajectory, protein, protein.masses,\n", + " total_mass=np.sum(protein.masses),\n", + ")\n", + "rog_masked.run(frames=mask);" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also pass an array of integers to `frames`; in that case, the array directly specifies the frame indices to analyse." + ] + }, { "cell_type": "markdown", "metadata": {}, From 66f797e9da192fc29a1998df6d3d6ddb77302218 Mon Sep 17 00:00:00 2001 From: sici17 Date: Sun, 4 Oct 2026 16:21:14 +0200 Subject: [PATCH 2/2] DOC: add Francesco Siciliani to User Guide authors Signed-off-by: sici17 --- doc/source/AUTHORS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/AUTHORS b/doc/source/AUTHORS index 5f7f959eb..fb5cfc517 100644 --- a/doc/source/AUTHORS +++ b/doc/source/AUTHORS @@ -46,3 +46,5 @@ Chronological list of authors - Rubén Chaves 2025 - Yu-Yuan (Stuart) Yang +2026 + - Francesco Siciliani