Skip to content

Commit ea3d1e9

Browse files
authored
replace read and write SBML files with isA instead of isinstance (#425)
* replace getId->id, getId().value,getDataIndex->dataIndex isnstance->isA due to changes in new python binding commit * replace isinstance to isA * missing of closing brackets * missing of closing brackets
1 parent 16d1bae commit ea3d1e9

File tree

2 files changed

+67
-66
lines changed

2 files changed

+67
-66
lines changed

python/moose/SBML/readSBML.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def getModelAnnotation(obj, baseId):
440440
plots = plots.replace(" ", "")
441441
plotorg = plots
442442
if( moose.exists(baseId.path + plotorg) and
443-
isinstance(moose.element(baseId.path+plotorg),moose.PoolBase)) :
443+
( (moose.element(baseId.path+plotorg)).isA("PoolBase"))) :
444444
plotSId = moose.element(
445445
baseId.path + plotorg)
446446
# plotorg = convertSpecialChar(plotorg)
@@ -1096,7 +1096,7 @@ def createRules(model, specInfoMap, globparameterIdValue):
10961096
poolsCompt = findCompartment(moose.element(poolList))
10971097
#If pool comes without a compartment which is not allowed moose
10981098
#then returning with -2
1099-
if not isinstance(moose.element(poolsCompt), moose.ChemCompt):
1099+
if not (moose.element(poolsCompt).isA("ChemCompt")):
11001100
return -2
11011101
else:
11021102
if poolsCompt.name not in comptvolume:
@@ -1131,8 +1131,7 @@ def createRules(model, specInfoMap, globparameterIdValue):
11311131
i = str(idBeginWith(i))
11321132
specMapList = specInfoMap[i]["Mpath"]
11331133
poolsCompt = findCompartment(moose.element(specMapList))
1134-
if not isinstance(moose.element(
1135-
poolsCompt), moose.ChemCompt):
1134+
if not (moose.element(poolsCompt).isA("ChemCompt")):
11361135
return -2
11371136
else:
11381137
if poolsCompt.name not in comptvolume:

0 commit comments

Comments
 (0)