From df38780e6995831a1d1791d93fc436af12a69e32 Mon Sep 17 00:00:00 2001 From: Cory Date: Tue, 24 Oct 2023 21:49:26 +0200 Subject: [PATCH] Add docs for Python --- Doxyfile | 2 +- src/scripts/animate_100_particles.py | 11 +++++++++++ src/scripts/plot_2_particles.py | 12 ++++++++++++ src/scripts/plot_3d.py | 11 +++++++++++ src/scripts/plot_particles_left.py | 12 ++++++++++++ src/scripts/plot_phase_space.py | 12 ++++++++++++ src/scripts/plot_relative_error.py | 11 +++++++++++ src/scripts/plot_single_particle.py | 20 ++++++++++++-------- 8 files changed, 82 insertions(+), 9 deletions(-) diff --git a/Doxyfile b/Doxyfile index 7b951c6..61d59dd 100644 --- a/Doxyfile +++ b/Doxyfile @@ -917,7 +917,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include src README.md +INPUT = include src src/scripts README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/src/scripts/animate_100_particles.py b/src/scripts/animate_100_particles.py index 717e31b..dcc2e97 100644 --- a/src/scripts/animate_100_particles.py +++ b/src/scripts/animate_100_particles.py @@ -1,3 +1,14 @@ +## @file animate_100_particles.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Animate 100 particles. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np from matplotlib import animation diff --git a/src/scripts/plot_2_particles.py b/src/scripts/plot_2_particles.py index 07401f6..70cf290 100644 --- a/src/scripts/plot_2_particles.py +++ b/src/scripts/plot_2_particles.py @@ -1,3 +1,15 @@ +## @file plot_2_particles.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot 2 particles with and without particle interactions in the +# xy-plane. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np import seaborn as sns diff --git a/src/scripts/plot_3d.py b/src/scripts/plot_3d.py index 5a6c107..9550e1e 100644 --- a/src/scripts/plot_3d.py +++ b/src/scripts/plot_3d.py @@ -1,3 +1,14 @@ +## @file plot_3d.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot 2 particles with and without particle interactions in 3D. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np import seaborn as sns diff --git a/src/scripts/plot_particles_left.py b/src/scripts/plot_particles_left.py index 5116be7..fde4146 100644 --- a/src/scripts/plot_particles_left.py +++ b/src/scripts/plot_particles_left.py @@ -1,3 +1,15 @@ +## @file plot_particles_left.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot how many particles are left after 500 microseconds using +# different angular frequencies. +# +# @bug No known bugs + import matplotlib.pyplot as plt import seaborn as sns diff --git a/src/scripts/plot_phase_space.py b/src/scripts/plot_phase_space.py index 2302c54..5ec9c0b 100644 --- a/src/scripts/plot_phase_space.py +++ b/src/scripts/plot_phase_space.py @@ -1,3 +1,15 @@ +## @file plot_phase_space.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot the phase space for 2 particles in the x and z direction, with +# and without particle interactions. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np import seaborn as sns diff --git a/src/scripts/plot_relative_error.py b/src/scripts/plot_relative_error.py index df3e64d..30b81d5 100644 --- a/src/scripts/plot_relative_error.py +++ b/src/scripts/plot_relative_error.py @@ -1,3 +1,14 @@ +## @file plot_relative_error.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot the relative error for forward Euler and RK4 method. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np import seaborn as sns diff --git a/src/scripts/plot_single_particle.py b/src/scripts/plot_single_particle.py index a80a8b4..52eb2f9 100644 --- a/src/scripts/plot_single_particle.py +++ b/src/scripts/plot_single_particle.py @@ -1,3 +1,15 @@ +## @file plot_single_particle.py +# +# @author Cory Alexander Balaton (coryab) +# @author Janita Ovidie Sandtrøen Willumsen (janitaws) +# +# @version 1.0 +# +# @brief Plot the approximation and analytical solution for one particle +# in the z axis. +# +# @bug No known bugs + import matplotlib.pyplot as plt import numpy as np import seaborn as sns @@ -23,14 +35,6 @@ def z(t): return 20.*np.cos(w_z*t) def main(): - colors = [ - "lightskyblue", - "deepskyblue", - "salmon", - "tomato", - "mediumaquamarine", - "mediumseagreen" - ] filename = "output/simulate_single_particle/particle_0_r.txt" r = t = [] with open(filename) as f: