src/python_access/plot.rs

changeset 3
c3a4f4bb87f7
parent 1
a4137aedcb3a
--- a/src/python_access/plot.rs	Thu Feb 26 09:32:12 2026 -0500
+++ b/src/python_access/plot.rs	Wed Apr 22 22:32:00 2026 -0500
@@ -1,3 +1,6 @@
+/*!
+ Access to Python-side plotter implementations.
+*/
 use super::process_error;
 use alg_tools::types::Float;
 use pointsource_algs::measures::RNDM;
@@ -7,9 +10,12 @@
 use pyo3::prelude::*;
 use std::marker::PhantomData;
 
+/// A factor for generating a [`PythonPlotter`].
 #[derive(Debug, Clone)]
 pub struct PythonPlotFactory<'py, T1, T2> {
+    /// Python side object implementing the plot factory
     pub(super) obj: Option<Bound<'py, PyAny>>,
+    /// Phantoms
     pub(super) _phantoms: PhantomData<(T1, T2)>,
 }
 
@@ -24,8 +30,10 @@
     }
 }
 
+/// Python-side implementation of [`Plotter`]
 #[derive(Debug, Clone)]
 pub struct PythonPlotter<'py, T1, T2> {
+    /// Python side object implementing the [`Plotter`]
     pub(super) obj: Option<Bound<'py, PyAny>>,
     pub(super) _phantoms: PhantomData<(T1, T2)>,
 }
@@ -60,12 +68,15 @@
 }
 
 impl<'py, T1, T2> PythonPlotFactory<'py, T1, T2> {
+    /// Creates a dummy plotter factory that doe snothing
     pub fn dummy() -> Self {
         PythonPlotFactory { obj: None, _phantoms: PhantomData }
     }
 }
 
 impl<'py, T1: Clone, T2: Clone> PythonPlotFactory<'py, T1, T2> {
+    /// Produces a [`PythonPlotter`] out of the factory.
+    /// The `prefix` parameter indicates where to store the files.
     pub fn produce(&self, prefix: String) -> PythonPlotter<'py, T1, T2> {
         if let Some(ref obj) = self.obj {
             let produce = intern!(obj.py(), "produce");

mercurial