From 90fa9c372794a7c36a85a1bb50a611710819636b Mon Sep 17 00:00:00 2001 From: rowanc1 Date: Mon, 24 Feb 2014 14:38:19 -0800 Subject: [PATCH] Added check on modelPair in Problem. --- SimPEG/Problem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SimPEG/Problem.py b/SimPEG/Problem.py index c6f381f5..f93c0c7a 100644 --- a/SimPEG/Problem.py +++ b/SimPEG/Problem.py @@ -1,5 +1,5 @@ import Utils, Data, numpy as np, scipy.sparse as sp - +import Model class BaseProblem(object): """ @@ -39,10 +39,12 @@ class BaseProblem(object): counter = None #: A SimPEG.Utils.Counter object dataPair = Data.BaseData + modelPair = Model.BaseModel def __init__(self, mesh, model, *args, **kwargs): Utils.setKwargs(self, **kwargs) self.mesh = mesh + assert isinstance(d, self.modelPair), "Model object must be an instance of a %s class."%(self.modelPair.__name__) self.model = model @property