Repository: lbl-camera/gpCAM (language: python)

Issue:
Simple tests
Some quick improvements to tests that boost reported coverage


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index ab3f94a..1171a5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -142,3 +142,9 @@ docs/build/
 
 # PyCharm
 .idea/
+
+# data files
+*.npy
+
+# dask locks
+*.lock
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000..a6a3458
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,4 @@
+ignore:
+  - "versioneer.py"
+  - "gpcam/_version.py"
+


Test patch:
diff --git a/tests/test_basic.py b/tests/test_basic.py
new file mode 100644
index 0000000..5fbd69f
--- /dev/null
+++ b/tests/test_basic.py
@@ -0,0 +1,28 @@
+import numpy as np
+
+from gpcam.autonomous_experimenter import AutonomousExperimenterGP
+
+
+def test_basic_smoke():
+    def instrument(data, instrument_dict={}):
+        for entry in data:
+            entry["value"] = np.sin(np.linalg.norm(entry["position"]))
+        return data
+
+    ##set up your parameter space
+    parameters = np.array([[3.0, 45.8],
+                           [4.0, 47.0]])
+
+    ##set up some hyperparameters, if you have no idea, set them to 1 and make the training bounds large
+    init_hyperparameters = np.array([1, 1, 1])
+    hyperparameter_bounds = np.array([[0.01, 100], [0.01, 100.0], [0.01, 100]])
+
+    ##let's initialize the autonomous experimenter ...
+    my_ae = AutonomousExperimenterGP(parameters, init_hyperparameters,
+                                     hyperparameter_bounds, instrument_func=instrument,
+                                     init_dataset_size=10)
+    # ...train...
+    my_ae.train()
+
+    # ...and run. That's it. You successfully executed an autonomous experiment.
+    my_ae.go(N=15, retrain_locally_at=(11,), retrain_globally_at=(12,), retrain_async_at=(13,))