Commit e8052758 authored by Daniel Brown's avatar Daniel Brown
Browse files

more error handling

parent baf85301
......@@ -1157,6 +1157,7 @@ class kat(object):
if self.verbose: print ("Finished in " + str(datetime.datetime.now()-start))
def remove(self, obj):
try:
if not isinstance(obj, pykat.finesse.Signals) and not (obj.name in self.__components or obj.name in self.__detectors or obj.name in self.__commands or obj in self.signals.targets):
raise pkex.BasePyKatException("{0} is not currently in the simulation".format(obj.name))
......@@ -1196,6 +1197,9 @@ class kat(object):
#import gc
#print (gc.get_referrers(obj))
except pkex.BasePyKatException as ex:
pkex.PrintError("Error on removing object:", ex)
def getMatrices(self):
import scipy
......@@ -1277,7 +1281,7 @@ class kat(object):
obj._on_kat_add(self)
except pkex.BasePyKatException as ex:
print (ex)
pkex.PrintError("Error on adding object:", ex)
def readOutFile(self, filename):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment