From 2de69a1dd70070970d092c8ebfe3d8b466a3b5a2 Mon Sep 17 00:00:00 2001 From: cjarmstrong97 Date: Tue, 21 Sep 2021 15:10:04 -0400 Subject: [PATCH] Ensured parsing of every element of PatternQuantifier --- bionetgen/modelapi/xmlparsers.py | 4 ++-- tests/models/hybrid_test.bngl | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bionetgen/modelapi/xmlparsers.py b/bionetgen/modelapi/xmlparsers.py index f607098..2f3f5fa 100644 --- a/bionetgen/modelapi/xmlparsers.py +++ b/bionetgen/modelapi/xmlparsers.py @@ -167,8 +167,8 @@ def parse_xml(self, xml) -> Pattern: quantity = xml["@quantity"] pattern.relation = relation try: - n = int(pattern.quantity) - f = float(pattern.quantity) + n = int(quantity) + f = float(quantity) if n == f: pattern.quantity = quantity except ValueError as e: diff --git a/tests/models/hybrid_test.bngl b/tests/models/hybrid_test.bngl index 6887904..ba381de 100644 --- a/tests/models/hybrid_test.bngl +++ b/tests/models/hybrid_test.bngl @@ -30,10 +30,7 @@ begin observables Species R2 R==2 Species R3 R==3 Species R4 R==4 - Species R5 R>4 - Species R5le R<=4 - Species R5l R<4 - Species R5ge R>=4 + Species R5 R<4 end observables begin reaction rules R(l!1).L(r!1) -> R(l) + L(r) koff @@ -48,5 +45,4 @@ end population maps end model ## actions ## -#generate_hybrid_model({overwrite=>1, execute=>1, verbose=>1, safe=>0, actions=>["writeXML()"]}) -writeXML() +generate_hybrid_model({overwrite=>1, execute=>1, verbose=>1, safe=>0, actions=>["writeXML()"]}) \ No newline at end of file