Skip to content
Snippets Groups Projects
Verified Commit 759e0e73 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

DOC ENH: Added Makefile for testing.

parent 8f25712a
No related branches found
No related tags found
1 merge request!41DOC: code gallery
Pipeline #18211 passed with warnings
# 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
...@@ -6,8 +6,6 @@ These distances resulted in small x,y, values: ...@@ -6,8 +6,6 @@ These distances resulted in small x,y, values:
[...] [...]
""" """
# python3 -m doctest -v simulation.py
import numpy as np import numpy as np
import scipy.integrate import scipy.integrate
import caosdb as db import caosdb as db
...@@ -111,7 +109,7 @@ def analyze(): ...@@ -111,7 +109,7 @@ def analyze():
data = db.execute_query("""SELECT Parameters, Result FROM RECORD SoftwareRun WITH data = db.execute_query("""SELECT Parameters, Result FROM RECORD SoftwareRun WITH
(((Result.x < {dist}) AND (Result.x > -{dist})) (((Result.x < {dist}) AND (Result.x > -{dist}))
AND (Result.y < {dist})) AND Result.y > -{dist}""".format(dist=distance)) 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() parameters = db.Container().extend([db.Record(id=id) for id in dataframe.Parameters]).retrieve()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment