diff --git a/jupyter_notebooks/createModel.ipynb b/jupyter_notebooks/createModel.ipynb index 6ef050f7..a2ce9867 100644 --- a/jupyter_notebooks/createModel.ipynb +++ b/jupyter_notebooks/createModel.ipynb @@ -501,17 +501,21 @@ "outputs": [], "source": [ "# load model and convert to SBML\n", - "if loadFile(\"SPARCED.txt\") == 1:\n", - " print(\"Success loading antimony file\")\n", - "else:\n", + "try:\n", + " assert not loadFile(\"SPARCED.txt\") == -1\n", + "except:\n", " print(\"Failed to load antimony file\")\n", " exit(1)\n", - "\n", - "if writeSBMLFile(\"SPARCED.xml\",\"SPARCED\") == 1:\n", - " print(\"Success converting antimony to SBML\")\n", "else:\n", + " print(\"Success loading antimony file\")\n", + "\n", + "try:\n", + " assert not writeSBMLFile(\"SPARCED.xml\",\"SPARCED\") == 0", + "except:\n", " print(\"Failure converting antimony to SBML\")\n", - " exit(1)" + " exit(1)", + "else:\n", + " print(\"Success converting antimony to SBML\")\n" ] }, {