From 8faed108bc349e2e8c2edb2106f76230555d5e73 Mon Sep 17 00:00:00 2001
From: "Joern Ungermann (IEK-7 FZ-Juelich)" <j.ungermann@fz-juelich.de>
Date: Thu, 30 Oct 2014 12:22:15 +0100
Subject: [PATCH] Added a default regularisator to costfunction, so it doesnt
 crash.

---
 pyramid/costfunction.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pyramid/costfunction.py b/pyramid/costfunction.py
index 303033d..efa7500 100644
--- a/pyramid/costfunction.py
+++ b/pyramid/costfunction.py
@@ -10,7 +10,7 @@ from scipy.sparse import eye
 
 from pyramid.forwardmodel import ForwardModel
 from pyramid.regularisator import ZeroOrderRegularisator
-
+from pyramid.regularisator import NoneRegularisator
 import logging
 
 
@@ -54,6 +54,8 @@ class Costfunction(object):
         self.data_set = data_set
         self.fwd_model = ForwardModel(data_set)
         self.regularisator = regularisator
+        if self.regularisator is None:
+            self.regularisator = NoneRegularisator()
         # Extract important information:
         self.y = data_set.phase_vec
         self.Se_inv = data_set.Se_inv
-- 
GitLab