From 759e0e735152f95107f040023cfb951fcb2e7a56 Mon Sep 17 00:00:00 2001
From: Daniel Hornung <d.hornung@indiscale.com>
Date: Wed, 19 Jan 2022 12:56:09 +0100
Subject: [PATCH] DOC ENH: Added Makefile for testing.

---
 src/doc/gallery/Makefile      | 23 +++++++++++++++++++++++
 src/doc/gallery/simulation.py |  4 +---
 2 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 src/doc/gallery/Makefile

diff --git a/src/doc/gallery/Makefile b/src/doc/gallery/Makefile
new file mode 100644
index 00000000..658f9a6a
--- /dev/null
+++ b/src/doc/gallery/Makefile
@@ -0,0 +1,23 @@
+# This file is a part of the CaosDB Project.
+#
+# Copyright (C) 2022 IndiScale GmbH <info@indiscale.com>
+# Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+
+# Run tests on the examples.
+test:
+	python3 -m doctest simulation.py
+.PHONY: test
diff --git a/src/doc/gallery/simulation.py b/src/doc/gallery/simulation.py
index 5fc833ae..342d5d98 100644
--- a/src/doc/gallery/simulation.py
+++ b/src/doc/gallery/simulation.py
@@ -6,8 +6,6 @@ These distances resulted in small x,y, values:
 [...]
 """
 
-# python3 -m doctest -v simulation.py
-
 import numpy as np
 import scipy.integrate
 import caosdb as db
@@ -111,7 +109,7 @@ def analyze():
     data = db.execute_query("""SELECT Parameters, Result FROM RECORD SoftwareRun WITH
         (((Result.x < {dist}) AND (Result.x > -{dist}))
         AND (Result.y < {dist})) AND Result.y > -{dist}""".format(dist=distance))
-    dataframe = to_table(data)
+    dataframe = to_table(data)  # Convert into a Pandas DataFrame
 
     parameters = db.Container().extend([db.Record(id=id) for id in dataframe.Parameters]).retrieve()
 
-- 
GitLab