You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(121) |
Aug
(343) |
Sep
(98) |
Oct
(55) |
Nov
(158) |
Dec
(219) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(278) |
Feb
(170) |
Mar
(286) |
Apr
(32) |
May
(83) |
Jun
(140) |
Jul
(212) |
Aug
(242) |
Sep
(52) |
Oct
(29) |
Nov
(132) |
Dec
(259) |
2010 |
Jan
(251) |
Feb
(147) |
Mar
(76) |
Apr
(140) |
May
(43) |
Jun
(66) |
Jul
(273) |
Aug
(205) |
Sep
(260) |
Oct
(100) |
Nov
(58) |
Dec
(264) |
2011 |
Jan
(219) |
Feb
(344) |
Mar
(320) |
Apr
(334) |
May
(125) |
Jun
(131) |
Jul
(195) |
Aug
(155) |
Sep
(55) |
Oct
(261) |
Nov
(286) |
Dec
(216) |
2012 |
Jan
(188) |
Feb
(177) |
Mar
(39) |
Apr
(179) |
May
(148) |
Jun
(43) |
Jul
(229) |
Aug
(104) |
Sep
(76) |
Oct
(82) |
Nov
(93) |
Dec
(180) |
2013 |
Jan
(323) |
Feb
(335) |
Mar
(35) |
Apr
(220) |
May
(238) |
Jun
(122) |
Jul
(316) |
Aug
(73) |
Sep
(135) |
Oct
(515) |
Nov
(320) |
Dec
(185) |
2014 |
Jan
(81) |
Feb
(146) |
Mar
(337) |
Apr
(234) |
May
(112) |
Jun
(239) |
Jul
(323) |
Aug
(123) |
Sep
(83) |
Oct
(285) |
Nov
(321) |
Dec
(96) |
2015 |
Jan
(77) |
Feb
(79) |
Mar
(124) |
Apr
(71) |
May
(35) |
Jun
(45) |
Jul
(77) |
Aug
(44) |
Sep
(22) |
Oct
(84) |
Nov
(120) |
Dec
(37) |
2016 |
Jan
(38) |
Feb
(74) |
Mar
(242) |
Apr
(153) |
May
(59) |
Jun
(44) |
Jul
(67) |
Aug
(74) |
Sep
(150) |
Oct
(35) |
Nov
(69) |
Dec
(43) |
2017 |
Jan
(43) |
Feb
(9) |
Mar
(274) |
Apr
(40) |
May
(81) |
Jun
(81) |
Jul
(87) |
Aug
(46) |
Sep
(98) |
Oct
(50) |
Nov
(220) |
Dec
(66) |
2018 |
Jan
(110) |
Feb
(22) |
Mar
(20) |
Apr
(147) |
May
(148) |
Jun
(30) |
Jul
(83) |
Aug
(63) |
Sep
(40) |
Oct
(53) |
Nov
(51) |
Dec
(104) |
2019 |
Jan
(14) |
Feb
(81) |
Mar
(80) |
Apr
(102) |
May
(16) |
Jun
(5) |
Jul
(34) |
Aug
(24) |
Sep
(9) |
Oct
(12) |
Nov
(42) |
Dec
(76) |
2020 |
Jan
(15) |
Feb
(11) |
Mar
(12) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fbe...@us...> - 2019-07-09 06:40:09
|
Revision: 26070 http://sourceforge.net/p/sbml/code/26070 Author: fbergmann Date: 2019-07-09 06:40:02 +0000 (Tue, 09 Jul 2019) Log Message: ----------- - fix examples to use polygons rather than curves as they can be filled Modified Paths: -------------- trunk/libsbml/examples/sample-models/render/simple-L2-layout.xml trunk/libsbml/examples/sample-models/render/simple-L2-render-global.xml trunk/libsbml/examples/sample-models/render/simple-L2-render-local.xml Modified: trunk/libsbml/examples/sample-models/render/simple-L2-layout.xml =================================================================== --- trunk/libsbml/examples/sample-models/render/simple-L2-layout.xml 2019-07-09 06:26:55 UTC (rev 26069) +++ trunk/libsbml/examples/sample-models/render/simple-L2-layout.xml 2019-07-09 06:40:02 UTC (rev 26070) @@ -41,9 +41,6 @@ <position x="0" y="0" /> <dimensions width="0" height="0" /> </boundingBox> - <curve> - <listOfCurveSegments /> - </curve> <listOfSpeciesReferenceGlyphs> <speciesReferenceGlyph id="SpeciesReference_J0_0" speciesReference="Node1" speciesGlyph="sGlyph_1" role="product" objectRole="product"> <curve> @@ -58,9 +55,6 @@ </curve> </speciesReferenceGlyph> <speciesReferenceGlyph id="SpeciesReference_J0_2" speciesReference="Node0" speciesGlyph="sGlyph_0" role="substrate" objectRole="substrate"> - <curve> - <listOfCurveSegments /> - </curve> </speciesReferenceGlyph> </listOfSpeciesReferenceGlyphs> </reactionGlyph> Modified: trunk/libsbml/examples/sample-models/render/simple-L2-render-global.xml =================================================================== --- trunk/libsbml/examples/sample-models/render/simple-L2-render-global.xml 2019-07-09 06:26:55 UTC (rev 26069) +++ trunk/libsbml/examples/sample-models/render/simple-L2-render-global.xml 2019-07-09 06:40:02 UTC (rev 26070) @@ -60,7 +60,7 @@ <listOfStyles> <style typeList="SPECIESGLYPH"> <g font-size="0" font-style="normal" font-weight="normal" text-anchor="start" vtext-anchor="top"> - <curve stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> + <polygon stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> <listOfCurveSegments> <curveSegment xsi:type="CubicBezier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <start x="20" y="0" /> @@ -95,7 +95,7 @@ <end x="20" y="0" /> </curveSegment> </listOfCurveSegments> - </curve> + </polygon> </g> </style> <style typeList="COMPARTMENTGLYPH"> @@ -150,9 +150,6 @@ <position x="0" y="0" /> <dimensions width="0" height="0" /> </boundingBox> - <curve> - <listOfCurveSegments /> - </curve> <listOfSpeciesReferenceGlyphs> <speciesReferenceGlyph id="SpeciesReference_J0_0" speciesReference="Node1" speciesGlyph="sGlyph_1" role="product" objectRole="product"> <curve> @@ -167,9 +164,6 @@ </curve> </speciesReferenceGlyph> <speciesReferenceGlyph id="SpeciesReference_J0_2" speciesReference="Node0" speciesGlyph="sGlyph_0" role="substrate" objectRole="substrate"> - <curve> - <listOfCurveSegments /> - </curve> </speciesReferenceGlyph> </listOfSpeciesReferenceGlyphs> </reactionGlyph> Modified: trunk/libsbml/examples/sample-models/render/simple-L2-render-local.xml =================================================================== --- trunk/libsbml/examples/sample-models/render/simple-L2-render-local.xml 2019-07-09 06:26:55 UTC (rev 26069) +++ trunk/libsbml/examples/sample-models/render/simple-L2-render-local.xml 2019-07-09 06:40:02 UTC (rev 26070) @@ -62,7 +62,7 @@ <listOfStyles> <style idList="sGlyph_0"> <g font-size="0" font-style="normal" font-weight="normal" text-anchor="start" vtext-anchor="top"> - <curve stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> + <polygon stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> <listOfCurveSegments> <curveSegment xsi:type="CubicBezier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <start x="20" y="0" /> @@ -97,12 +97,12 @@ <end x="20" y="0" /> </curveSegment> </listOfCurveSegments> - </curve> + </polygon> </g> </style> <style idList="sGlyph_1"> <g font-size="0" font-style="normal" font-weight="normal" text-anchor="start" vtext-anchor="top"> - <curve stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> + <polygon stroke="Color_0" stroke-width="2" fill="LinearGradient_0"> <listOfCurveSegments> <curveSegment xsi:type="CubicBezier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <start x="20" y="0" /> @@ -137,7 +137,7 @@ <end x="20" y="0" /> </curveSegment> </listOfCurveSegments> - </curve> + </polygon> </g> </style> <style idList="cGlyph_0"> @@ -190,9 +190,6 @@ <position x="0" y="0" /> <dimensions width="0" height="0" /> </boundingBox> - <curve> - <listOfCurveSegments /> - </curve> <listOfSpeciesReferenceGlyphs> <speciesReferenceGlyph id="SpeciesReference_J0_0" speciesReference="Node1" speciesGlyph="sGlyph_1" role="product" objectRole="product"> <curve> @@ -207,9 +204,6 @@ </curve> </speciesReferenceGlyph> <speciesReferenceGlyph id="SpeciesReference_J0_2" speciesReference="Node0" speciesGlyph="sGlyph_0" role="substrate" objectRole="substrate"> - <curve> - <listOfCurveSegments /> - </curve> </speciesReferenceGlyph> </listOfSpeciesReferenceGlyphs> </reactionGlyph> |
From: <fbe...@us...> - 2019-07-09 06:27:01
|
Revision: 26069 http://sourceforge.net/p/sbml/code/26069 Author: fbergmann Date: 2019-07-09 06:26:55 +0000 (Tue, 09 Jul 2019) Log Message: ----------- Merged revision(s) 26066-26068 from trunk/libsbml: Modified Paths: -------------- branches/libsbml-experimental/src/bindings/python/patch-python.cmake Modified: branches/libsbml-experimental/src/bindings/python/patch-python.cmake =================================================================== --- branches/libsbml-experimental/src/bindings/python/patch-python.cmake 2019-07-08 14:47:15 UTC (rev 26068) +++ branches/libsbml-experimental/src/bindings/python/patch-python.cmake 2019-07-09 06:26:55 UTC (rev 26069) @@ -25,11 +25,15 @@ # import statement needed on some systems import sys import os.path -import inspect -filename = inspect.getframeinfo(inspect.currentframe()).filename -path = os.path.dirname(os.path.abspath(filename)) -if not path in sys.path: - sys.path.append(path) +import inspect +try: + _filename = inspect.getframeinfo(inspect.currentframe()).filename +except: + _filename = __file__ +_path = os.path.dirname(os.path.abspath(_filename)) +if not _path in sys.path: + sys.path.append(_path) + ") if (PYTHON_USE_API2_WARNINGS) |
From: <fbe...@us...> - 2019-07-08 14:46:28
|
Revision: 26068 http://sourceforge.net/p/sbml/code/26068 Author: fbergmann Date: 2019-07-08 14:47:15 +0000 (Mon, 08 Jul 2019) Log Message: ----------- - hide variables fix build for python 2.5 Modified Paths: -------------- trunk/libsbml/src/bindings/python/patch-python.cmake Modified: trunk/libsbml/src/bindings/python/patch-python.cmake =================================================================== --- trunk/libsbml/src/bindings/python/patch-python.cmake 2019-07-08 12:00:24 UTC (rev 26067) +++ trunk/libsbml/src/bindings/python/patch-python.cmake 2019-07-08 14:47:15 UTC (rev 26068) @@ -25,11 +25,15 @@ # import statement needed on some systems import sys import os.path -import inspect -filename = inspect.getframeinfo(inspect.currentframe()).filename -path = os.path.dirname(os.path.abspath(filename)) -if not path in sys.path: - sys.path.append(path) +import inspect +try: + _filename = inspect.getframeinfo(inspect.currentframe()).filename +except: + _filename = __file__ +_path = os.path.dirname(os.path.abspath(_filename)) +if not _path in sys.path: + sys.path.append(_path) + ") if (PYTHON_USE_API2_WARNINGS) |
From: <fbe...@us...> - 2019-07-08 11:59:35
|
Revision: 26067 http://sourceforge.net/p/sbml/code/26067 Author: fbergmann Date: 2019-07-08 12:00:24 +0000 (Mon, 08 Jul 2019) Log Message: ----------- - fix compilation Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp Modified: branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp 2019-06-27 08:35:39 UTC (rev 26066) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp 2019-07-08 12:00:24 UTC (rev 26067) @@ -34,6 +34,7 @@ #include <sbml/packages/distrib/extension/DistribExtension.h> #include <sbml/packages/distrib/extension/DistribASTPlugin.h> #include <sbml/util/MathFilter.h> +#include <sbml/math/L3Parser.h> #ifdef USE_COMP #include <sbml/packages/comp/extension/CompSBMLDocumentPlugin.h> |
From: <fbe...@us...> - 2019-06-27 08:35:49
|
Revision: 26066 http://sourceforge.net/p/sbml/code/26066 Author: fbergmann Date: 2019-06-27 08:35:39 +0000 (Thu, 27 Jun 2019) Log Message: ----------- Merged revision(s) 26060-26065 from trunk/libsbml: Modified Paths: -------------- branches/libsbml-experimental/src/bindings/python/patch-python.cmake branches/libsbml-experimental/src/sbml/SBMLConvert.cpp branches/libsbml-experimental/src/sbml/SBMLDocument.h branches/libsbml-experimental/src/sbml/SBase.cpp branches/libsbml-experimental/src/sbml/annotation/test/TestSyncAnnotation.cpp branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp Modified: branches/libsbml-experimental/src/bindings/python/patch-python.cmake =================================================================== --- branches/libsbml-experimental/src/bindings/python/patch-python.cmake 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/bindings/python/patch-python.cmake 2019-06-27 08:35:39 UTC (rev 26066) @@ -25,7 +25,11 @@ # import statement needed on some systems import sys import os.path -sys.path.append(os.path.dirname(__file__)) +import inspect +filename = inspect.getframeinfo(inspect.currentframe()).filename +path = os.path.dirname(os.path.abspath(filename)) +if not path in sys.path: + sys.path.append(path) ") if (PYTHON_USE_API2_WARNINGS) Modified: branches/libsbml-experimental/src/sbml/SBMLConvert.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/SBMLConvert.cpp 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/sbml/SBMLConvert.cpp 2019-06-27 08:35:39 UTC (rev 26066) @@ -820,6 +820,10 @@ kl->getListOfLocalParameters()->appendAndOwn(lp); // kl->addLocalParameter(lp); } + + // remove old parameters (while they would not be written out, + // (or used) the meta id validator would complain otherwise) + kl->getListOfParameters()->clear(true); } } } Modified: branches/libsbml-experimental/src/sbml/SBMLDocument.h =================================================================== --- branches/libsbml-experimental/src/sbml/SBMLDocument.h 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/sbml/SBMLDocument.h 2019-06-27 08:35:39 UTC (rev 26066) @@ -317,6 +317,7 @@ class SBMLValidator; class SBMLInternalValidator; +class SBMLLevelVersionConverter; /** @cond doxygenLibsbmlInternal */ /* Internal constants for setting/unsetting particular consistency checks. */ @@ -1707,6 +1708,7 @@ friend class SBase; friend class SBMLReader; + friend class SBMLLevelVersionConverter; /** @endcond */ }; Modified: branches/libsbml-experimental/src/sbml/SBase.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/SBase.cpp 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/sbml/SBase.cpp 2019-06-27 08:35:39 UTC (rev 26066) @@ -1496,7 +1496,16 @@ // syncAnnotation() doesn't need to be invoked in this function because // existing mCVTerm objects are properly merged in the following code. // + // except when they have not been updated (ie CVTerm has been added but not synced + // see bug reported via libsbml-team + // https://www.pivotaltracker.com/story/show/166576120 + if (getNumCVTerms() > 0 && mAnnotation == NULL) + { + syncAnnotation(); + } + + if(annotation == NULL) return LIBSBML_OPERATION_SUCCESS; @@ -1596,7 +1605,15 @@ // syncAnnotation() doesn't need to be invoked in this function because // existing mCVTerm objects are properly merged in the following code. // + // except when they have not been updated (ie CVTerm has been added but not synced + // see bug reported via libsbml-team + // https://www.pivotaltracker.com/story/show/166576120 + if (getNumCVTerms() > 0 && mAnnotation == NULL) + { + syncAnnotation(); + } + int success = LIBSBML_OPERATION_FAILED; XMLNode* annt_xmln; if (getSBMLDocument() != NULL) Modified: branches/libsbml-experimental/src/sbml/annotation/test/TestSyncAnnotation.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/annotation/test/TestSyncAnnotation.cpp 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/sbml/annotation/test/TestSyncAnnotation.cpp 2019-06-27 08:35:39 UTC (rev 26066) @@ -1579,7 +1579,102 @@ END_TEST +START_TEST(test_SyncAnnotation_ordering_bug_1) +{ + // report via libsbml team + // if addCVTerm and then appendAnnotation is used teh CVTerm gets lost + // but it works the other way round + Compartment* c = new Compartment(2, 3); + c->setMetaId("_000003"); + c->setId("A"); + + CVTerm * cv = new CVTerm(BIOLOGICAL_QUALIFIER); + cv->setBiologicalQualifierType(BQB_IS); + cv->addResource("http://www.geneontology.org/#GO:0007274"); + + + const char * addedAnn = + "<prA:other xmlns:prA=\"http://some\">This is additional</prA:other>"; + + // this way works even with the bug + c->appendAnnotation(addedAnn); + c->addCVTerm(cv); + + const char * expected = + "<compartment metaid=\"_000003\" id=\"A\">\n" + " <annotation>\n" + " <prA:other xmlns:prA=\"http://some\">This is additional</prA:other>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000003\">\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>\n" + "</compartment>"; + + char * sbml = c->toSBML(); + + fail_unless(equals(expected, sbml)); + + free(sbml); + delete c; +} +END_TEST + + +START_TEST(test_SyncAnnotation_ordering_bug_2) +{ + // report via libsbml team + // if addCVTerm and then appendAnnotation is used teh CVTerm gets lost + // but it works the other way round + + Compartment* c = new Compartment(2, 3); + c->setMetaId("_000003"); + c->setId("A"); + + CVTerm * cv = new CVTerm(BIOLOGICAL_QUALIFIER); + cv->setBiologicalQualifierType(BQB_IS); + cv->addResource("http://www.geneontology.org/#GO:0007274"); + + + const char * addedAnn = + "<prA:other xmlns:prA=\"http://some\">This is additional</prA:other>"; + + // this way did hit the bug and CVTerm was lost + c->addCVTerm(cv); + c->appendAnnotation(addedAnn); + + const char * expected = + "<compartment metaid=\"_000003\" id=\"A\">\n" + " <annotation>\n" + " <prA:other xmlns:prA=\"http://some\">This is additional</prA:other>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000003\">\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>\n" + "</compartment>"; + + char * sbml = c->toSBML(); + + fail_unless(equals(expected, sbml)); + + free(sbml); + delete c; +} +END_TEST + + Suite * create_suite_SyncAnnotation (void) { @@ -1617,6 +1712,9 @@ tcase_add_test(tcase, test_SyncAnnotation_nestedCV_invalid ); + tcase_add_test(tcase, test_SyncAnnotation_ordering_bug_1); + tcase_add_test(tcase, test_SyncAnnotation_ordering_bug_2); + suite_add_tcase(suite, tcase); return suite; Modified: branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-06-27 08:27:29 UTC (rev 26065) +++ branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-06-27 08:35:39 UTC (rev 26066) @@ -409,13 +409,15 @@ validateConvertedDocument(); bool errors = has_fatal_errors(origLevel, origVersion); if (errors) - { /* error - we dont covert + { /* error - we don't covert * restore original values and return */ conversion = false; /* undo any changes */ - delete currentModel; + delete currentModel; //!! deletes mDocument->mModel!!!! currentModel = origModel.clone(); + mDocument->mModel = currentModel; // so we have to set it again + mDocument->updateSBMLNamespace("core", origLevel, origVersion); mDocument->setApplicableValidators(origValidators); } @@ -439,7 +441,7 @@ if (resetAnnotations) { // hack to force the model history to think it haschanged - this will - // change the vacrd if necessary + // change the vcard if necessary if (mDocument->isSetModel() && mDocument->getModel()->isSetModelHistory()) { ModelHistory * history = mDocument->getModel()->getModelHistory()->clone(); |
From: <fbe...@us...> - 2019-06-27 08:27:44
|
Revision: 26065 http://sourceforge.net/p/sbml/code/26065 Author: fbergmann Date: 2019-06-27 08:27:29 +0000 (Thu, 27 Jun 2019) Log Message: ----------- - fix python import on linux (location of _libsbml.so was no longer working) Modified Paths: -------------- trunk/libsbml/src/bindings/python/patch-python.cmake Modified: trunk/libsbml/src/bindings/python/patch-python.cmake =================================================================== --- trunk/libsbml/src/bindings/python/patch-python.cmake 2019-06-21 08:43:54 UTC (rev 26064) +++ trunk/libsbml/src/bindings/python/patch-python.cmake 2019-06-27 08:27:29 UTC (rev 26065) @@ -25,7 +25,11 @@ # import statement needed on some systems import sys import os.path -sys.path.append(os.path.dirname(__file__)) +import inspect +filename = inspect.getframeinfo(inspect.currentframe()).filename +path = os.path.dirname(os.path.abspath(filename)) +if not path in sys.path: + sys.path.append(path) ") if (PYTHON_USE_API2_WARNINGS) |
From: <fbe...@us...> - 2019-06-21 08:44:03
|
Revision: 26064 http://sourceforge.net/p/sbml/code/26064 Author: fbergmann Date: 2019-06-21 08:43:54 +0000 (Fri, 21 Jun 2019) Log Message: ----------- - issue #166837864: when converting to local parameters delete old parameters so that meta id validator wont' complain (also fix use after delete crash in lv converter, requiring document to become a friend) Modified Paths: -------------- trunk/libsbml/src/sbml/SBMLConvert.cpp trunk/libsbml/src/sbml/SBMLDocument.h trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp Modified: trunk/libsbml/src/sbml/SBMLConvert.cpp =================================================================== --- trunk/libsbml/src/sbml/SBMLConvert.cpp 2019-06-10 12:04:56 UTC (rev 26063) +++ trunk/libsbml/src/sbml/SBMLConvert.cpp 2019-06-21 08:43:54 UTC (rev 26064) @@ -820,6 +820,10 @@ kl->getListOfLocalParameters()->appendAndOwn(lp); // kl->addLocalParameter(lp); } + + // remove old parameters (while they would not be written out, + // (or used) the meta id validator would complain otherwise) + kl->getListOfParameters()->clear(true); } } } Modified: trunk/libsbml/src/sbml/SBMLDocument.h =================================================================== --- trunk/libsbml/src/sbml/SBMLDocument.h 2019-06-10 12:04:56 UTC (rev 26063) +++ trunk/libsbml/src/sbml/SBMLDocument.h 2019-06-21 08:43:54 UTC (rev 26064) @@ -317,6 +317,7 @@ class SBMLValidator; class SBMLInternalValidator; +class SBMLLevelVersionConverter; /** @cond doxygenLibsbmlInternal */ /* Internal constants for setting/unsetting particular consistency checks. */ @@ -1707,6 +1708,7 @@ friend class SBase; friend class SBMLReader; + friend class SBMLLevelVersionConverter; /** @endcond */ }; Modified: trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp =================================================================== --- trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-06-10 12:04:56 UTC (rev 26063) +++ trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-06-21 08:43:54 UTC (rev 26064) @@ -409,13 +409,15 @@ validateConvertedDocument(); bool errors = has_fatal_errors(origLevel, origVersion); if (errors) - { /* error - we dont covert + { /* error - we don't covert * restore original values and return */ conversion = false; /* undo any changes */ - delete currentModel; + delete currentModel; //!! deletes mDocument->mModel!!!! currentModel = origModel.clone(); + mDocument->mModel = currentModel; // so we have to set it again + mDocument->updateSBMLNamespace("core", origLevel, origVersion); mDocument->setApplicableValidators(origValidators); } @@ -439,7 +441,7 @@ if (resetAnnotations) { // hack to force the model history to think it haschanged - this will - // change the vacrd if necessary + // change the vcard if necessary if (mDocument->isSetModel() && mDocument->getModel()->isSetModelHistory()) { ModelHistory * history = mDocument->getModel()->getModelHistory()->clone(); |
From: <sar...@us...> - 2019-06-10 12:05:00
|
Revision: 26063 http://sourceforge.net/p/sbml/code/26063 Author: sarahkeating Date: 2019-06-10 12:04:56 +0000 (Mon, 10 Jun 2019) Log Message: ----------- Fix for https://www.pivotaltracker.com/story/show/166576120 when using addCVTerm and appendAnnotation depending on the order you use the functions in you lose information. Modified Paths: -------------- trunk/libsbml/src/sbml/SBase.cpp trunk/libsbml/src/sbml/annotation/test/TestSyncAnnotation.cpp Modified: trunk/libsbml/src/sbml/SBase.cpp =================================================================== --- trunk/libsbml/src/sbml/SBase.cpp 2019-06-07 19:48:56 UTC (rev 26062) +++ trunk/libsbml/src/sbml/SBase.cpp 2019-06-10 12:04:56 UTC (rev 26063) @@ -1496,7 +1496,16 @@ // syncAnnotation() doesn't need to be invoked in this function because // existing mCVTerm objects are properly merged in the following code. // + // except when they have not been updated (ie CVTerm has been added but not synced + // see bug reported via libsbml-team + // https://www.pivotaltracker.com/story/show/166576120 + if (getNumCVTerms() > 0 && mAnnotation == NULL) + { + syncAnnotation(); + } + + if(annotation == NULL) return LIBSBML_OPERATION_SUCCESS; @@ -1596,7 +1605,15 @@ // syncAnnotation() doesn't need to be invoked in this function because // existing mCVTerm objects are properly merged in the following code. // + // except when they have not been updated (ie CVTerm has been added but not synced + // see bug reported via libsbml-team + // https://www.pivotaltracker.com/story/show/166576120 + if (getNumCVTerms() > 0 && mAnnotation == NULL) + { + syncAnnotation(); + } + int success = LIBSBML_OPERATION_FAILED; XMLNode* annt_xmln; if (getSBMLDocument() != NULL) Modified: trunk/libsbml/src/sbml/annotation/test/TestSyncAnnotation.cpp =================================================================== --- trunk/libsbml/src/sbml/annotation/test/TestSyncAnnotation.cpp 2019-06-07 19:48:56 UTC (rev 26062) +++ trunk/libsbml/src/sbml/annotation/test/TestSyncAnnotation.cpp 2019-06-10 12:04:56 UTC (rev 26063) @@ -1579,7 +1579,102 @@ END_TEST +START_TEST(test_SyncAnnotation_ordering_bug_1) +{ + // report via libsbml team + // if addCVTerm and then appendAnnotation is used teh CVTerm gets lost + // but it works the other way round + Compartment* c = new Compartment(2, 3); + c->setMetaId("_000003"); + c->setId("A"); + + CVTerm * cv = new CVTerm(BIOLOGICAL_QUALIFIER); + cv->setBiologicalQualifierType(BQB_IS); + cv->addResource("http://www.geneontology.org/#GO:0007274"); + + + const char * addedAnn = + "<prA:other xmlns:prA=\"http://some\">This is additional</prA:other>"; + + // this way works even with the bug + c->appendAnnotation(addedAnn); + c->addCVTerm(cv); + + const char * expected = + "<compartment metaid=\"_000003\" id=\"A\">\n" + " <annotation>\n" + " <prA:other xmlns:prA=\"http://some\">This is additional</prA:other>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000003\">\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>\n" + "</compartment>"; + + char * sbml = c->toSBML(); + + fail_unless(equals(expected, sbml)); + + free(sbml); + delete c; +} +END_TEST + + +START_TEST(test_SyncAnnotation_ordering_bug_2) +{ + // report via libsbml team + // if addCVTerm and then appendAnnotation is used teh CVTerm gets lost + // but it works the other way round + + Compartment* c = new Compartment(2, 3); + c->setMetaId("_000003"); + c->setId("A"); + + CVTerm * cv = new CVTerm(BIOLOGICAL_QUALIFIER); + cv->setBiologicalQualifierType(BQB_IS); + cv->addResource("http://www.geneontology.org/#GO:0007274"); + + + const char * addedAnn = + "<prA:other xmlns:prA=\"http://some\">This is additional</prA:other>"; + + // this way did hit the bug and CVTerm was lost + c->addCVTerm(cv); + c->appendAnnotation(addedAnn); + + const char * expected = + "<compartment metaid=\"_000003\" id=\"A\">\n" + " <annotation>\n" + " <prA:other xmlns:prA=\"http://some\">This is additional</prA:other>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000003\">\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>\n" + "</compartment>"; + + char * sbml = c->toSBML(); + + fail_unless(equals(expected, sbml)); + + free(sbml); + delete c; +} +END_TEST + + Suite * create_suite_SyncAnnotation (void) { @@ -1617,6 +1712,9 @@ tcase_add_test(tcase, test_SyncAnnotation_nestedCV_invalid ); + tcase_add_test(tcase, test_SyncAnnotation_ordering_bug_1); + tcase_add_test(tcase, test_SyncAnnotation_ordering_bug_2); + suite_add_tcase(suite, tcase); return suite; |
From: <luc...@us...> - 2019-06-07 19:49:10
|
Revision: 26062 http://sourceforge.net/p/sbml/code/26062 Author: luciansmith Date: 2019-06-07 19:48:56 +0000 (Fri, 07 Jun 2019) Log Message: ----------- Latest validation rules from Deviser, mostly involving the addition of 'name'. Rule 21404 also changed, since there are indeed two 'Boundary' children, but they have different names. Modified Paths: -------------- trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex Modified: trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex =================================================================== --- trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex 2019-05-25 10:51:25 UTC (rev 26061) +++ trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex 2019-06-07 19:48:56 UTC (rev 26062) @@ -1,1575 +1,1648 @@ -% -*- TeX-master: "main"; fill-column: 72 -*- - -\section{Validation of SBML documents} -\label{apdx-validation} - -\subsection{Validation and consistency rules} -\label{validation-rules} - -This section summarizes all the conditions that must (or in some cases, -at least \emph{should}) be true of an SBML Level~3 Version~1 model that -uses the \SpatialProcessesPackage. We use the same conventions as are -used in the SBML Level~3 Version~1 Core specification document. In -particular, there are different degrees of rule strictness. Formally, -the differences are expressed in the statement of a rule: either a rule -states that a condition \emph{must} be true, or a rule states that it -\emph{should} be true. Rules of the former kind are strict SBML -validation rules---a model encoded in SBML must conform to all of them -in order to be considered valid. Rules of the latter kind are -consistency rules. To help highlight these differences, we use the -following three symbols next to the rule numbers: - -\begin{description} - -\item[\hspace*{6.5pt}\vSymbol\vsp] A \vSymbolName indicates a -\emph{requirement} for SBML conformance. If a model does not follow this -rule, it does not conform to the \SpatialProcessesPackage specification. -(Mnemonic intention behind the choice of symbol: ``This must be -checked.'') - -\item[\hspace*{6.5pt}\cSymbol\csp] A \cSymbolName indicates a -\emph{recommendation} for model consistency. If a model does not follow -this rule, it is not considered strictly invalid as far as the -\SpatialProcessesPackage specification is concerned; however, it -indicates that the model contains a physical or conceptual -inconsistency. (Mnemonic intention behind the choice of symbol: ``This -is a cause for warning.'') - -\item[\hspace*{6.5pt}\mSymbol\msp] A \mSymbolName indicates a strong -recommendation for good modeling practice. This rule is not strictly a -matter of SBML encoding, but the recommendation comes from logical -reasoning. As in the previous case, if a model does not follow this -rule, it is not strictly considered an invalid SBML encoding. (Mnemonic -intention behind the choice of symbol: ``You're a star if you heed -this.'') - -\end{description} - -The validation rules listed in the following subsections are all stated -or implied in the rest of this specification document. They are -enumerated here for convenience. Unless explicitly stated, all -validation rules concern objects and attributes specifically defined in -the \SpatialProcessesPackage package. - -For \notice convenience and brevity, we use the shorthand -``\token{spatial:\-x}'' to stand for an attribute or element name -\token{x} in the namespace for the \SpatialProcessesPackage package, -using the namespace prefix \token{spatial}. In reality, the prefix -string may be different from the literal ``\token{spatial}'' used here -(and indeed, it can be any valid XML namespace prefix that the modeler -or software chooses). We use ``\token{spatial:\-x}'' because it is -shorter than to write a full explanation everywhere we refer to an -attribute or element in the \SpatialProcessesPackage namespace. - -\subsubsection*{General rules about this package} - -\validRule{spatial-10101}{To conform to the \SpatialProcessesPackage -specification for SBML Level~3 Version~1, an SBML document must declare -\uri{http://www.sbml.org/sbml/level3/version1/spatial/version1} as the -XMLNamespace to use for elements of this package. (Reference: SBML -Level~3 Package specification for Spatial Processes, Version~1 -\sec{xml-namespace}.)} - -\validRule{spatial-10102}{Wherever they appear in an SBML document, -elements and attributes from the \SpatialProcessesPackage must use the -\uri{http://www.sbml.org/sbml/level3/version1/spatial/version1} -namespace, declaring so either explicitly or implicitly. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1 -\sec{xml-namespace}.)} - -\subsubsection*{General rules about identifiers} - -\validRule{spatial-10301}{(Extends validation rule \#10301 in the -\sbmlthreecore specification. TO DO list scope of ids) (Reference: SBML -Level~3 Version~1 Core, Section~3.1.7.)} - -\validRule{spatial-10302}{The value of a \token{spatial:\-id} must -conform to the syntax of the \class{SBML} data type \primtype{SId} -(Reference: SBML Level~3 Version~1 Core, Section~3.1.7.)} - -\draftnote{ANY LIST OF ELEMENTS THAT HAVE ATTRIBUTES} - -\subsubsection*{Rules for the extended \class{SBML} class} - -\validRule{spatial-20101}{In all SBML documents using the -\SpatialProcessesPackage, the \class{SBML} object must have the -\token{spatial:\-required} attribute. (Reference: SBML Level~3 Version~1 -Core, Section~4.1.2.)} - -\validRule{spatial-20102}{The value of attribute -\token{spatial:\-required} on the \class{SBML} object must be of data -type \primtype{boolean}. (Reference: SBML Level~3 Version~1 Core, -Section~4.1.2.)} - -\validRule{spatial-20103}{The value of attribute -\token{spatial:\-required} on the \class{SBML} object must be set to -\val{true}. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1 \sec{xml-namespace}.)} - -\subsubsection*{Rules for extended \class{Model} object} - -\validRule{spatial-20201}{A \Model object may contain one and only one -instance of the \Geometry element. No other elements from the SBML Level -3 Spatial Processes namespaces are permitted on a \Model object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{extended-model-class}.)} - - -\subsubsection*{Rules for extended \class{Compartment} object} - -\validRule{spatial-20301}{A \Compartment object may contain one and only -one instance of the \CompartmentMapping element. No other elements from -the SBML Level 3 Spatial Processes namespaces are permitted on a -\Compartment object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{extended-compartment-class}.)} - - -\subsubsection*{Rules for extended \class{Species} object} - -\validRule{spatial-20401}{A \Species object may have the optional -attribute \token{spatial:\-isSpatial}. No other attributes from the SBML -Level 3 Spatial Processes namespaces are permitted on a \Species object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{extended-species-class}.)} - -\validRule{spatial-20402}{The attribute \token{spatial:\-isSpatial} on a -\Species must have a value of data type \token{boolean}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{extended-species-class}.)} - - -\subsubsection*{Rules for extended \class{Parameter} object} - -\validRule{spatial-20501}{A \Parameter object may contain one and only -one instance of each of the \SpatialSymbolReference, -\AdvectionCoefficient, \BoundaryCondition and \DiffusionCoefficient -elements. No other elements from the SBML Level 3 Spatial Processes -namespaces are permitted on a \Parameter object. (Reference: SBML -Level~3 Package specification for Spatial Processes, Version~1, -\sec{extended-parameter-class}.)} - - -\subsubsection*{Rules for extended \class{Reaction} object} - -\validRule{spatial-20601}{A \Reaction object must have the required -attribute \token{spatial:\-isLocal}. No other attributes from the SBML -Level 3 Spatial Processes namespaces are permitted on a \Reaction -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{extended-reaction-class}.)} - -\validRule{spatial-20602}{The attribute \token{spatial:\-isLocal} on a -\Reaction must have a value of data type \token{boolean}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{extended-reaction-class}.)} - - -\subsubsection*{Rules for \class{DomainType} object} - -\validRule{spatial-20701}{A \DomainType object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \DomainType. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-20702}{A \DomainType object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\DomainType. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-20703}{A \DomainType object must have the required -attributes \token{spatial:\-id} and \token{spatial:\-spatialDimensions}. -No other attributes from the SBML Level 3 Spatial Processes namespaces -are permitted on a \DomainType object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{domaintype-class}.)} - -\validRule{spatial-20704}{The attribute -\token{spatial:\-spatialDimensions} on a \DomainType must have a value -of data type \token{integer}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{domaintype-class}.)} - - -\subsubsection*{Rules for \class{Domain} object} - -\validRule{spatial-20801}{A \Domain object may have the optional SBML -Level~3 Core attributes \token{metaid} and \token{sboTerm}. No other -attributes from the SBML Level 3 Core namespaces are permitted on a -\Domain. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-20802}{A \Domain object may have the optional SBML -Level~3 Core subobjects for notes and annotations. No other elements -from the SBML Level 3 Core namespaces are permitted on a \Domain. -(Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-20803}{A \Domain object must have the required -attributes \token{spatial:\-id} and \token{spatial:\-domainType}. No -other attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \Domain object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, \sec{domain-class}.)} - -\validRule{spatial-20804}{A \Domain object may contain one and only one -instance of the \ListOfInteriorPoints element. No other elements from -the SBML Level 3 Spatial Processes namespaces are permitted on a \Domain -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{domain-class}.)} - -\validRule{spatial-20805}{The value of the attribute -\token{spatial:\-domainType} of a \Domain object must be the identifier -of an existing \ object defined in the enclosing \Model object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{domain-class}.)} - -\validRule{spatial-20806}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfInteriorPoints -container object may only contain \InteriorPoint objects. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofinteriorpoints-class}.)} - -\validRule{spatial-20807}{A \ListOfInteriorPoints object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ListOfInteriorPoints object. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofinteriorpoints-class}.)} - - -\subsubsection*{Rules for \class{InteriorPoint} object} - -\validRule{spatial-20901}{An \InteriorPoint object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -an \InteriorPoint. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-20902}{An \InteriorPoint object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on an -\InteriorPoint. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-20903}{An \InteriorPoint object must have the -required attribute \token{spatial:\-coordOne}, and may have the optional -attributes \token{spatial:\-coordTwo} and \token{spatial:\-coordThree}. -No other attributes from the SBML Level 3 Spatial Processes namespaces -are permitted on an \InteriorPoint object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{interiorpoint-class}.)} - -\validRule{spatial-20904}{The attribute \token{spatial:\-coordOne} on an -\InteriorPoint must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{interiorpoint-class}.)} - -\validRule{spatial-20905}{The attribute \token{spatial:\-coordTwo} on an -\InteriorPoint must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{interiorpoint-class}.)} - -\validRule{spatial-20906}{The attribute \token{spatial:\-coordThree} on -an \InteriorPoint must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{interiorpoint-class}.)} - - -\subsubsection*{Rules for \class{Boundary} object} - -\validRule{spatial-21001}{A \Boundary object may have the optional SBML -Level~3 Core attributes \token{metaid} and \token{sboTerm}. No other -attributes from the SBML Level 3 Core namespaces are permitted on a -\Boundary. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21002}{A \Boundary object may have the optional SBML -Level~3 Core subobjects for notes and annotations. No other elements -from the SBML Level 3 Core namespaces are permitted on a \Boundary. -(Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21003}{A \Boundary object must have the required -attributes \token{spatial:\-id} and \token{spatial:\-value}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \Boundary object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, \sec{boundary-class}.)} - -\validRule{spatial-21004}{The attribute \token{spatial:\-value} on a -\Boundary must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{boundary-class}.)} - - -\subsubsection*{Rules for \class{AdjacentDomains} object} - -\validRule{spatial-21101}{An \AdjacentDomains object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on an \AdjacentDomains. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21102}{An \AdjacentDomains object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on an -\AdjacentDomains. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21103}{An \AdjacentDomains object must have the -required attributes \token{spatial:\-id}, \token{spatial:\-domainOne} -and \token{spatial:\-domainTwo}. No other attributes from the SBML Level -3 Spatial Processes namespaces are permitted on an \AdjacentDomains -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{adjacentdomains-class}.)} - -\validRule{spatial-21104}{The value of the attribute -\token{spatial:\-domainOne} of an \AdjacentDomains object must be the -identifier of an existing \Domain object defined in the enclosing \Model -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{adjacentdomains-class}.)} - -\validRule{spatial-21105}{The value of the attribute -\token{spatial:\-domainTwo} of an \AdjacentDomains object must be the -identifier of an existing \Domain object defined in the enclosing \Model -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{adjacentdomains-class}.)} - - -\subsubsection*{Rules for \class{GeometryDefinition} object} - -\validRule{spatial-21201}{A \GeometryDefinition object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \GeometryDefinition. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21202}{A \GeometryDefinition object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\GeometryDefinition. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21203}{A \GeometryDefinition object must have the -required attributes \token{spatial:\-id} and \token{spatial:\-isActive}. -No other attributes from the SBML Level 3 Spatial Processes namespaces -are permitted on a \GeometryDefinition object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{geometrydefinition-class}.)} - -\validRule{spatial-21204}{The attribute \token{spatial:\-isActive} on a -\GeometryDefinition must have a value of data type \token{boolean}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{geometrydefinition-class}.)} - - -\subsubsection*{Rules for \class{CompartmentMapping} object} - -\validRule{spatial-21301}{A \CompartmentMapping object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \CompartmentMapping. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21302}{A \CompartmentMapping object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\CompartmentMapping. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21303}{A \CompartmentMapping object must have the -required attributes \token{spatial:\-id}, \token{spatial:\-domainType} -and \token{spatial:\-unitSize}. No other attributes from the SBML Level -3 Spatial Processes namespaces are permitted on a \CompartmentMapping -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{compartmentmapping-class}.)} - -\validRule{spatial-21304}{The value of the attribute -\token{spatial:\-domainType} of a \CompartmentMapping object must be the -identifier of an existing \DomainType object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{compartmentmapping-class}.)} - -\validRule{spatial-21305}{The attribute \token{spatial:\-unitSize} on a -\CompartmentMapping must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{compartmentmapping-class}.)} - - -\subsubsection*{Rules for \class{CoordinateComponent} object} - -\validRule{spatial-21401}{A \CoordinateComponent object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \CoordinateComponent. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21402}{A \CoordinateComponent object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\CoordinateComponent. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21403}{A \CoordinateComponent object must have the -required attributes \token{spatial:\-id} and \token{spatial:\-type}, and -may have the optional attribute \token{spatial:\-unit}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CoordinateComponent object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{coordinatecomponent-class}.)} - -\validRule{spatial-21404}{A \CoordinateComponent object must contain one -and only one instance of each of the Boundary and \Boundary elements. No -other elements from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CoordinateComponent object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{coordinatecomponent-class}.)} - -\validRule{spatial-21405}{The value of the attribute -\token{spatial:\-type} of a \CoordinateComponent object must conform to -the syntax of SBML data type \primtype{coordinateKind} and may only take -on the allowed values of \primtype{coordinateKind} defined in SBML; that -is, the value must be one of the following: 'cartesianX', 'cartesianY' -or 'cartesianZ'. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{coordinatecomponent-class}.)} - -\validRule{spatial-21406}{The value of the attribute -\token{spatial:\-unit} on a \CoordinateComponent must have a taken from -the following: the identifier of a \UnitDefinition object in the -enclosing \Model, or one of the base units in SBML. (Reference: SBML -Level~3 Package specification for Spatial Processes, Version~1, -\sec{coordinatecomponent-class}.)} - - -\subsubsection*{Rules for \class{SampledFieldGeometry} object} - -\validRule{spatial-21501}{A \SampledFieldGeometry object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \SampledFieldGeometry. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21502}{A \SampledFieldGeometry object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\SampledFieldGeometry. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21503}{A \SampledFieldGeometry object must have the -required attribute \token{spatial:\-sampledField}. No other attributes -from the SBML Level 3 Spatial Processes namespaces are permitted on a -\SampledFieldGeometry object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{sampledfieldgeometry-class}.)} - -\validRule{spatial-21504}{A \SampledFieldGeometry object may contain one -and only one instance of the \ListOfSampledVolumes element. No other -elements from the SBML Level 3 Spatial Processes namespaces are -permitted on a \SampledFieldGeometry object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{sampledfieldgeometry-class}.)} - -\validRule{spatial-21505}{The value of the attribute -\token{spatial:\-sampledField} of a \SampledFieldGeometry object must be -the identifier of an existing \SampledField object defined in the -enclosing \Model object. (Reference: SBML Level~3 Package specification -for Spatial Processes, Version~1, \sec{sampledfieldgeometry-class}.)} - -\validRule{spatial-21506}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfSampledVolumes -container object may only contain \SampledVolume objects. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofsampledvolumes-class}.)} - -\validRule{spatial-21507}{A \ListOfSampledVolumes object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ListOfSampledVolumes object. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofsampledvolumes-class}.)} - - -\subsubsection*{Rules for \class{SampledField} object} - -\validRule{spatial-21601}{A \SampledField object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \SampledField. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21602}{A \SampledField object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\SampledField. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21603}{A \SampledField object must have the required -attributes \token{spatial:\-id}, \token{spatial:\-dataType}, -\token{spatial:\-numSamplesOne}, \token{spatial:\-interpolationType}, -\token{spatial:\-compression}, \token{spatial:\-samples} and -\token{spatial:\-samplesLength}, and may have the optional attributes -\token{spatial:\-numSamplesTwo} and \token{spatial:\-numSamplesThree}. -No other attributes from the SBML Level 3 Spatial Processes namespaces -are permitted on a \SampledField object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{sampledfield-class}.)} - -\validRule{spatial-21604}{The value of the attribute -\token{spatial:\-dataType} of a \SampledField object must conform to the -syntax of SBML data type \primtype{dataKind} and may only take on the -allowed values of \primtype{dataKind} defined in SBML; that is, the -value must be one of the following: 'double', 'float', 'uint8', 'uint16' -or 'uint32'. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{sampledfield-class}.)} - -\validRule{spatial-21605}{The attribute \token{spatial:\-numSamplesOne} -on a \SampledField must have a value of data type \token{integer}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledfield-class}.)} - -\validRule{spatial-21606}{The value of the attribute -\token{spatial:\-interpolationType} of a \SampledField object must -conform to the syntax of SBML data type \primtype{interpolationKind} and -may only take on the allowed values of \primtype{interpolationKind} -defined in SBML; that is, the value must be one of the following: -'nearestNeighbor' or 'linear'. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{sampledfield-class}.)} - -\validRule{spatial-21607}{The value of the attribute -\token{spatial:\-compression} of a \SampledField object must conform to -the syntax of SBML data type \primtype{compressionKind} and may only -take on the allowed values of \primtype{compressionKind} defined in -SBML; that is, the value must be one of the following: 'uncompressed' or -'deflated'. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{sampledfield-class}.)} - -\validRule{spatial-21608}{The value of the attribute -\token{spatial:\-samples} of a \SampledField object must be an array of -values of type \token{Int}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{sampledfield-class}.)} - -\validRule{spatial-21609}{The attribute \token{spatial:\-samplesLength} -on a \SampledField must have a value of data type \token{integer}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledfield-class}.)} - -\validRule{spatial-21610}{The attribute \token{spatial:\-numSamplesTwo} -on a \SampledField must have a value of data type \token{integer}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledfield-class}.)} - -\validRule{spatial-21611}{The attribute -\token{spatial:\-numSamplesThree} on a \SampledField must have a value -of data type \token{integer}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{sampledfield-class}.)} - - -\subsubsection*{Rules for \class{SampledVolume} object} - -\validRule{spatial-21701}{A \SampledVolume object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \SampledVolume. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21702}{A \SampledVolume object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\SampledVolume. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21703}{A \SampledVolume object must have the required -attributes \token{spatial:\-id}, \token{spatial:\-domainType} and -\token{spatial:\-sampledValue}, and may have the optional attributes -\token{spatial:\-minValue} and \token{spatial:\-maxValue}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \SampledVolume object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{sampledvolume-class}.)} - -\validRule{spatial-21704}{The value of the attribute -\token{spatial:\-domainType} of a \SampledVolume object must be the -identifier of an existing \DomainType object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{sampledvolume-class}.)} - -\validRule{spatial-21705}{The attribute \token{spatial:\-sampledValue} -on a \SampledVolume must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledvolume-class}.)} - -\validRule{spatial-21706}{The attribute \token{spatial:\-minValue} on a -\SampledVolume must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledvolume-class}.)} - -\validRule{spatial-21707}{The attribute \token{spatial:\-maxValue} on a -\SampledVolume must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{sampledvolume-class}.)} - - -\subsubsection*{Rules for \class{AnalyticGeometry} object} - -\validRule{spatial-21801}{An \AnalyticGeometry object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on an \AnalyticGeometry. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21802}{An \AnalyticGeometry object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on an -\AnalyticGeometry. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-21803}{An \AnalyticGeometry object may contain one -and only one instance of the \ListOfAnalyticVolumes element. No other -elements from the SBML Level 3 Spatial Processes namespaces are -permitted on an \AnalyticGeometry object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{analyticgeometry-class}.)} - -\validRule{spatial-21804}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfAnalyticVolumes -container object may only contain \AnalyticVolume objects. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofanalyticvolumes-class}.)} - -\validRule{spatial-21805}{A \ListOfAnalyticVolumes object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ListOfAnalyticVolumes object. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofanalyticvolumes-class}.)} - - -\subsubsection*{Rules for \class{AnalyticVolume} object} - -\validRule{spatial-21901}{An \AnalyticVolume object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on an \AnalyticVolume. (Reference: SBML Level~3 -Version~1 Core, Section~3.2.)} - -\validRule{spatial-21902}{An \AnalyticVolume object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on an -\AnalyticVolume. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-21903}{An \AnalyticVolume object must have the -required attributes \token{spatial:\-id}, \token{spatial:\-functionType} -and \token{spatial:\-domainType}, and may have the optional attribute -\token{spatial:\-ordinal}. No other attributes from the SBML Level 3 -Spatial Processes namespaces are permitted on an \AnalyticVolume object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{analyticvolume-class}.)} - -\validRule{spatial-21904}{An \AnalyticVolume object may contain one and -only one instance of the ASTNode element. No other elements from the -SBML Level 3 Spatial Processes namespaces are permitted on an -\AnalyticVolume object. (Reference: SBML Level~3 Package specification -for Spatial Processes, Version~1, \sec{analyticvolume-class}.)} - -\validRule{spatial-21905}{The value of the attribute -\token{spatial:\-functionType} of an \AnalyticVolume object must conform -to the syntax of SBML data type \primtype{functionKind} and may only -take on the allowed values of \primtype{functionKind} defined in SBML; -that is, the value must be one of the following: 'layered'. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{analyticvolume-class}.)} - -\validRule{spatial-21906}{The value of the attribute -\token{spatial:\-domainType} of an \AnalyticVolume object must be the -identifier of an existing \DomainType object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{analyticvolume-class}.)} - -\validRule{spatial-21907}{The attribute \token{spatial:\-ordinal} on an -\AnalyticVolume must have a value of data type \token{integer}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{analyticvolume-class}.)} - - -\subsubsection*{Rules for \class{ParametricGeometry} object} - -\validRule{spatial-22001}{A \ParametricGeometry object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ParametricGeometry. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22002}{A \ParametricGeometry object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\ParametricGeometry. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-22003}{A \ParametricGeometry object may contain one -and only one instance of each of the SpatialPoints and -\ListOfParametricObjects elements. No other elements from the SBML Level -3 Spatial Processes namespaces are permitted on a \ParametricGeometry -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{parametricgeometry-class}.)} - -\validRule{spatial-22004}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfParametricObjects -container object may only contain \ParametricObject objects. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofparametricobjects-class}.)} - -\validRule{spatial-22005}{A \ListOfParametricObjects object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ListOfParametricObjects object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{listofparametricobjects-class}.)} - - -\subsubsection*{Rules for \class{ParametricObject} object} - -\validRule{spatial-22101}{A \ParametricObject object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ParametricObject. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22102}{A \ParametricObject object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\ParametricObject. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-22103}{A \ParametricObject object must have the -required attributes \token{spatial:\-id}, \token{spatial:\-polygonType}, -\token{spatial:\-domainType}, \token{spatial:\-pointIndex}, -\token{spatial:\-pointIndexLength} and \token{spatial:\-compression}, -and may have the optional attribute \token{spatial:\-dataType}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \ParametricObject object. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{parametricobject-class}.)} - -\validRule{spatial-22104}{The value of the attribute -\token{spatial:\-polygonType} of a \ParametricObject object must conform -to the syntax of SBML data type \primtype{polygonKind} and may only take -on the allowed values of \primtype{polygonKind} defined in SBML; that -is, the value must be one of the following: 'triangle' or -'quadrilateral'. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{parametricobject-class}.)} - -\validRule{spatial-22105}{The value of the attribute -\token{spatial:\-domainType} of a \ParametricObject object must be the -identifier of an existing \DomainType object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{parametricobject-class}.)} - -\validRule{spatial-22106}{The value of the attribute -\token{spatial:\-pointIndex} of a \ParametricObject object must be an -array of values of type \token{Int}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{parametricobject-class}.)} - -\validRule{spatial-22107}{The attribute -\token{spatial:\-pointIndexLength} on a \ParametricObject must have a -value of data type \token{integer}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{parametricobject-class}.)} - -\validRule{spatial-22108}{The value of the attribute -\token{spatial:\-compression} of a \ParametricObject object must conform -to the syntax of SBML data type \primtype{compressionKind} and may only -take on the allowed values of \primtype{compressionKind} defined in -SBML; that is, the value must be one of the following: 'uncompressed' or -'deflated'. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{parametricobject-class}.)} - -\validRule{spatial-22109}{The value of the attribute -\token{spatial:\-dataType} of a \ParametricObject object must conform to -the syntax of SBML data type \primtype{dataKind} and may only take on -the allowed values of \primtype{dataKind} defined in SBML; that is, the -value must be one of the following: 'double', 'float', 'uint8', 'uint16' -or 'uint32'. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{parametricobject-class}.)} - - -\subsubsection*{Rules for \class{CSGeometry} object} - -\validRule{spatial-22201}{A \CSGeometry object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \CSGeometry. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22202}{A \CSGeometry object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\CSGeometry. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22203}{A \CSGeometry object may contain one and only -one instance of the \ListOfCSGObjects element. No other elements from -the SBML Level 3 Spatial Processes namespaces are permitted on a -\CSGeometry object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{csgeometry-class}.)} - -\validRule{spatial-22204}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfCSGObjects container -object may only contain \CSGObject objects. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{listofcsgobjects-class}.)} - -\validRule{spatial-22205}{A \ListOfCSGObjects object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \ListOfCSGObjects object. (Reference: SBML -Level~3 Package specification for Spatial Processes, Version~1, -\sec{listofcsgobjects-class}.)} - - -\subsubsection*{Rules for \class{CSGObject} object} - -\validRule{spatial-22301}{A \CSGObject object may have the optional SBML -Level~3 Core attributes \token{metaid} and \token{sboTerm}. No other -attributes from the SBML Level 3 Core namespaces are permitted on a -\CSGObject. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22302}{A \CSGObject object may have the optional SBML -Level~3 Core subobjects for notes and annotations. No other elements -from the SBML Level 3 Core namespaces are permitted on a \CSGObject. -(Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22303}{A \CSGObject object must have the required -attributes \token{spatial:\-id} and \token{spatial:\-domainType}, and -may have the optional attribute \token{spatial:\-ordinal}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CSGObject object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, \sec{csgobject-class}.)} - -\validRule{spatial-22304}{A \CSGObject object must contain one and only -one instance of the CSGNode element. No other elements from the SBML -Level 3 Spatial Processes namespaces are permitted on a \CSGObject -object. (Reference: SBML Level~3 Package specification for Spatial -Processes, Version~1, \sec{csgobject-class}.)} - -\validRule{spatial-22305}{The value of the attribute -\token{spatial:\-domainType} of a \CSGObject object must be the -identifier of an existing \DomainType object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{csgobject-class}.)} - -\validRule{spatial-22306}{The attribute \token{spatial:\-ordinal} on a -\CSGObject must have a value of data type \token{integer}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgobject-class}.)} - - -\subsubsection*{Rules for \class{CSGNode} object} - -\validRule{spatial-22401}{A \CSGNode object may have the optional SBML -Level~3 Core attributes \token{metaid} and \token{sboTerm}. No other -attributes from the SBML Level 3 Core namespaces are permitted on a -\CSGNode. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22402}{A \CSGNode object may have the optional SBML -Level~3 Core subobjects for notes and annotations. No other elements -from the SBML Level 3 Core namespaces are permitted on a \CSGNode. -(Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22403}{A \CSGNode object may have the optional -attribute \token{spatial:\-id}. No other attributes from the SBML Level -3 Spatial Processes namespaces are permitted on a \CSGNode object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgnode-class}.)} - - -\subsubsection*{Rules for \class{CSGTransformation} object} - -\validRule{spatial-22501}{A \CSGTransformation object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \CSGTransformation. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22502}{A \CSGTransformation object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\CSGTransformation. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-22503}{A \CSGTransformation object may contain one -and only one instance of the CSGNode element. No other elements from the -SBML Level 3 Spatial Processes namespaces are permitted on a -\CSGTransformation object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{csgtransformation-class}.)} - - -\subsubsection*{Rules for \class{CSGTranslation} object} - -\validRule{spatial-22601}{A \CSGTranslation object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \CSGTranslation. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-22602}{A \CSGTranslation object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\CSGTranslation. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22603}{A \CSGTranslation object must have the -required attribute \token{spatial:\-translateX}, and may have the -optional attributes \token{spatial:\-translateY} and -\token{spatial:\-translateZ}. No other attributes from the SBML Level 3 -Spatial Processes namespaces are permitted on a \CSGTranslation object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgtranslation-class}.)} - -\validRule{spatial-22604}{The attribute \token{spatial:\-translateX} on -a \CSGTranslation must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgtranslation-class}.)} - -\validRule{spatial-22605}{The attribute \token{spatial:\-translateY} on -a \CSGTranslation must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgtranslation-class}.)} - -\validRule{spatial-22606}{The attribute \token{spatial:\-translateZ} on -a \CSGTranslation must have a value of data type \token{double}. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgtranslation-class}.)} - - -\subsubsection*{Rules for \class{CSGRotation} object} - -\validRule{spatial-22701}{A \CSGRotation object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \CSGRotation. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22702}{A \CSGRotation object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\CSGRotation. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22703}{A \CSGRotation object must have the required -attributes \token{spatial:\-rotateX} and -\token{spatial:\-rotateAngleInRadians}, and may have the optional -attributes \token{spatial:\-rotateY} and \token{spatial:\-rotateZ}. No -other attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CSGRotation object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{csgrotation-class}.)} - -\validRule{spatial-22704}{The attribute \token{spatial:\-rotateX} on a -\CSGRotation must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgrotation-class}.)} - -\validRule{spatial-22705}{The attribute -\token{spatial:\-rotateAngleInRadians} on a \CSGRotation must have a -value of data type \token{double}. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{csgrotation-class}.)} - -\validRule{spatial-22706}{The attribute \token{spatial:\-rotateY} on a -\CSGRotation must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgrotation-class}.)} - -\validRule{spatial-22707}{The attribute \token{spatial:\-rotateZ} on a -\CSGRotation must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgrotation-class}.)} - - -\subsubsection*{Rules for \class{CSGScale} object} - -\validRule{spatial-22801}{A \CSGScale object may have the optional SBML -Level~3 Core attributes \token{metaid} and \token{sboTerm}. No other -attributes from the SBML Level 3 Core namespaces are permitted on a -\CSGScale. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22802}{A \CSGScale object may have the optional SBML -Level~3 Core subobjects for notes and annotations. No other elements -from the SBML Level 3 Core namespaces are permitted on a \CSGScale. -(Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22803}{A \CSGScale object must have the required -attribute \token{spatial:\-scaleX}, and may have the optional attributes -\token{spatial:\-scaleY} and \token{spatial:\-scaleZ}. No other -attributes from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CSGScale object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, \sec{csgscale-class}.)} - -\validRule{spatial-22804}{The attribute \token{spatial:\-scaleX} on a -\CSGScale must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgscale-class}.)} - -\validRule{spatial-22805}{The attribute \token{spatial:\-scaleY} on a -\CSGScale must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgscale-class}.)} - -\validRule{spatial-22806}{The attribute \token{spatial:\-scaleZ} on a -\CSGScale must have a value of data type \token{double}. (Reference: -SBML Level~3 Package specification for Spatial Processes, Version~1, -\sec{csgscale-class}.)} - - -\subsubsection*{Rules for \class{CSGHomogeneousTransformation} object} - -\validRule{spatial-22901}{A \CSGHomogeneousTransformation object may -have the optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \CSGHomogeneousTransformation. (Reference: -SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-22902}{A \CSGHomogeneousTransformation object may -have the optional SBML Level~3 Core subobjects for notes and -annotations. No other elements from the SBML Level 3 Core namespaces are -permitted on a \CSGHomogeneousTransformation. (Reference: SBML Level~3 -Version~1 Core, Section~3.2.)} - -\validRule{spatial-22903}{A \CSGHomogeneousTransformation object must -contain two child \TransformationComponent elements, one with the name 'forwardTransformation' and the other with the name 'reverseTransformation'. No -other elements from the SBML Level 3 Spatial Processes namespaces are -permitted on a \CSGHomogeneousTransformation object. (Reference: SBML -Level~3 Package specification for Spatial Processes, Version~1, -\sec{csghomogeneoustransformation-class}.)} - - -\subsubsection*{Rules for \class{TransformationComponent} object} - -\validRule{spatial-23001}{A \TransformationComponent object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \TransformationComponent. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-23002}{A \TransformationComponent object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\TransformationComponent. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-23003}{A \TransformationComponent object must have -the required attributes \token{spatial:\-components} and -\token{spatial:\-componentsLength}. No other attributes from the SBML -Level 3 Spatial Processes namespaces are permitted on a -\TransformationComponent object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{transformationcomponent-class}.)} - -\validRule{spatial-23004}{The value of the attribute -\token{spatial:\-components} of a \TransformationComponent object must -be an array of values of type \token{Double}. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{transformationcomponent-class}.)} - -\validRule{spatial-23005}{The attribute -\token{spatial:\-componentsLength} on a \TransformationComponent must -have a value of data type \token{integer}. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{transformationcomponent-class}.)} - - -\subsubsection*{Rules for \class{CSGPrimitive} object} - -\validRule{spatial-23101}{A \CSGPrimitive object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \CSGPrimitive. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-23102}{A \CSGPrimitive object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\CSGPrimitive. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-23103}{A \CSGPrimitive object must have the required -attribute \token{spatial:\-primitiveType}. No other attributes from the -SBML Level 3 Spatial Processes namespaces are permitted on a -\CSGPrimitive object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{csgprimitive-class}.)} - -\validRule{spatial-23104}{The value of the attribute -\token{spatial:\-primitiveType} of a \CSGPrimitive object must conform -to the syntax of SBML data type \primtype{primitiveKind} and may only -take on the allowed values of \primtype{primitiveKind} defined in SBML; -that is, the value must be one of the following: 'sphere', 'cube', -'cylinder', 'cone', 'circle' or 'square'. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{csgprimitive-class}.)} - - -\subsubsection*{Rules for \class{CSGSetOperator} object} - -\validRule{spatial-23201}{A \CSGSetOperator object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \CSGSetOperator. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-23202}{A \CSGSetOperator object may have the optional -SBML Level~3 Core subobjects for notes and annotations. No other -elements from the SBML Level 3 Core namespaces are permitted on a -\CSGSetOperator. (Reference: SBML Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-23203}{A \CSGSetOperator object must have the -required attribute \token{spatial:\-operationType}, and may have the -optional attributes \token{spatial:\-complementA} and -\token{spatial:\-complementB}. No other attributes from the SBML Level 3 -Spatial Processes namespaces are permitted on a \CSGSetOperator object. -(Reference: SBML Level~3 Package specification for Spatial Processes, -Version~1, \sec{csgsetoperator-class}.)} - -\validRule{spatial-23204}{A \CSGSetOperator object may contain one and -only one instance of the \ListOfCSGNodes element. No other elements from -the SBML Level 3 Spatial Processes namespaces are permitted on a -\CSGSetOperator object. (Reference: SBML Level~3 Package specification -for Spatial Processes, Version~1, \sec{csgsetoperator-class}.)} - -\validRule{spatial-23205}{The value of the attribute -\token{spatial:\-operationType} of a \CSGSetOperator object must conform -to the syntax of SBML data type \primtype{setOperation} and may only -take on the allowed values of \primtype{setOperation} defined in SBML; -that is, the value must be one of the following: 'union', 'intersection' -or '\changed{difference}'. (Reference: SBML Level~3 Package specification -for Spatial Processes, Version~1, \sec{csgsetoperator-class}.)} - -\validRule{spatial-23206}{The value of the attribute -\token{spatial:\-complementA} of a \CSGSetOperator object must be the -identifier of an existing \CSGNode object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{csgsetoperator-class}.)} - -\validRule{spatial-23207}{The value of the attribute -\token{spatial:\-complementB} of a \CSGSetOperator object must be the -identifier of an existing \CSGNode object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{csgsetoperator-class}.)} - -\validRule{spatial-23208}{Apart from the general notes and annotations -subobjects permitted on all SBML objects, a \ListOfCSGNodes container -object may only contain \CSGNode objects. (Reference: SBML Level~3 -Package specification for Spatial Processes, Version~1, -\sec{listofcsgnodes-class}.)} - -\validRule{spatial-23309}{A \ListOfCSGNodes object may have the optional -SBML Level~3 Core attributes \token{metaid} and \token{sboTerm}. No -other attributes from the SBML Level 3 Core namespaces are permitted on -a \ListOfCSGNodes object. (Reference: SBML Level~3 Package specification -for Spatial Processes, Version~1, \sec{listofcsgnodes-class}.)} - - -\subsubsection*{Rules for \class{SpatialSymbolReference} object} - -\validRule{spatial-23301}{A \SpatialSymbolReference object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from the SBML Level 3 Core -namespaces are permitted on a \SpatialSymbolReference. (Reference: SBML -Level~3 Version~1 Core, Section~3.2.)} - -\validRule{spatial-23302}{A \SpatialSymbolReference object may have the -optional SBML Level~3 Core subobjects for notes and annotations. No -other elements from the SBML Level 3 Core namespaces are permitted on a -\SpatialSymbolReference. (Reference: SBML Level~3 Version~1 Core, -Section~3.2.)} - -\validRule{spatial-23303}{A \SpatialSymbolReference object must have the -required attribute \token{spatial:\-spatialRef}. No other attributes -from the SBML Level 3 Spatial Processes namespaces are permitted on a -\SpatialSymbolReference object. (Reference: SBML Level~3 Package -specification for Spatial Processes, Version~1, -\sec{spatialsymbolreference-class}.)} - -\validRule{spatial-23304}{The value of the attribute -\token{spatial:\-spatialRef} of a \SpatialSymbolReference object must be -the identifier of an existing \Geometry object defined in the enclosing -\Model object. (Reference: SBML Level~3 Package specification for -Spatial Processes, Version~1, \sec{spatialsymbolreference-class}.)} - - -\subsubsection*{Rules for \class{DiffusionCoefficient} object} - -\validRule{spatial-23401}{A \DiffusionCoefficient object may have the -optional SBML Level~3 Core attributes \token{metaid} and -\token{sboTerm}. No other attributes from ... [truncated message content] |
From: <sar...@us...> - 2019-05-25 10:51:32
|
Revision: 26061 http://sourceforge.net/p/sbml/code/26061 Author: sarahkeating Date: 2019-05-25 10:51:25 +0000 (Sat, 25 May 2019) Log Message: ----------- Merged revision(s) 26058-26060 from branches/libsbml-experimental: Modified Paths: -------------- branches/libsbml-new-attribute-ns/src/sbml/SBase.h Modified: branches/libsbml-new-attribute-ns/src/sbml/SBase.h =================================================================== --- branches/libsbml-new-attribute-ns/src/sbml/SBase.h 2019-05-25 10:26:04 UTC (rev 26060) +++ branches/libsbml-new-attribute-ns/src/sbml/SBase.h 2019-05-25 10:51:25 UTC (rev 26061) @@ -2489,7 +2489,7 @@ * * @return @c false. */ - bool isSetMath () const; + virtual bool isSetMath () const; /** @endcond */ /** @cond doxygenLibsbmlInternal */ |
From: <sar...@us...> - 2019-05-25 10:26:08
|
Revision: 26060 http://sourceforge.net/p/sbml/code/26060 Author: sarahkeating Date: 2019-05-25 10:26:04 +0000 (Sat, 25 May 2019) Log Message: ----------- Merged revision(s) 26057-26059 from trunk/libsbml: Modified Paths: -------------- branches/libsbml-experimental/src/sbml/SBase.h Modified: branches/libsbml-experimental/src/sbml/SBase.h =================================================================== --- branches/libsbml-experimental/src/sbml/SBase.h 2019-05-25 10:23:40 UTC (rev 26059) +++ branches/libsbml-experimental/src/sbml/SBase.h 2019-05-25 10:26:04 UTC (rev 26060) @@ -2487,7 +2487,7 @@ * * @return @c false. */ - bool isSetMath () const; + virtual bool isSetMath () const; /** @endcond */ /** @cond doxygenLibsbmlInternal */ |
From: <sar...@us...> - 2019-05-25 10:23:46
|
Revision: 26059 http://sourceforge.net/p/sbml/code/26059 Author: sarahkeating Date: 2019-05-25 10:23:40 +0000 (Sat, 25 May 2019) Log Message: ----------- isSetMath on SBase should be virtual Modified Paths: -------------- trunk/libsbml/src/sbml/SBase.h Modified: trunk/libsbml/src/sbml/SBase.h =================================================================== --- trunk/libsbml/src/sbml/SBase.h 2019-05-23 20:25:26 UTC (rev 26058) +++ trunk/libsbml/src/sbml/SBase.h 2019-05-25 10:23:40 UTC (rev 26059) @@ -2487,7 +2487,7 @@ * * @return @c false. */ - bool isSetMath () const; + virtual bool isSetMath () const; /** @endcond */ /** @cond doxygenLibsbmlInternal */ |
From: <luc...@us...> - 2019-05-23 20:25:45
|
Revision: 26058 http://sourceforge.net/p/sbml/code/26058 Author: luciansmith Date: 2019-05-23 20:25:26 +0000 (Thu, 23 May 2019) Log Message: ----------- Merged revision(s) 26023-26057 from branches/libsbml-experimental. Modified Paths: -------------- branches/libsbml-new-attribute-ns/CMakeLists.txt branches/libsbml-new-attribute-ns/VERSION.txt branches/libsbml-new-attribute-ns/aclocal.m4 branches/libsbml-new-attribute-ns/configure branches/libsbml-new-attribute-ns/examples/java/render/printRenderInformation.java branches/libsbml-new-attribute-ns/examples/python/render/printRenderInformation.py branches/libsbml-new-attribute-ns/examples/render-package.cmake branches/libsbml-new-attribute-ns/src/bindings/csharp/local-packages-render.i branches/libsbml-new-attribute-ns/src/bindings/csharp/local.i branches/libsbml-new-attribute-ns/src/bindings/java/local-downcast-extension-render.i branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-comp.i branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-qual.i branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-render.i branches/libsbml-new-attribute-ns/src/bindings/javascript/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/javascript/local-render.i branches/libsbml-new-attribute-ns/src/bindings/perl/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/perl/local-render.i branches/libsbml-new-attribute-ns/src/bindings/php/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/php/local-render.i branches/libsbml-new-attribute-ns/src/bindings/python/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/python/local-render.i branches/libsbml-new-attribute-ns/src/bindings/r/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/r/local-render.i branches/libsbml-new-attribute-ns/src/bindings/ruby/local-downcast-packages-render.cpp branches/libsbml-new-attribute-ns/src/bindings/ruby/local-render.i branches/libsbml-new-attribute-ns/src/sbml/SBase.h branches/libsbml-new-attribute-ns/src/sbml/conversion/SBMLLevelVersionConverter.cpp branches/libsbml-new-attribute-ns/src/sbml/extension/ASTBasePlugin.cpp branches/libsbml-new-attribute-ns/src/sbml/extension/ASTBasePlugin.h branches/libsbml-new-attribute-ns/src/sbml/math/L3Parser.cpp branches/libsbml-new-attribute-ns/src/sbml/math/L3Parser.ypp branches/libsbml-new-attribute-ns/src/sbml/math/L3ParserSettings.cpp branches/libsbml-new-attribute-ns/src/sbml/math/L3ParserSettings.h branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/extension/DistribExtension.cpp branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/extension/DistribSBasePlugin.cpp branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/extension/test/TestDistribExtension.cpp branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/DistribAnnotationConverter.h branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/TestDistribAnnotationConverter.cpp branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/binomial_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/cauchy_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/chisquare_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/gamma_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/laplace_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/lognormal_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/lognormal_distrib.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_delay_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_event_assignment_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_l2v4_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_l3v1_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_l3v1b_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_l3v2_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_priority_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_submodel_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_submodel_distrib.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/rayleigh_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/truncated_gamma_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/truncated_normal_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/uniform_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp Added Paths: ----------- branches/libsbml-new-attribute-ns/examples/csharp/render/ branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/DistribToAnnotationConverter.h branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/binomial_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/cauchy_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/chisquare_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/exponential_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/gamma_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/laplace_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/lognormal_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/no_distrib.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_l3v2_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_submodel2_annot.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_submodel2_distrib.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/normal_submodel_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/poisson_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/rayleigh_annot_means.xml branches/libsbml-new-attribute-ns/src/sbml/packages/distrib/util/test/test-data/uniform_annot_means.xml Modified: branches/libsbml-new-attribute-ns/CMakeLists.txt =================================================================== --- branches/libsbml-new-attribute-ns/CMakeLists.txt 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/CMakeLists.txt 2019-05-23 20:25:26 UTC (rev 26058) @@ -149,7 +149,7 @@ set(CPACK_RPM_PACKAGE_GROUP "Libraries/Development") set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries") -set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/build/;/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") +set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/.vs/;/.vscode/;/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") if(UNIX) set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") Modified: branches/libsbml-new-attribute-ns/VERSION.txt =================================================================== --- branches/libsbml-new-attribute-ns/VERSION.txt 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/VERSION.txt 2019-05-23 20:25:26 UTC (rev 26058) @@ -1 +1 @@ -5.18.0 +5.18.1 Modified: branches/libsbml-new-attribute-ns/aclocal.m4 =================================================================== --- branches/libsbml-new-attribute-ns/aclocal.m4 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/aclocal.m4 2019-05-23 20:25:26 UTC (rev 26058) @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, Modified: branches/libsbml-new-attribute-ns/configure =================================================================== --- branches/libsbml-new-attribute-ns/configure 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/configure 2019-05-23 20:25:26 UTC (rev 26058) @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Revision: 25690 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libSBML 5.18.0. +# Generated by GNU Autoconf 2.69 for libSBML 5.18.1. # # Report bugs to <lib...@go...>. # @@ -735,8 +735,8 @@ # Identity of this package. PACKAGE_NAME='libSBML' PACKAGE_TARNAME='libsbml' -PACKAGE_VERSION='5.18.0' -PACKAGE_STRING='libSBML 5.18.0' +PACKAGE_VERSION='5.18.1' +PACKAGE_STRING='libSBML 5.18.1' PACKAGE_BUGREPORT='lib...@go...' PACKAGE_URL='http://sbml.org/Software/libSBML' @@ -1618,7 +1618,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libSBML 5.18.0 to adapt to many kinds of systems. +\`configure' configures libSBML 5.18.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1683,7 +1683,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libSBML 5.18.0:";; + short | recursive ) echo "Configuration of libSBML 5.18.1:";; esac cat <<\_ACEOF @@ -1839,7 +1839,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libSBML configure 5.18.0 +libSBML configure 5.18.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2558,7 +2558,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libSBML $as_me 5.18.0, which was +It was created by libSBML $as_me 5.18.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2948,7 +2948,7 @@ ac_config_headers="$ac_config_headers src/sbml/common/libsbml-namespace.h" -LIBSBML_VERSION_NUMERIC=51800 +LIBSBML_VERSION_NUMERIC=51801 @@ -2960,7 +2960,7 @@ -LIBSBML_REVISION_VERSION=0 +LIBSBML_REVISION_VERSION=1 @@ -27742,7 +27742,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libSBML $as_me 5.18.0, which was +This file was extended by libSBML $as_me 5.18.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27805,7 +27805,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libSBML config.status 5.18.0 +libSBML config.status 5.18.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: branches/libsbml-new-attribute-ns/examples/java/render/printRenderInformation.java =================================================================== --- branches/libsbml-new-attribute-ns/examples/java/render/printRenderInformation.java 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/examples/java/render/printRenderInformation.java 2019-05-23 20:25:26 UTC (rev 26058) @@ -6,21 +6,7 @@ // This file is part of libSBML. Please visit http://sbml.org for more // information about SBML, and the latest version of libSBML. // -import org.sbml.libsbml.ColorDefinition; -import org.sbml.libsbml.GlobalRenderInformation; -import org.sbml.libsbml.GlobalStyle; -import org.sbml.libsbml.GradientBase; -import org.sbml.libsbml.GradientStop; -import org.sbml.libsbml.Layout; -import org.sbml.libsbml.LayoutModelPlugin; -import org.sbml.libsbml.LinearGradient; -import org.sbml.libsbml.Model; -import org.sbml.libsbml.RadialGradient; -import org.sbml.libsbml.RelAbsVector; -import org.sbml.libsbml.RenderLayoutPlugin; -import org.sbml.libsbml.RenderListOfLayoutsPlugin; -import org.sbml.libsbml.SBMLDocument; -import org.sbml.libsbml.libsbml; +import org.sbml.libsbml.*; public class printRenderInformation { public static String toString(RelAbsVector vec) { @@ -35,10 +21,12 @@ System.exit(1); } + System.loadLibrary("sbmlj"); + String inputFile = args[0]; SBMLDocument doc = libsbml.readSBMLFromFile(inputFile); - long numErrors = doc.getNumErrors(); + long numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); if (numErrors > 0) { System.err.println("Encountered errors while reading the file. "); @@ -90,10 +78,9 @@ System.out.println("GradientDefinitions: "); for (long j = 0; j < info.getNumGradientDefinitions(); j++) { GradientBase gBase = info.getGradientDefinition(j); - LinearGradient linear = (LinearGradient) gBase; - RadialGradient radial = (RadialGradient) gBase; - if (linear != null) { + if (gBase instanceof LinearGradient) { + LinearGradient linear = (LinearGradient) gBase; System.out.println("\tLinear Gradient: " + linear.getId() + " start: " + toString(linear.getXPoint1()) + ", " @@ -100,7 +87,8 @@ + toString(linear.getYPoint1()) + " end: " + toString(linear.getXPoint2()) + ", " + toString(linear.getYPoint2())); - } else if (radial != null) { + } else if (gBase instanceof RadialGradient) { + RadialGradient radial = (RadialGradient) gBase; System.out.println("\tRadial Gradient: " + radial.getId() + " center: " + toString(radial.getCenterX()) + ", " @@ -127,10 +115,7 @@ for (long j = 0; j < info.getNumStyles(); j++) { GlobalStyle style = info.getStyle(j); - System.out.println("\tstyle " + j + " id: " + style.getId() - + " applies to: "); - System.out.println("\t\troles:" + style.createRoleString() - + " types: " + style.createTypeString()); + extracted(j, style); } @@ -141,12 +126,9 @@ // add render information to the first layout Layout layout = plugin.getLayout(0); - RenderLayoutPlugin rPlugin = (RenderLayoutPlugin) layout - .getPlugin("render"); - if (rPlugin != null - && rPlugin.getNumLocalRenderInformationObjects() > 0) { - System.out - .println("The loaded model contains local Render information. "); + RenderLayoutPlugin rPlugin = (RenderLayoutPlugin) layout.getPlugin("render"); + if (rPlugin != null && rPlugin.getNumLocalRenderInformationObjects() > 0) { + System.out.println("The loaded model contains local Render information. "); // here we would do the same as above for the local render // information ... } @@ -153,4 +135,31 @@ System.exit(0); } + + private static void extracted(long j, Style style) { + System.out.println("\tstyle " + j + " id: " + style.getId() + " applies to: "); + System.out.println("\t\troles:" + style.createRoleString() + " types: " + style.createTypeString()); + if (!style.isSetGroup()) + return; + RenderGroup group = style.getGroup(); + if (group.isSetStroke()) + System.out.println("\t\tstroke:" + group.getStroke()); + if (group.isSetFill()) + System.out.println("\t\tfill:" + group.getFill()); + for (int i = 0; i < group.getNumElements(); i++) + { + Transformation2D element = group.getElement(i); + if (element instanceof GraphicalPrimitive2D) + { + GraphicalPrimitive2D prim = (GraphicalPrimitive2D)element; + System.out.println("\t\tsubelement:" + prim.getElementName() + " fill: " + prim.getFill() + " stroke: " + prim.getStroke()); + } + else if (element instanceof GraphicalPrimitive1D) + { + GraphicalPrimitive1D prim = (GraphicalPrimitive1D)element; + System.out.println("\t\tsubelement:" + prim.getElementName() + " stroke: " + prim.getStroke()); + } + } + + } } Modified: branches/libsbml-new-attribute-ns/examples/python/render/printRenderInformation.py =================================================================== --- branches/libsbml-new-attribute-ns/examples/python/render/printRenderInformation.py 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/examples/python/render/printRenderInformation.py 2019-05-23 20:25:26 UTC (rev 26058) @@ -8,7 +8,7 @@ # import sys import os.path -from libsbml import * +import libsbml def toString(vec): @@ -27,88 +27,129 @@ inputFile = args[1]; - doc = readSBMLFromFile(inputFile); - numErrors = doc.getNumErrors(); + doc = libsbml.readSBMLFromFile(inputFile) - if (numErrors > 0): - print("Encountered errors while reading the file. "); - print("Please correct the following errors and try again."); - doc.printErrors(); - return 2; + print("Using libSBML: {0} supporting packages for:".format(libsbml.getLibSBMLDottedVersion())) + for i in range (libsbml.SBMLExtensionRegistry.getNumRegisteredPackages()): + print("\t" + libsbml.SBMLExtensionRegistry.getRegisteredPackageName(i)) - model = doc.getModel(); + print("\nThe document is: level {0}, version {1}".format(doc.getLevel(), doc.getVersion())) + for i in range(doc.getNumPlugins()): + print(" doc uses package: {0}".format(doc.getPlugin(i).getElementNamespace())) + + print("\n") - plugin = model.getPlugin("layout"); + numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR) - if (plugin == None or plugin.getNumLayouts() == 0): - print("The loaded model contains no layout information, please add these first."); - return 3; + if numErrors > 0: + print("Encountered errors while reading the file. ") + print("Please correct the following errors and try again.") + doc.printErrors() + return 2 - lolPlugin = plugin.getListOfLayouts().getPlugin("render"); + model = doc.getModel() + + plugin = model.getPlugin("layout") + + if plugin == None or plugin.getNumLayouts() == 0: + print("The loaded model contains no layout information, please add these first.") + return 3 + + lolPlugin = plugin.getListOfLayouts().getPlugin("render") if (lolPlugin != None and lolPlugin.getNumGlobalRenderInformationObjects() > 0): - print("The loaded model contains global Render information: "); + print("The loaded model contains global Render information: ") for i in range ( 0, lolPlugin.getNumGlobalRenderInformationObjects()): - info = lolPlugin.getRenderInformation(i); + info = lolPlugin.getRenderInformation(i) - print("Id: " + info.getId()); - print("Name: " + info.getName()); - print("Program Name: " + info.getProgramName()); - print("Program Version: " + info.getProgramVersion()); - print("Background color: " + info.getBackgroundColor()); + print_render_info(info) - print("Color Definitions:"); - for j in range ( 0, info.getNumColorDefinitions()): - color = info.getColorDefinition(j); - print("\tcolor: " + str(j) + - " id: " + color.getId() + - " color: " + color.createValueString()); + # add render information to the first layout + layout = plugin.getLayout(0) - print("GradientDefinitions: "); - for j in range (0, info.getNumGradientDefinitions()): - grad = info.getGradientDefinition(j); + rPlugin = layout.getPlugin("render") + if (rPlugin != None and rPlugin.getNumLocalRenderInformationObjects() > 0): + print("The loaded model contains local Render information. ") + # here we would do the same as above for the local render information ... - if (grad.getElementName() == "linearGradient"): - print("\tLinear Gradient: " + grad.getId() - + " start: " + toString(grad.getXPoint1()) + ", " + - toString(grad.getYPoint1()) - + " end: " + toString(grad.getXPoint2()) + ", " + - toString(grad.getYPoint2()) - ); - else: - print("\tRadial Gradient: " + grad.getId() - + " center: " + toString(grad.getCenterX()) + ", " + - toString(grad.getCenterY()) - + " focal: " + toString(grad.getFocalPointX()) + ", " + - toString(grad.getFocalPointY()) - ); + return 0 - for k in range (0, grad.getNumGradientStops()): - stop = grad.getGradientStop(k); - print("\t\tstop " + str(k) + " id: " + stop.getId() + " stop-color: " + - stop.getStopColor()); +def print_render_info(info): + if info.isSetId(): + print(" Id: " + info.getId()) + if info.isSetName(): + print(" Name: " + info.getName()) + if info.isSetProgramName(): + print(" Program Name: " + info.getProgramName()) + if info.isSetProgramVersion(): + print(" Program Version: " + info.getProgramVersion()) + if info.isSetBackgroundColor(): + print(" Background color: " + info.getBackgroundColor()) - # similarly for the remaining elements - print("\tNumber of Line Endings: " + str(info.getNumLineEndings())); + print("\nColor Definitions:") + for j in range ( 0, info.getNumColorDefinitions()): + color = info.getColorDefinition(j) + print("\tcolor: " + str(j) + + " id: " + color.getId() + + " color: " + color.createValueString()) - # and finally the styles + print("\nGradientDefinitions: ") + for j in range (0, info.getNumGradientDefinitions()): + grad = info.getGradientDefinition(j) - for j in range (0, info.getNumStyles()): - style = info.getStyle(j); + print_gradient_definition(grad) - print("\tstyle " + str(j) + " id: " + style.getId() + " applies to: "); - print("\t\troles:" + style.createRoleString() + - " types: " + style.createTypeString()); + # similarly for the remaining elements + print("\nNumber of Line Endings: " + str(info.getNumLineEndings())) - # add render information to the first layout - layout = plugin.getLayout(0); + # and finally the styles + print("\nStyles: ") + for j in range (0, info.getNumStyles()): + style = info.getStyle(j) + print_style(style, j) - rPlugin = layout.getPlugin("render"); - if (rPlugin != None and rPlugin.getNumLocalRenderInformationObjects() > 0): - print("The loaded model contains local Render information. "); - # here we would do the same as above for the local render information ... +def print_style(style, j): + # type: (libsbml.Style, int) -> None + print("\tstyle " + str(j) + " id: " + style.getId() + " applies to: ") + print("\t\troles:" + style.createRoleString() + + " types: " + style.createTypeString()) - return 0; + if not style.isSetGroup(): + return + + group = style.getGroup() + if group.isSetStroke(): + print("\t\tstroke: {0}".format(group.getStroke())) + if group.isSetFill(): + print("\t\tfill: {0}".format(group.getFill())) + + for element in group.getListOfElements(): + if isinstance(element, libsbml.GraphicalPrimitive2D): + print ("\t\tsub element {0} stroke {1}, fill {2}".format(element.getElementName(), element.getStroke(), element.getFill())) + elif isinstance(element, libsbml.GraphicalPrimitive1D): + print ("\t\tsub element {0} stroke {1}".format(element.getElementName(), element.getStroke())) + +def print_gradient_definition(grad): + if (grad.getElementName() == "linearGradient"): + print("\tLinear Gradient: " + grad.getId() + + " start: " + toString(grad.getXPoint1()) + ", " + + toString(grad.getYPoint1()) + + " end: " + toString(grad.getXPoint2()) + ", " + + toString(grad.getYPoint2()) + ) + else: + print("\tRadial Gradient: " + grad.getId() + + " center: " + toString(grad.getCenterX()) + ", " + + toString(grad.getCenterY()) + + " focal: " + toString(grad.getFocalPointX()) + ", " + + toString(grad.getFocalPointY()) + ) + + for k in range (0, grad.getNumGradientStops()): + stop = grad.getGradientStop(k) + print("\t\tstop " + str(k) + " id: " + stop.getId() + " stop-color: " + + stop.getStopColor()) + if __name__ == '__main__': main(sys.argv) Modified: branches/libsbml-new-attribute-ns/examples/render-package.cmake =================================================================== --- branches/libsbml-new-attribute-ns/examples/render-package.cmake 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/examples/render-package.cmake 2019-05-23 20:25:26 UTC (rev 26058) @@ -11,9 +11,9 @@ # add_subdirectory(c/render) add_subdirectory(c++/render) -# if(WITH_CSHARP) -# add_subdirectory(csharp/render) -# endif(WITH_CSHARP) + if(WITH_CSHARP) + add_subdirectory(csharp/render) + endif(WITH_CSHARP) if(WITH_JAVA) add_subdirectory(java/render) Modified: branches/libsbml-new-attribute-ns/src/bindings/csharp/local-packages-render.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/csharp/local-packages-render.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/csharp/local-packages-render.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -256,53 +256,12 @@ SBMLCONSTRUCTOR_EXCEPTION(RadialGradient) // -// Convert GradientBase objects into the most specific object possible. +// Convert Render objects into the most specific object possible. // -%typemap("csout") GradientBase* +%typemap("csout") GradientBase*, GraphicalPrimitive1D*, GraphicalPrimitive2D*, RenderInformationBase*, Style*, RenderPoint*, Transformation*, Transformation2D* { - return (GradientBase) libsbml.DowncastSBase($imcall, $owner); + return ($csclassname) libsbml.DowncastSBase($imcall, $owner); } -// -// Convert GraphicalPrimitive1D objects into the most specific object possible. -// -%typemap("csout") GraphicalPrimitive1D* -{ - return (GraphicalPrimitive1D) libsbml.DowncastSBase($imcall, $owner); -} - -// -// Convert GraphicalPrimitive2D objects into the most specific object possible. -// -%typemap("csout") GraphicalPrimitive2D* -{ - return (GraphicalPrimitive2D) libsbml.DowncastSBase($imcall, $owner); -} - - -// -// Convert RenderInformationBase objects into the most specific object possible. -// -%typemap("csout") RenderInformationBase* -{ - return (RenderInformationBase) libsbml.DowncastSBase($imcall, $owner); -} - -// -// Convert Style objects into the most specific object possible. -// -%typemap("csout") Style* -{ - return (Style) libsbml.DowncastSBase($imcall, $owner); -} - -// -// Convert RenderPoint objects into the most specific object possible. -// -%typemap("csout") RenderPoint* -{ - return (RenderPoint) libsbml.DowncastSBase($imcall, $owner); -} - #endif /* USE_RENDER */ Modified: branches/libsbml-new-attribute-ns/src/bindings/csharp/local.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/csharp/local.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/csharp/local.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -91,9 +91,10 @@ ) TYPENAME "string" %enddef -SWIGCSHARP_IMTYPE_WSTRING(std::string) +//SWIGCSHARP_IMTYPE_WSTRING(std::string) SWIGCSHARP_IMTYPE_WSTRING(std::string&) SWIGCSHARP_IMTYPE_WSTRING(const std::string&) +//SWIGCSHARP_IMTYPE_WSTRING(const std::string) SWIGCSHARP_IMTYPE_WSTRING(std::string*) SWIGCSHARP_IMTYPE_WSTRING(const std::string*) SWIGCSHARP_IMTYPE_WSTRING(char*) Modified: branches/libsbml-new-attribute-ns/src/bindings/java/local-downcast-extension-render.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/java/local-downcast-extension-render.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/java/local-downcast-extension-render.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -7,7 +7,7 @@ %pragma(java) modulecode = %{ if (pkgName.equals("render")) - return new RenderExtension(cPtr, owner); - %} -#endif // USE_RENDER + return new RenderExtension(cPtr, owner); +%} +#endif // USE_RENDER Modified: branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-comp.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-comp.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-comp.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -5,137 +5,137 @@ */ %typemap(javacode) CompExtension %{ - /** + /** * @internal */ - public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) - { - if (cPtr == 0) return null; - - SBasePlugin sbp = new SBasePlugin(cPtr, false); - SBase sb = sbp.getParentSBMLObject(); - - if (sb == null) - { - return new SBasePlugin(cPtr,owner); - } - - switch( sb.getTypeCode() ) - { - case (int) libsbml.SBML_DOCUMENT: - return new CompSBMLDocumentPlugin(cPtr,owner); + public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) + { + if (cPtr == 0) return null; - case (int) libsbml.SBML_MODEL: - case (int) libsbml.SBML_COMP_MODELDEFINITION: - return new CompModelPlugin(cPtr, owner); - case (int) libsbml.SBML_COMPARTMENT: - case (int) libsbml.SBML_COMPARTMENT_TYPE: - case (int) libsbml.SBML_CONSTRAINT: - case (int) libsbml.SBML_EVENT: - case (int) libsbml.SBML_EVENT_ASSIGNMENT: - case (int) libsbml.SBML_FUNCTION_DEFINITION: - case (int) libsbml.SBML_INITIAL_ASSIGNMENT: - case (int) libsbml.SBML_KINETIC_LAW: - case (int) libsbml.SBML_LIST_OF: - case (int) libsbml.SBML_PARAMETER: - case (int) libsbml.SBML_REACTION: - case (int) libsbml.SBML_RULE: - case (int) libsbml.SBML_SPECIES: - case (int) libsbml.SBML_SPECIES_REFERENCE: - case (int) libsbml.SBML_SPECIES_TYPE: - case (int) libsbml.SBML_MODIFIER_SPECIES_REFERENCE: - case (int) libsbml.SBML_UNIT_DEFINITION: - case (int) libsbml.SBML_UNIT: - case (int) libsbml.SBML_ALGEBRAIC_RULE: - case (int) libsbml.SBML_ASSIGNMENT_RULE: - case (int) libsbml.SBML_RATE_RULE: - case (int) libsbml.SBML_SPECIES_CONCENTRATION_RULE: - case (int) libsbml.SBML_COMPARTMENT_VOLUME_RULE: - case (int) libsbml.SBML_PARAMETER_RULE: - case (int) libsbml.SBML_TRIGGER: - case (int) libsbml.SBML_DELAY: - case (int) libsbml.SBML_STOICHIOMETRY_MATH: - case (int) libsbml.SBML_LOCAL_PARAMETER: - case (int) libsbml.SBML_COMP_SUBMODEL: - case (int) libsbml.SBML_COMP_SBASEREF: - case (int) libsbml.SBML_COMP_REPLACEDELEMENT: - case (int) libsbml.SBML_COMP_REPLACEDBY: - case (int) libsbml.SBML_COMP_PORT: - case (int) libsbml.SBML_COMP_EXTERNALMODELDEFINITION: - case (int) libsbml.SBML_COMP_DELETION: - return new CompSBasePlugin(cPtr,owner); - default: - return new SBasePlugin(cPtr,owner); - } - } - - /** + SBasePlugin sbp = new SBasePlugin(cPtr, false); + SBase sb = sbp.getParentSBMLObject(); + + if (sb == null) + { + return new SBasePlugin(cPtr,owner); + } + + switch( sb.getTypeCode() ) + { + case (int) libsbml.SBML_DOCUMENT: + return new CompSBMLDocumentPlugin(cPtr,owner); + + case (int) libsbml.SBML_MODEL: + case (int) libsbml.SBML_COMP_MODELDEFINITION: + return new CompModelPlugin(cPtr, owner); + case (int) libsbml.SBML_COMPARTMENT: + case (int) libsbml.SBML_COMPARTMENT_TYPE: + case (int) libsbml.SBML_CONSTRAINT: + case (int) libsbml.SBML_EVENT: + case (int) libsbml.SBML_EVENT_ASSIGNMENT: + case (int) libsbml.SBML_FUNCTION_DEFINITION: + case (int) libsbml.SBML_INITIAL_ASSIGNMENT: + case (int) libsbml.SBML_KINETIC_LAW: + case (int) libsbml.SBML_LIST_OF: + case (int) libsbml.SBML_PARAMETER: + case (int) libsbml.SBML_REACTION: + case (int) libsbml.SBML_RULE: + case (int) libsbml.SBML_SPECIES: + case (int) libsbml.SBML_SPECIES_REFERENCE: + case (int) libsbml.SBML_SPECIES_TYPE: + case (int) libsbml.SBML_MODIFIER_SPECIES_REFERENCE: + case (int) libsbml.SBML_UNIT_DEFINITION: + case (int) libsbml.SBML_UNIT: + case (int) libsbml.SBML_ALGEBRAIC_RULE: + case (int) libsbml.SBML_ASSIGNMENT_RULE: + case (int) libsbml.SBML_RATE_RULE: + case (int) libsbml.SBML_SPECIES_CONCENTRATION_RULE: + case (int) libsbml.SBML_COMPARTMENT_VOLUME_RULE: + case (int) libsbml.SBML_PARAMETER_RULE: + case (int) libsbml.SBML_TRIGGER: + case (int) libsbml.SBML_DELAY: + case (int) libsbml.SBML_STOICHIOMETRY_MATH: + case (int) libsbml.SBML_LOCAL_PARAMETER: + case (int) libsbml.SBML_COMP_SUBMODEL: + case (int) libsbml.SBML_COMP_SBASEREF: + case (int) libsbml.SBML_COMP_REPLACEDELEMENT: + case (int) libsbml.SBML_COMP_REPLACEDBY: + case (int) libsbml.SBML_COMP_PORT: + case (int) libsbml.SBML_COMP_EXTERNALMODELDEFINITION: + case (int) libsbml.SBML_COMP_DELETION: + return new CompSBasePlugin(cPtr,owner); + default: + return new SBasePlugin(cPtr,owner); + } + } + + /** * @internal */ - public SBase DowncastSBase(long cPtr, boolean owner) - { - if (cPtr == 0) return null; - - SBase sb = new SBase(cPtr, false); - switch( sb.getTypeCode() ) - { - case (int) libsbml.SBML_LIST_OF: - String name = sb.getElementName(); - if(name =="listOfDeletions") - { - return new ListOfDeletions(cPtr, owner); - } - else if(name =="listOfExternalModelDefinitions") - { - return new ListOfExternalModelDefinitions(cPtr, owner); - } - else if(name =="listOfModelDefinitions") - { - return new ListOfModelDefinitions(cPtr, owner); - } - else if(name =="listOfPorts") - { - return new ListOfPorts(cPtr, owner); - } - else if(name =="listOfReplacedElements") - { - return new ListOfReplacedElements(cPtr, owner); - } - else if(name =="listOfSubmodels") - { - return new ListOfSubmodels(cPtr, owner); - } - return new ListOf(cPtr, owner); - - case (int) libsbml.SBML_COMP_DELETION: - return new Deletion(cPtr, owner); - - case (int) libsbml.SBML_COMP_MODELDEFINITION: - return new ModelDefinition(cPtr, owner); + public SBase DowncastSBase(long cPtr, boolean owner) + { + if (cPtr == 0) return null; + + SBase sb = new SBase(cPtr, false); + switch( sb.getTypeCode() ) + { + case (int) libsbml.SBML_LIST_OF: + String name = sb.getElementName(); + if(name.equals("listOfDeletions")) + { + return new ListOfDeletions(cPtr, owner); + } + else if(name.equals("listOfExternalModelDefinitions")) + { + return new ListOfExternalModelDefinitions(cPtr, owner); + } + else if(name.equals("listOfModelDefinitions")) + { + return new ListOfModelDefinitions(cPtr, owner); + } + else if(name.equals("listOfPorts")) + { + return new ListOfPorts(cPtr, owner); + } + else if(name.equals("listOfReplacedElements")) + { + return new ListOfReplacedElements(cPtr, owner); + } + else if(name.equals("listOfSubmodels")) + { + return new ListOfSubmodels(cPtr, owner); + } + return new ListOf(cPtr, owner); + + case (int) libsbml.SBML_COMP_DELETION: + return new Deletion(cPtr, owner); + + case (int) libsbml.SBML_COMP_MODELDEFINITION: + return new ModelDefinition(cPtr, owner); - case (int) libsbml.SBML_COMP_EXTERNALMODELDEFINITION: - return new ExternalModelDefinition(cPtr, owner); - - case (int) libsbml.SBML_COMP_PORT: - return new Port(cPtr, owner); - - case (int) libsbml.SBML_COMP_REPLACEDELEMENT: - return new ReplacedElement(cPtr, owner); - - case (int) libsbml.SBML_COMP_REPLACEDBY: - return new ReplacedBy(cPtr, owner); + case (int) libsbml.SBML_COMP_EXTERNALMODELDEFINITION: + return new ExternalModelDefinition(cPtr, owner); + + case (int) libsbml.SBML_COMP_PORT: + return new Port(cPtr, owner); + + case (int) libsbml.SBML_COMP_REPLACEDELEMENT: + return new ReplacedElement(cPtr, owner); + + case (int) libsbml.SBML_COMP_REPLACEDBY: + return new ReplacedBy(cPtr, owner); - case (int) libsbml.SBML_COMP_SBASEREF: - return new SBaseRef(cPtr, owner); - - case (int) libsbml.SBML_COMP_SUBMODEL: - return new Submodel(cPtr, owner); - - default: - return new SBase(cPtr, owner); - } - } - + case (int) libsbml.SBML_COMP_SBASEREF: + return new SBaseRef(cPtr, owner); + + case (int) libsbml.SBML_COMP_SUBMODEL: + return new Submodel(cPtr, owner); + + default: + return new SBase(cPtr, owner); + } + } + %} // mark the clone method as covariant Modified: branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-qual.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-qual.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-qual.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -41,23 +41,23 @@ { case (int) libsbml.SBML_LIST_OF: String name = sb.getElementName(); - if(name =="listOfFunctionTerms") + if(name.equals("listOfFunctionTerms")) { return new ListOfFunctionTerms(cPtr, owner); } - else if(name =="listOfInputs") + else if(name.equals("listOfInputs")) { return new ListOfInputs(cPtr, owner); } - else if(name =="listOfOutputs") + else if(name.equals("listOfOutputs")) { return new ListOfOutputs(cPtr, owner); } - else if(name =="listOfQualitativeSpecies") + else if(name.equals("listOfQualitativeSpecies")) { return new ListOfQualitativeSpecies(cPtr, owner); } - else if(name =="listOfTransitions") + else if(name.equals("listOfTransitions")) { return new ListOfTransitions(cPtr, owner); } Modified: branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-render.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-render.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/java/local-packages-render.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -5,141 +5,141 @@ */ %typemap(javacode) RenderExtension %{ - public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) - { - if (cPtr == 0) return null; - - SBasePlugin sbp = new SBasePlugin(cPtr, false); - SBase sb = sbp.getParentSBMLObject(); - - switch( sb.getTypeCode() ) - { - case (int) libsbml.SBML_LIST_OF: - String name = sb.getElementName(); - if(name =="listOfLayouts") - { - return new RenderListOfLayoutsPlugin(cPtr, owner); - } - return new SBasePlugin(cPtr,owner); - case (int) libsbml.SBML_DOCUMENT: - return new SBMLDocumentPlugin(cPtr, owner); - case (int) libsbml.SBML_LAYOUT_LAYOUT: - return new RenderLayoutPlugin(cPtr, owner); - case (int) libsbml.SBML_LAYOUT_GRAPHICALOBJECT: - return new RenderGraphicalObjectPlugin(cPtr, owner); - default: - return new SBasePlugin(cPtr,owner); - } - } - - public SBase DowncastSBase(long cPtr, boolean owner) - { - if (cPtr == 0) return null; - - SBase sb = new SBase(cPtr, false); - switch( sb.getTypeCode() ) - { - case (int) libsbml.SBML_LIST_OF: - String name = sb.getElementName(); - int itemType = ((ListOf)sb).getItemTypeCode(); - if(name =="listOfColorDefinitions") - { - return new ListOfColorDefinitions(cPtr, owner); - } - else if(name =="listOfGlobalRenderInformation") - { - return new ListOfGlobalRenderInformation(cPtr, owner); - } - else if(name =="listOfStyles") - { - if (itemType == libsbml.SBML_RENDER_LOCALSTYLE) - return new ListOfLocalStyles(cPtr, owner); - else - return new ListOfGlobalStyles(cPtr, owner); - } - else if(name =="listOfGradientDefinitions") - { - return new ListOfGradientDefinitions(cPtr, owner); - } - else if(name =="listOfLineEndings") - { - return new ListOfLineEndings(cPtr, owner); - } - else if(name =="listOfElements") - { - return new ListOfCurveElements(cPtr, owner); - } - else if(name =="listOfRenderInformation") - { - return new ListOfLocalRenderInformation(cPtr, owner); - } - else if(name =="listOfDrawables") - { - return new ListOfDrawables(cPtr, owner); - } - else if(name =="listOfGradientStops") - { - return new ListOfGradientStops(cPtr, owner); - } - return new ListOf(cPtr, owner); - - case (int) libsbml.SBML_RENDER_COLORDEFINITION: - return new ColorDefinition(cPtr, owner); - - case (int) libsbml.SBML_RENDER_ELLIPSE: - return new Ellipse(cPtr, owner); + public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) + { + if (cPtr == 0) return null; + + SBasePlugin sbp = new SBasePlugin(cPtr, false); + SBase sb = sbp.getParentSBMLObject(); + + switch( sb.getTypeCode() ) + { + case (int) libsbml.SBML_LIST_OF: + String name = sb.getElementName(); + if(name.equals("listOfLayouts")) + { + return new RenderListOfLayoutsPlugin(cPtr, owner); + } + return new SBasePlugin(cPtr,owner); + case (int) libsbml.SBML_DOCUMENT: + return new SBMLDocumentPlugin(cPtr, owner); + case (int) libsbml.SBML_LAYOUT_LAYOUT: + return new RenderLayoutPlugin(cPtr, owner); + case (int) libsbml.SBML_LAYOUT_GRAPHICALOBJECT: + return new RenderGraphicalObjectPlugin(cPtr, owner); + default: + return new SBasePlugin(cPtr,owner); + } + } + + public SBase DowncastSBase(long cPtr, boolean owner) + { + if (cPtr == 0) return null; + + SBase sb = new SBase(cPtr, false); + switch( sb.getTypeCode() ) + { + case (int) libsbml.SBML_LIST_OF: + String name = sb.getElementName(); + int itemType = ((ListOf)sb).getItemTypeCode(); + if(name.equals("listOfColorDefinitions")) + { + return new ListOfColorDefinitions(cPtr, owner); + } + else if(name.equals("listOfGlobalRenderInformation")) + { + return new ListOfGlobalRenderInformation(cPtr, owner); + } + else if(name.equals("listOfStyles")) + { + if (itemType == libsbml.SBML_RENDER_LOCALSTYLE) + return new ListOfLocalStyles(cPtr, owner); + else + return new ListOfGlobalStyles(cPtr, owner); + } + else if(name.equals("listOfGradientDefinitions")) + { + return new ListOfGradientDefinitions(cPtr, owner); + } + else if(name.equals("listOfLineEndings")) + { + return new ListOfLineEndings(cPtr, owner); + } + else if(name.equals("listOfElements")) + { + return new ListOfCurveElements(cPtr, owner); + } + else if(name.equals("listOfRenderInformation")) + { + return new ListOfLocalRenderInformation(cPtr, owner); + } + else if(name.equals("listOfDrawables")) + { + return new ListOfDrawables(cPtr, owner); + } + else if(name.equals("listOfGradientStops")) + { + return new ListOfGradientStops(cPtr, owner); + } + return new ListOf(cPtr, owner); + + case (int) libsbml.SBML_RENDER_COLORDEFINITION: + return new ColorDefinition(cPtr, owner); + + case (int) libsbml.SBML_RENDER_ELLIPSE: + return new Ellipse(cPtr, owner); - case (int) libsbml.SBML_RENDER_GLOBALRENDERINFORMATION: - return new GlobalRenderInformation(cPtr, owner); - - case (int) libsbml.SBML_RENDER_GLOBALSTYLE: - return new GlobalStyle(cPtr, owner); - - case (int) libsbml.SBML_RENDER_GROUP: - return new RenderGroup(cPtr, owner); - - case (int) libsbml.SBML_RENDER_IMAGE: - return new Image(cPtr, owner); - - case (int) libsbml.SBML_RENDER_LINEENDING: - return new LineEnding(cPtr, owner); - - case (int) libsbml.SBML_RENDER_LINEARGRADIENT: - return new LinearGradient(cPtr, owner); - - case (int) libsbml.SBML_RENDER_LOCALRENDERINFORMATION: - return new LocalRenderInformation(cPtr, owner); - - case (int) libsbml.SBML_RENDER_LOCALSTYLE: - return new LocalStyle(cPtr, owner); - - case (int) libsbml.SBML_RENDER_POLYGON: - return new Polygon(cPtr, owner); - - case (int) libsbml.SBML_RENDER_RADIALGRADIENT: - return new RadialGradient(cPtr, owner); - - case (int) libsbml.SBML_RENDER_RECTANGLE: - return new Rectangle(cPtr, owner); - - case (int) libsbml.SBML_RENDER_CUBICBEZIER: - return new RenderCubicBezier(cPtr, owner); - - case (int) libsbml.SBML_RENDER_CURVE: - return new RenderCurve(cPtr, owner); - - case (int) libsbml.SBML_RENDER_POINT: - return new RenderPoint(cPtr, owner); - - case (int) libsbml.SBML_RENDER_TEXT: - return new Text(cPtr, owner); - - default: - return new SBase(cPtr, owner); - } - } - - %} + case (int) libsbml.SBML_RENDER_GLOBALRENDERINFORMATION: + return new GlobalRenderInformation(cPtr, owner); + + case (int) libsbml.SBML_RENDER_GLOBALSTYLE: + return new GlobalStyle(cPtr, owner); + + case (int) libsbml.SBML_RENDER_GROUP: + return new RenderGroup(cPtr, owner); + + case (int) libsbml.SBML_RENDER_IMAGE: + return new Image(cPtr, owner); + + case (int) libsbml.SBML_RENDER_LINEENDING: + return new LineEnding(cPtr, owner); + + case (int) libsbml.SBML_RENDER_LINEARGRADIENT: + return new LinearGradient(cPtr, owner); + + case (int) libsbml.SBML_RENDER_LOCALRENDERINFORMATION: + return new LocalRenderInformation(cPtr, owner); + + case (int) libsbml.SBML_RENDER_LOCALSTYLE: + return new LocalStyle(cPtr, owner); + + case (int) libsbml.SBML_RENDER_POLYGON: + return new Polygon(cPtr, owner); + + case (int) libsbml.SBML_RENDER_RADIALGRADIENT: + return new RadialGradient(cPtr, owner); + + case (int) libsbml.SBML_RENDER_RECTANGLE: + return new Rectangle(cPtr, owner); + + case (int) libsbml.SBML_RENDER_CUBICBEZIER: + return new RenderCubicBezier(cPtr, owner); + + case (int) libsbml.SBML_RENDER_CURVE: + return new RenderCurve(cPtr, owner); + + case (int) libsbml.SBML_RENDER_POINT: + return new RenderPoint(cPtr, owner); + + case (int) libsbml.SBML_RENDER_TEXT: + return new Text(cPtr, owner); + + default: + return new SBase(cPtr, owner); + } + } + + %} COVARIANT_RTYPE_CLONE(ListOfGlobalRenderInformation) COVARIANT_RTYPE_CLONE(ListOfLocalStyles) @@ -228,51 +228,12 @@ SBMLCONSTRUCTOR_EXCEPTION(RadialGradient) // -// Convert GradientBase objects into the most specific object possible. +// Convert Render objects into the most specific object possible. // -%typemap("javaout") GradientBase* +%typemap("javaout") GradientBase*, GraphicalPrimitive1D*, GraphicalPrimitive2D*, RenderInformationBase*, Style*, RenderPoint*, Transformation*, Transformation2D* { - return (GradientBase) libsbml.DowncastSBase($jnicall, $owner); + return ($javaclassname) libsbml.DowncastSBase($jnicall, $owner); } -// -// Convert GraphicalPrimitive1D objects into the most specific object possible. -// -%typemap("javaout") GraphicalPrimitive1D* -{ - return (GraphicalPrimitive1D) libsbml.DowncastSBase($jnicall, $owner); -} -// -// Convert GraphicalPrimitive2D objects into the most specific object possible. -// -%typemap("javaout") GraphicalPrimitive2D* -{ - return (GraphicalPrimitive2D) libsbml.DowncastSBase($jnicall, $owner); -} - -// -// Convert RenderInformationBase objects into the most specific object possible. -// -%typemap("javaout") RenderInformationBase* -{ - return (RenderInformationBase) libsbml.DowncastSBase($jnicall, $owner); -} - -// -// Convert Style objects into the most specific object possible. -// -%typemap("javaout") Style* -{ - return (Style) libsbml.DowncastSBase($jnicall, $owner); -} - -// -// Convert RenderPoint objects into the most specific object possible. -// -%typemap("javaout") RenderPoint* -{ - return (RenderPoint) libsbml.DowncastSBase($jnicall, $owner); -} - #endif /* USE_RENDER */ Modified: branches/libsbml-new-attribute-ns/src/bindings/javascript/local-downcast-packages-render.cpp =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/javascript/local-downcast-packages-render.cpp 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/javascript/local-downcast-packages-render.cpp 2019-05-23 20:25:26 UTC (rev 26058) @@ -2,107 +2,108 @@ #ifdef USE_RENDER else if (pkgName == "render") { - switch (sb->getTypeCode()) - { - case SBML_LIST_OF: - { - name = sb->getElementName(); - int itemType = ((ListOf*)sb)->getItemTypeCode(); - if(name =="listOfColorDefinitions") - { - return SWIGTYPE_p_ListOfColorDefinitions; - } - else if(name =="listOfGlobalRenderInformation") - { - return SWIGTYPE_p_ListOfGlobalRenderInformation; - } - else if(name =="listOfStyles") - { - if (itemType == SBML_RENDER_LOCALSTYLE) - return SWIGTYPE_p_ListOfGlobalStyles; - else - return SWIGTYPE_p_ListOfLocalStyles; - } - else if(name =="listOfGradientDefinitions") - { - return SWIGTYPE_p_ListOfGradientDefinitions; - } - else if(name =="listOfLineEndings") - { - return SWIGTYPE_p_ListOfLineEndings; - } - else if(name =="listOfElements") - { - return SWIGTYPE_p_ListOfCurveElements; - } - else if(name =="listOfRenderInformation") - { - return SWIGTYPE_p_ListOfLocalRenderInformation; - } - else if(name =="listOfDrawables") - { - return SWIGTYPE_p_ListOfDrawables; - } - else if(name =="listOfGradientStops") - { - return SWIGTYPE_p_ListOfGradientStops; - } - return SWIGTYPE_p_ListOf; - } - case SBML_RENDER_COLORDEFINITION: - return SWIGTYPE_p_ColorDefinition; - - case SBML_RENDER_ELLIPSE: - return SWIGTYPE_p_Ellipse; + switch (sb->getTypeCode()) + { + case SBML_LIST_OF: + { + name = sb->getElementName(); + int itemType = ((ListOf*)sb)->getItemTypeCode(); + + if(name =="listOfColorDefinitions") + { + return SWIGTYPE_p_ListOfColorDefinitions; + } + else if(name =="listOfGlobalRenderInformation") + { + return SWIGTYPE_p_ListOfGlobalRenderInformation; + } + else if(name =="listOfStyles") + { + if (itemType == SBML_RENDER_LOCALSTYLE) + return SWIGTYPE_p_ListOfGlobalStyles; + else + return SWIGTYPE_p_ListOfLocalStyles; + } + else if(name =="listOfGradientDefinitions") + { + return SWIGTYPE_p_ListOfGradientDefinitions; + } + else if(name =="listOfLineEndings") + { + return SWIGTYPE_p_ListOfLineEndings; + } + else if(name =="listOfElements") + { + return SWIGTYPE_p_ListOfCurveElements; + } + else if(name =="listOfRenderInformation") + { + return SWIGTYPE_p_ListOfLocalRenderInformation; + } + else if(name =="listOfDrawables") + { + return SWIGTYPE_p_ListOfDrawables; + } + else if(name =="listOfGradientStops") + { + return SWIGTYPE_p_ListOfGradientStops; + } + return SWIGTYPE_p_ListOf; + } + case SBML_RENDER_COLORDEFINITION: + return SWIGTYPE_p_ColorDefinition; - case SBML_RENDER_GLOBALRENDERINFORMATION: - return SWIGTYPE_p_GlobalRenderInformation; - - case SBML_RENDER_GLOBALSTYLE: - return SWIGTYPE_p_GlobalStyle; - - case SBML_RENDER_GROUP: - return SWIGTYPE_p_RenderGroup; - - case SBML_RENDER_IMAGE: - return SWIGTYPE_p_Image; - - case SBML_RENDER_LINEENDING: - return SWIGTYPE_p_LineEnding; - - case SBML_RENDER_LINEARGRADIENT: - return SWIGTYPE_p_LinearGradient; - - case SBML_RENDER_LOCALRENDERINFORMATION: - return SWIGTYPE_p_LocalRenderInformation; - - case SBML_RENDER_LOCALSTYLE: - return SWIGTYPE_p_LocalStyle; - - case SBML_RENDER_POLYGON: - return SWIGTYPE_p_Polygon; - - case SBML_RENDER_RADIALGRADIENT: - return SWIGTYPE_p_RadialGradient; - - case SBML_RENDER_RECTANGLE: - return SWIGTYPE_p_Rectangle; - - case SBML_RENDER_CUBICBEZIER: - return SWIGTYPE_p_RenderCubicBezier; - - case SBML_RENDER_CURVE: - return SWIGTYPE_p_RenderCurve; - - case SBML_RENDER_POINT: - return SWIGTYPE_p_RenderPoint; - - case SBML_RENDER_TEXT: - return SWIGTYPE_p_Text; - - default: - return SWIGTYPE_p_SBase; - } + case SBML_RENDER_ELLIPSE: + return SWIGTYPE_p_Ellipse; + + case SBML_RENDER_GLOBALRENDERINFORMATION: + return SWIGTYPE_p_GlobalRenderInformation; + + case SBML_RENDER_GLOBALSTYLE: + return SWIGTYPE_p_GlobalStyle; + + case SBML_RENDER_GROUP: + return SWIGTYPE_p_RenderGroup; + + case SBML_RENDER_IMAGE: + return SWIGTYPE_p_Image; + + case SBML_RENDER_LINEENDING: + return SWIGTYPE_p_LineEnding; + + case SBML_RENDER_LINEARGRADIENT: + return SWIGTYPE_p_LinearGradient; + + case SBML_RENDER_LOCALRENDERINFORMATION: + return SWIGTYPE_p_LocalRenderInformation; + + case SBML_RENDER_LOCALSTYLE: + return SWIGTYPE_p_LocalStyle; + + case SBML_RENDER_POLYGON: + return SWIGTYPE_p_Polygon; + + case SBML_RENDER_RADIALGRADIENT: + return SWIGTYPE_p_RadialGradient; + + case SBML_RENDER_RECTANGLE: + return SWIGTYPE_p_Rectangle; + + case SBML_RENDER_CUBICBEZIER: + return SWIGTYPE_p_RenderCubicBezier; + + case SBML_RENDER_CURVE: + return SWIGTYPE_p_RenderCurve; + + case SBML_RENDER_POINT: + return SWIGTYPE_p_RenderPoint; + + case SBML_RENDER_TEXT: + return SWIGTYPE_p_Text; + + default: + return SWIGTYPE_p_SBase; + } } -#endif // USE_RENDER +#endif // USE_RENDER Modified: branches/libsbml-new-attribute-ns/src/bindings/javascript/local-render.i =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/javascript/local-render.i 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/javascript/local-render.i 2019-05-23 20:25:26 UTC (rev 26058) @@ -44,56 +44,12 @@ /** - * Convert GradientBase objects into the most specific type possible. + * Convert render objects into the most specific type possible. */ -%typemap(out) GradientBase* +%typemap(out) GradientBase*, GraphicalPrimitive1D*, GraphicalPrimitive2D*, RenderInformationBase*, Style*, RenderPoint*, Transformation*, Transformation2D* { $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); } -/** - * Convert GraphicalPrimitive1D objects into the most specific type possible. - */ -%typemap(out) GraphicalPrimitive1D* -{ - $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); -} - -/** - * Convert GraphicalPrimitive2D objects into the most specific type possible. - */ -%typemap(out) GraphicalPrimitive2D* -{ - $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); -} - - -/** - * Convert RenderInformationBase objects into the most specific type possible. - */ -%typemap(out) RenderInformationBase* -{ - $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); -} - - -/** - * Convert Style objects into the most specific type possible. - */ -%typemap(out) Style* -{ - $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); -} - - -/** - * Convert RenderPoint objects into the most specific type possible. - */ -%typemap(out) RenderPoint* -{ - $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "render"), $owner | %newpointer_flags); -} - - #endif Modified: branches/libsbml-new-attribute-ns/src/bindings/perl/local-downcast-packages-render.cpp =================================================================== --- branches/libsbml-new-attribute-ns/src/bindings/perl/local-downcast-packages-render.cpp 2019-05-23 20:20:02 UTC (rev 26057) +++ branches/libsbml-new-attribute-ns/src/bindings/perl/local-downcast-packages-render.cpp 2019-05-23 20:25:26 UTC (rev 26058) @@ -2,107 +2,108 @@ #ifdef USE_RENDER else if (pkgName == "render") { - switch (sb->getTypeCode()) - { - case SBML_LIST_OF: - { - name = sb->getElementName(); - int itemType = ((ListOf*)sb)->getItemTypeCode(); - if(name =="listOfColorDefinitions") - { - return SWIGTYPE_p_ListOfColorDefinitions; - } - else if(name =="listOfGlobalRenderInformation") - { - return SWIGTYPE_p_ListOfGlobalRenderInfor... [truncated message content] |
From: <luc...@us...> - 2019-05-23 20:20:10
|
Revision: 26057 http://sourceforge.net/p/sbml/code/26057 Author: luciansmith Date: 2019-05-23 20:20:02 +0000 (Thu, 23 May 2019) Log Message: ----------- Merge revisions 26047-26054 from trunk. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/SBase.h branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.cpp branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.h branches/libsbml-experimental/src/sbml/math/L3Parser.cpp branches/libsbml-experimental/src/sbml/math/L3Parser.ypp branches/libsbml-experimental/src/sbml/math/L3ParserSettings.cpp branches/libsbml-experimental/src/sbml/math/L3ParserSettings.h branches/libsbml-experimental/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp Modified: branches/libsbml-experimental/src/sbml/SBase.h =================================================================== --- branches/libsbml-experimental/src/sbml/SBase.h 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/SBase.h 2019-05-23 20:20:02 UTC (rev 26057) @@ -2465,28 +2465,45 @@ /** @cond doxygenLibsbmlInternal */ - virtual int setMath(const ASTNode* math); + virtual int setMessage (const std::string& message, bool addXHTMLMarkup = false); /** @endcond */ - /** @cond doxygenLibsbmlInternal */ - - virtual int setMessage (const std::string& message, bool addXHTMLMarkup = false); - + /** @cond doxygenLibsbmlInternal */ + /** + * Returns @c NULL. SBase subclasses that define a child Math object + * will override this function to return that child. + * + * @return @c NULL. + */ + virtual const ASTNode* getMath () const; /** @endcond */ - /** @cond doxygenLibsbmlInternal */ - - virtual const ASTNode* getMath() const; - + /** @cond doxygenLibsbmlInternal */ + /** + * Returns @c false. SBase subclasses that define a child Math object + * will override this function and return whether or not that Math + * object is set. + * + * @return @c false. + */ + bool isSetMath () const; /** @endcond */ /** @cond doxygenLibsbmlInternal */ + /** + * Does nothing and returns @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}. + * SBase subclasses that define a child Math object + * will override this function to set that Math child. + * + * @param math an ASTNode representing a formula tree. + * + * @copydetails doc_returns_one_success_code + * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} + */ + virtual int setMath (const ASTNode* math); + /** @endcond */ - virtual bool isSetMath() const; - - /** @endcond */ - /** @cond doxygenLibsbmlInternal */ virtual std::string getMessageString () const; Modified: branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-05-23 20:20:02 UTC (rev 26057) @@ -1262,10 +1262,12 @@ while (!used && i < mMathElements->getSize()) { const ASTNode* ast = static_cast<SBase*>(mMathElements->get(i))->getMath(); - for (unsigned int j = 0; j < mSRIds->size(); j++) - { - used = containsId(ast, mSRIds->at(j)); - if (used) break; + if (ast != NULL) { + for (unsigned int j = 0; j < mSRIds->size(); j++) + { + used = containsId(ast, mSRIds->at(j)); + if (used) break; + } } i++; } Modified: branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.cpp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.cpp 2019-05-23 20:20:02 UTC (rev 26057) @@ -222,6 +222,19 @@ return false; } +vector<unsigned int> ASTBasePlugin::getNumAllowedChildren(ASTNodeType_t type) const +{ + for (size_t t = 0; t < mPkgASTNodeValues.size(); t++) + { + if (mPkgASTNodeValues[t].type == type) + { + return mPkgASTNodeValues[t].numAllowedChildren; + } + } + vector<unsigned int> empty; + return empty; +} + bool ASTBasePlugin::isLogical(ASTNodeType_t type) const { return false; @@ -722,6 +735,25 @@ } +ASTNodeType_t +ASTBasePlugin::getPackageSymbolFor(const std::string& function, bool strCmpIsCaseSensitive) const +{ + for (size_t t = 0; t < mPkgASTNodeValues.size(); t++) + { + if (emStrCmp(mPkgASTNodeValues[t].name, function, strCmpIsCaseSensitive)) + { + ASTNodeType_t ret = mPkgASTNodeValues[t].type; + if (!mPkgASTNodeValues[t].isFunction) + { + return ret; + } + return AST_UNKNOWN; + } + } + return AST_UNKNOWN; +} + + LIBSBML_CPP_NAMESPACE_END #endif /* __cplusplus */ Modified: branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.h =================================================================== --- branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.h 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/extension/ASTBasePlugin.h 2019-05-23 20:20:02 UTC (rev 26057) @@ -96,6 +96,7 @@ virtual bool defines(ASTNodeType_t type) const; virtual bool defines(const std::string& name, bool strCmpIsCaseSensitive = false) const; virtual bool isFunction(ASTNodeType_t type) const; + virtual std::vector<unsigned int> getNumAllowedChildren(ASTNodeType_t type) const; virtual bool isLogical(ASTNodeType_t type) const; virtual bool isMathMLNodeTag(const std::string& node) const; virtual bool isMathMLNodeTag(ASTNodeType_t type) const; @@ -439,6 +440,15 @@ */ virtual ASTNodeType_t getPackageFunctionFor(const std::string& name, bool strCmpIsCaseSensitive = false) const; + /** + * The user input a string of the form "name" with no parentheses, and we want to know if + * 'name' is recognized by a package as being a particular symbol. We already + * know that it is not used in the Model as the id of a mathematically-meaningful element. Should do + * caseless string comparison. Return the type of the symbol, or @sbmlconstant{AST_UNKNOWN, ASTNodeType_t} + * if nothing found. + */ + virtual ASTNodeType_t getPackageSymbolFor(const std::string& name, bool strCmpIsCaseSensitive = false) const; + /*-- data members --*/ // Modified: branches/libsbml-experimental/src/sbml/math/L3Parser.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/math/L3Parser.cpp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/math/L3Parser.cpp 2019-05-23 20:20:02 UTC (rev 26057) @@ -2545,7 +2545,7 @@ if (l3StrCmp(name, "nan")) return AST_REAL; if (l3StrCmp(name, "notanumber")) return AST_REAL; - return currentSettings->getPackageFunctionFor(name); + return currentSettings->getPackageSymbolFor(name); } ASTNodeType_t L3Parser::getFunctionFor(string name) const Modified: branches/libsbml-experimental/src/sbml/math/L3Parser.ypp =================================================================== --- branches/libsbml-experimental/src/sbml/math/L3Parser.ypp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/math/L3Parser.ypp 2019-05-23 20:20:02 UTC (rev 26057) @@ -903,7 +903,7 @@ if (l3StrCmp(name, "nan")) return AST_REAL; if (l3StrCmp(name, "notanumber")) return AST_REAL; - return currentSettings->getPackageFunctionFor(name); + return currentSettings->getPackageSymbolFor(name); } ASTNodeType_t L3Parser::getFunctionFor(string name) const Modified: branches/libsbml-experimental/src/sbml/math/L3ParserSettings.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/math/L3ParserSettings.cpp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/math/L3ParserSettings.cpp 2019-05-23 20:20:02 UTC (rev 26057) @@ -255,6 +255,33 @@ /** @endcond */ /** @cond doxygenLibsbmlInternal */ +ASTNodeType_t +L3ParserSettings::getPackageSymbolFor(const std::string& name) const +{ + ASTNode * temp = new ASTNode(); + const ASTBasePlugin * baseplugin = temp->getASTPlugin(name, false, mStrCmpIsCaseSensitive); + delete temp; + if (baseplugin != NULL) + { + + /* If the plugin is the l3v2 plugin, but we have been asked not to use l3v2, continue*/ + ExtendedMathType_t emp = baseplugin->getExtendedMathType(); + std::map<ExtendedMathType_t, bool>::const_iterator found_emp = mParsePackages.find(emp); + if (found_emp != mParsePackages.end() && found_emp->second == false) + { + return AST_UNKNOWN; + } + ASTNodeType_t ret = baseplugin->getPackageSymbolFor(name, mStrCmpIsCaseSensitive); + if (ret != AST_UNKNOWN) + { + return ret; + } + } + return AST_UNKNOWN; +} +/** @endcond */ + +/** @cond doxygenLibsbmlInternal */ void L3ParserSettings::visitPackageInfixSyntax(const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb) const Modified: branches/libsbml-experimental/src/sbml/math/L3ParserSettings.h =================================================================== --- branches/libsbml-experimental/src/sbml/math/L3ParserSettings.h 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/math/L3ParserSettings.h 2019-05-23 20:20:02 UTC (rev 26057) @@ -1009,6 +1009,16 @@ ASTNodeType_t getPackageFunctionFor(const std::string& name) const; + /** + * The user input a string of the form "name" with no parentheses, and we want to know if + * 'name' is recognized by a package as being a particular function. We + * already know that it is not used in the Model as the id of an element with mathematical meaning. + * Should do caseless string comparison. Return the type of the symbol, + * or AST_UNKNOWN if nothing found. + */ + ASTNodeType_t getPackageSymbolFor(const std::string& name) const; + + }; Modified: branches/libsbml-experimental/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp 2019-05-22 22:47:01 UTC (rev 26056) +++ branches/libsbml-experimental/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp 2019-05-23 20:20:02 UTC (rev 26057) @@ -322,6 +322,42 @@ END_TEST +START_TEST (test_L3v2EMExtension_infix_parser_symbols) +{ + ASTNode* math = SBML_parseL3Formula("max"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "max") == 0); + delete math; + + math = SBML_parseL3Formula("min"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "min") == 0); + delete math; + + math = SBML_parseL3Formula("quotient"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "quotient") == 0); + delete math; + + math = SBML_parseL3Formula("rateof"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "rateof") == 0); + delete math; + + math = SBML_parseL3Formula("rem"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "rem") == 0); + delete math; + + math = SBML_parseL3Formula("implies"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "implies") == 0); + delete math; + +} +END_TEST + + Suite * create_suite_L3v2EMExtensionReadWriteInfix (void) { @@ -333,6 +369,7 @@ tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_capitalization); tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_no_capitalization); tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_roundtrip); + tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_symbols); suite_add_tcase(suite, tcase); |
From: <luc...@us...> - 2019-05-22 22:47:15
|
Revision: 26056 http://sourceforge.net/p/sbml/code/26056 Author: luciansmith Date: 2019-05-22 22:47:01 +0000 (Wed, 22 May 2019) Log Message: ----------- New distrib-to-annotation converter. Will write functions with 'NaN' as return value (by default) or with the means (if set). Tests added, and old tests uncommented back in. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/distrib/extension/DistribExtension.cpp branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribAnnotationConverter.h branches/libsbml-experimental/src/sbml/packages/distrib/util/test/TestDistribAnnotationConverter.cpp branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/binomial_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/cauchy_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/chisquare_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/gamma_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/laplace_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/lognormal_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/lognormal_distrib.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_delay_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_event_assignment_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_l2v4_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_l3v1_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_l3v1b_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_l3v2_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_priority_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_submodel_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_submodel_distrib.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/rayleigh_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/truncated_gamma_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/truncated_normal_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/uniform_annot.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.h branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/binomial_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/cauchy_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/chisquare_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/exponential_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/gamma_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/laplace_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/lognormal_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/no_distrib.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_l3v2_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_submodel2_annot.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_submodel2_distrib.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/normal_submodel_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/poisson_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/rayleigh_annot_means.xml branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/uniform_annot_means.xml Modified: branches/libsbml-experimental/src/sbml/packages/distrib/extension/DistribExtension.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/extension/DistribExtension.cpp 2019-05-22 21:55:23 UTC (rev 26055) +++ branches/libsbml-experimental/src/sbml/packages/distrib/extension/DistribExtension.cpp 2019-05-22 22:47:01 UTC (rev 26056) @@ -45,6 +45,7 @@ #include <sbml/packages/distrib/extension/DistribSBasePlugin.h> #include <sbml/packages/distrib/extension/DistribASTPlugin.h> #include <sbml/packages/distrib/util/DistribAnnotationConverter.h> +#include <sbml/packages/distrib/util/DistribToAnnotationConverter.h> #include <sbml/conversion/SBMLConverterRegistry.h> @@ -403,6 +404,9 @@ DistribAnnotationConverter c1; SBMLConverterRegistry::getInstance().addConverter(&c1); + + DistribToAnnotationConverter c2; + SBMLConverterRegistry::getInstance().addConverter(&c2); } /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribAnnotationConverter.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribAnnotationConverter.h 2019-05-22 21:55:23 UTC (rev 26055) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribAnnotationConverter.h 2019-05-22 22:47:01 UTC (rev 26056) @@ -1,7 +1,7 @@ /** * @file DistribAnnotationConverter.h - * @brief Definition of a first flattening converter. - * @author Sarah M Keating + * @brief Converts Frank's distrib annotation scheme to the Distributions package. + * @author Lucian Smith * * <!-------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more Added: branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.cpp 2019-05-22 22:47:01 UTC (rev 26056) @@ -0,0 +1,394 @@ +/** + * @file DistribToAnnotationConverter.cpp + * @brief Implementation of a first flattening converter. + * @author Sarah M Keating + * + * <!-------------------------------------------------------------------------- + * This file is part of libSBML. Please visit http://sbml.org for more + * information about SBML, and the latest version of libSBML. + * + * Copyright (C) 2019 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. University of Heidelberg, Heidelberg, Germany + * + * Copyright (C) 2013-2018 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK + * 3. University of Heidelberg, Heidelberg, Germany + * + * Copyright 2011-2012 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as http://sbml.org/software/libsbml/license.html + * ---------------------------------------------------------------------- --> + */ + + +#include <sbml/packages/distrib/util/DistribToAnnotationConverter.h> +#include <sbml/conversion/SBMLConverterRegistry.h> +#include <sbml/packages/distrib/extension/DistribExtension.h> +#include <sbml/packages/distrib/extension/DistribASTPlugin.h> +#include <sbml/util/MathFilter.h> + +#ifdef USE_COMP +#include <sbml/packages/comp/extension/CompSBMLDocumentPlugin.h> +#endif + +#ifdef __cplusplus + +#include <algorithm> +#include <string> + +using namespace std; +LIBSBML_CPP_NAMESPACE_BEGIN + +/** @cond doxygenLibsbmlInternal */ +/* + * SBML Converter stuff below + */ + +void DistribToAnnotationConverter::init() +{ + //'addConverter' adds a clone, not the original. + DistribToAnnotationConverter dac; + SBMLConverterRegistry::getInstance().addConverter(&dac); +} +/** @endcond */ + + +DistribToAnnotationConverter::DistribToAnnotationConverter() + : SBMLConverter("SBML Distributions Annotations Converter") + , mCreatedFunctions() +{ +} + + +DistribToAnnotationConverter::DistribToAnnotationConverter + (const DistribToAnnotationConverter& orig) + : SBMLConverter(orig) + , mCreatedFunctions() +{ +} + +DistribToAnnotationConverter* +DistribToAnnotationConverter::clone() const +{ + return new DistribToAnnotationConverter(*this); +} + + +/* + * Destroy this object. + */ +DistribToAnnotationConverter::~DistribToAnnotationConverter () +{ +} + + +ConversionProperties +DistribToAnnotationConverter::getDefaultProperties() const +{ + static ConversionProperties prop; + prop.addOption("convert distrib to annotations", true, "convert distrib to annotations"); + prop.addOption("writeMeans", false, "Created functions return means of distributions instead of NaN"); + return prop; +} + + +bool +DistribToAnnotationConverter::matchesProperties + (const ConversionProperties &props) const +{ + if (!props.hasOption("convert distrib to annotations")) + return false; + return true; +} + +int +DistribToAnnotationConverter::convert() +{ + + int result = performConversion(); + return result; + +} + +bool +DistribToAnnotationConverter::getWriteMeans() +{ + if (getProperties() == NULL) + { + return false; + } + else if (getProperties()->hasOption("writeMeans") == false) + { + return false; + } + else + { + return getProperties()->getBoolValue("writeMeans"); + } +} +/** @cond doxygenLibsbmlInternal */ +int +DistribToAnnotationConverter::performConversion() +{ + if (mDocument == NULL) { + return LIBSBML_OPERATION_SUCCESS; + } + Model* model = mDocument->getModel(); + bool fail = convertModel(model); + if (fail) { + return LIBSBML_OPERATION_FAILED; + } + +#ifdef USE_COMP + CompSBMLDocumentPlugin* csdp = static_cast<CompSBMLDocumentPlugin*>(mDocument->getPlugin("comp")); + if (csdp != NULL) + { + for (unsigned int md = 0; md < csdp->getNumModelDefinitions(); md++) + { + ModelDefinition* modeldef = csdp->getModelDefinition(md); + fail = fail || (convertModel(modeldef)); + } + } +#endif + if (!fail) + { + mDocument->disablePackage(DistribExtension::getXmlnsL3V1V1(), "distrib"); + return LIBSBML_OPERATION_SUCCESS; + } + return LIBSBML_OPERATION_FAILED; +} + + +string DistribToAnnotationConverter::getUnusedIDFor(ASTNodeType_t type, Model* model) +{ + if (mCreatedFunctions.find(type) != mCreatedFunctions.end()) { + return mCreatedFunctions.find(type)->second; + } + DistribASTPlugin dastp; + vector<unsigned int> nallowed = dastp.getNumAllowedChildren(type); + string idbase = dastp.getConstCharFor(type); + SBase* duplicate = model->getElementBySId(idbase); + if (duplicate == NULL) { + return idbase; + } + int count = 0; + stringstream newid; + while (duplicate != NULL) { + count++; + newid << idbase << count; + duplicate = model->getElementBySId(newid.str()); + } + return newid.str(); +} + + +bool +DistribToAnnotationConverter::replaceDistribWithFunctionCalls(ASTNode* astn, Model* model) +{ + if (astn == NULL) { + return false; + } + string newid; + ASTNodeType_t type = astn->getType(); + switch (type) { + case AST_DISTRIB_FUNCTION_NORMAL: + case AST_DISTRIB_FUNCTION_UNIFORM: + case AST_DISTRIB_FUNCTION_BERNOULLI: + case AST_DISTRIB_FUNCTION_BINOMIAL: + case AST_DISTRIB_FUNCTION_CAUCHY: + case AST_DISTRIB_FUNCTION_CHISQUARE: + case AST_DISTRIB_FUNCTION_EXPONENTIAL: + case AST_DISTRIB_FUNCTION_GAMMA: + case AST_DISTRIB_FUNCTION_LAPLACE: + case AST_DISTRIB_FUNCTION_LOGNORMAL: + case AST_DISTRIB_FUNCTION_POISSON: + case AST_DISTRIB_FUNCTION_RAYLEIGH: + newid = getUnusedIDFor(type, model); + astn->setType(AST_FUNCTION); + astn->setName(newid.c_str()); + astn->setDefinitionURL(""); + if (addFunctionDefinitionWith(model, newid, type, astn->getNumChildren())) { + return true; + } + break; + default: + break; + } + for (unsigned int c = 0; c < astn->getNumChildren(); c++) { + if (replaceDistribWithFunctionCalls(astn->getChild(c), model)) { + return true; + } + } + return false; +} + +string DistribToAnnotationConverter::getWikipediaURLFor(ASTNodeType_t type) +{ + switch (type) { + case AST_DISTRIB_FUNCTION_NORMAL: + return "http://en.wikipedia.org/wiki/Normal_distribution"; + break; + case AST_DISTRIB_FUNCTION_UNIFORM: + return "http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)"; + case AST_DISTRIB_FUNCTION_BERNOULLI: + return "http://en.wikipedia.org/wiki/Bernoulli_distribution"; + break; + case AST_DISTRIB_FUNCTION_BINOMIAL: + return "http://en.wikipedia.org/wiki/Binomial_distribution"; + break; + case AST_DISTRIB_FUNCTION_CAUCHY: + return "http://en.wikipedia.org/wiki/Cauchy_distribution"; + break; + case AST_DISTRIB_FUNCTION_CHISQUARE: + return "http://en.wikipedia.org/wiki/Chi-squared_distribution"; + break; + case AST_DISTRIB_FUNCTION_EXPONENTIAL: + return "http://en.wikipedia.org/wiki/Exponential_distribution"; + break; + case AST_DISTRIB_FUNCTION_GAMMA: + return "http://en.wikipedia.org/wiki/Gamma_distribution"; + break; + case AST_DISTRIB_FUNCTION_LAPLACE: + return "http://en.wikipedia.org/wiki/Laplace_distribution"; + break; + case AST_DISTRIB_FUNCTION_LOGNORMAL: + return "http://en.wikipedia.org/wiki/Log-normal_distribution"; + break; + case AST_DISTRIB_FUNCTION_POISSON: + return "http://en.wikipedia.org/wiki/Poisson_distribution"; + break; + case AST_DISTRIB_FUNCTION_RAYLEIGH: + return "http://en.wikipedia.org/wiki/Rayleigh_distribution"; + break; + } + return ""; +} + +bool +DistribToAnnotationConverter::addFunctionDefinitionWith(Model* model, const string& id, ASTNodeType_t type, unsigned int nargs) +{ + DistribASTPlugin dastp; + vector<unsigned int> nallowed = dastp.getNumAllowedChildren(type); + if (nallowed.size() == 0) { + return true; + } + if (nargs != nallowed[0]) { + //Cannot create an annotation version + return true; + } + if (mCreatedFunctions.find(type) != mCreatedFunctions.end()) { + return false; + } + string args = ""; + string ret = "NaN"; + switch (type) { + case AST_DISTRIB_FUNCTION_NORMAL: + args = "mean, stdev"; + ret = "mean"; + break; + case AST_DISTRIB_FUNCTION_LOGNORMAL: + args = "mean, stdev"; + ret = "exp(mean + stdev^2/2)"; + break; + case AST_DISTRIB_FUNCTION_UNIFORM: + args = "min, max"; + ret = "(min+max)/2"; + break; + case AST_DISTRIB_FUNCTION_BERNOULLI: + args = "prob"; + ret = "prob"; + break; + case AST_DISTRIB_FUNCTION_BINOMIAL: + args = "nTrials, probabilityOfSuccess"; + ret = "nTrials * probabilityOfSuccess"; + break; + case AST_DISTRIB_FUNCTION_CAUCHY: + args = "location, scale"; + ret = "NaN"; + break; + case AST_DISTRIB_FUNCTION_LAPLACE: + args = "location, scale"; + ret = "location"; + break; + case AST_DISTRIB_FUNCTION_CHISQUARE: + args = "degreesOfFreedom"; + ret = "degreesOfFreedom"; + break; + case AST_DISTRIB_FUNCTION_EXPONENTIAL: + args = "rate"; + ret = "rate^-1"; + break; + case AST_DISTRIB_FUNCTION_POISSON: + args = "rate"; + ret = "rate"; + break; + case AST_DISTRIB_FUNCTION_GAMMA: + args = "shape, scale"; + ret = "shape*scale"; + break; + case AST_DISTRIB_FUNCTION_RAYLEIGH: + args = "scale"; + ret = "scale*sqrt(pi/2)"; + break; + } + + if (!getWriteMeans()) { + ret = "NaN"; + } + + FunctionDefinition* fd = model->createFunctionDefinition(); + fd->setId(id); + string lstr = "lambda(" + args + ", " + ret + ")"; + ASTNode* lambda = SBML_parseL3Formula(lstr.c_str()); + fd->setMath(lambda); + string wikipedia = getWikipediaURLFor(type); + string annot = "<annotation> <distribution xmlns=\"http://sbml.org/annotations/distribution\" definition=\"" + getWikipediaURLFor(type) + "\" /> </annotation> "; + fd->setAnnotation(annot); + mCreatedFunctions.insert(make_pair(type, id)); + return false; +} + +bool +DistribToAnnotationConverter::convertModel(Model* model) +{ + if (model == NULL) + { + return false; + } + Model backup(*model); + bool ret = false; + mCreatedFunctions.clear(); + set<ASTNodeType_t> used_distrib_types; + List* allelements = model->getAllElements(); + for (ListIterator it = allelements->begin(); it != allelements->end(); ++it) + { + SBase* obj = static_cast<SBase*>(*it); + ASTNode* astn = const_cast<ASTNode*>(obj->getMath()); + if (replaceDistribWithFunctionCalls(astn, model)) { + *model = backup; + return true; + } + } + return false; + +} +/** @endcond */ + + + +/** @cond doxygenIgnored */ +/** @endcond */ + +LIBSBML_CPP_NAMESPACE_END + +#endif /* __cplusplus */ + + Added: branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.h (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/DistribToAnnotationConverter.h 2019-05-22 22:47:01 UTC (rev 26056) @@ -0,0 +1,201 @@ +/** + * @file DistribToAnnotationConverter.h + * @brief Converts an SBML Distributions package file to Frank's annotation scheme. + * @author Lucian Smith + * + * <!-------------------------------------------------------------------------- + * This file is part of libSBML. Please visit http://sbml.org for more + * information about SBML, and the latest version of libSBML. + * + * Copyright (C) 2019 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. University of Heidelberg, Heidelberg, Germany + * + * Copyright (C) 2013-2018 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK + * 3. University of Heidelberg, Heidelberg, Germany + * + * Copyright 2011-2012 jointly by the following organizations: + * 1. California Institute of Technology, Pasadena, CA, USA + * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation. A copy of the license agreement is provided + * in the file named "LICENSE.txt" included with this software distribution + * and also available online as http://sbml.org/software/libsbml/license.html + * ---------------------------------------------------------------------- --> + * + * @class DistribToAnnotationConverter + * @sbmlbrief{arrays} Converts a model with custom annotations for distributions into distrib. + * + * @htmlinclude libsbml-facility-only-warning.html + * + */ + + +#ifndef DistribToAnnotationConverter_h +#define DistribToAnnotationConverter_h + +#include <sbml/math/ASTNode.h> +#include <sbml/SBMLNamespaces.h> +#include <sbml/conversion/SBMLConverter.h> +#include <sbml/conversion/SBMLConverterRegister.h> + +#include <set> +#include <map> + +#ifdef __cplusplus + + +LIBSBML_CPP_NAMESPACE_BEGIN + +class LIBSBML_EXTERN DistribToAnnotationConverter : public SBMLConverter +{ +public: + + /** @cond doxygenLibsbmlInternal */ + /** + * Register with the ConversionRegistry. + */ + static void init(); + + /** @endcond */ + + + /** + * Creates a new DistribToAnnotationConverter object. + */ + DistribToAnnotationConverter(); + + + /** + * Copy constructor. + * + * This creates a copy of a DistribToAnnotationConverter object. + * + * @param orig the DistribToAnnotationConverter instance to copy. + */ + DistribToAnnotationConverter(const DistribToAnnotationConverter& orig); + + + /** + * Creates and returns a deep copy of this DistribToAnnotationConverter. + * + * @return a (deep) copy of this DistribToAnnotationConverter. + */ + virtual DistribToAnnotationConverter* clone() const; + + + /** + * Destroy this DistribToAnnotationConverter object. + */ + virtual ~DistribToAnnotationConverter (); + + + /** + * Returns @c true if this converter matches the given properties. + * + * Given a ConversionProperties object @p props, this method checks that @p + * props possesses an option value to enable the DistribToAnnotationConverter. If + * it does, this method returns @c true. + * + * @param props the properties to match. + * + * @return @c true if the properties @p props would match the necessary + * properties for DistribToAnnotationConverter type of converter, @c false + * otherwise. + */ + virtual bool matchesProperties(const ConversionProperties &props) const; + + + /** + * Performs the conversion. + * + * This method causes DistribToAnnotationConverter to do the actual conversion + * work, that is, to convert the SBMLDocument object set by + * SBMLConverter::setDocument(@if java const SBMLDocument@endif) and with + * the configuration options set by SBMLConverter::setProperties(@if java + * const ConversionProperties@endif). + * + * @copydetails doc_returns_success_code + * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} + * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} + * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} + */ + virtual int convert(); + + bool getWriteMeans(); + + + /** @cond doxygenLibsbmlInternal */ + /** + * Performs the conversion. + * + * This method causes DistribToAnnotationConverter to do the actual conversion + * work, that is, to convert the SBMLDocument object set by + * SBMLConverter::setDocument(@if java const SBMLDocument@endif) and with + * the configuration options set by SBMLConverter::setProperties(@if java + * const ConversionProperties@endif). + * + * @copydetails doc_returns_success_code + * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} + * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} + * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} + */ + virtual int performConversion(); + /** @endcond */ + + + /** + * Returns the default properties of this converter. + * + * A given converter exposes one or more properties that can be adjusted in + * order to influence the behavior of the converter. This method returns + * the @em default property settings for DistribToAnnotationConverter. It is + * meant to be called in order to be able to programmatically discover all + * the settings for the converter object. + * + * @return the ConversionProperties object describing the default properties + * for this converter. + * + * @note Previously, DistribToAnnotationConverter also offered an @em + * "ignorePackages" option, whose name proved to be confusing. This option + * has been deprecated and replaced by the @em "stripUnflattenablePackages" + * option. + */ + virtual ConversionProperties getDefaultProperties() const; + + +private: + bool convertModel(Model* model); + std::string getUnusedIDFor(ASTNodeType_t type, Model * model); + + bool replaceDistribWithFunctionCalls(ASTNode * astn, Model* model); + std::string getWikipediaURLFor(ASTNodeType_t type); + bool addFunctionDefinitionWith(Model * model, const std::string& id, ASTNodeType_t type, unsigned int nargs); + + //Member variables + std::map<ASTNodeType_t, std::string> mCreatedFunctions; + bool mWriteMeans; + +}; + +LIBSBML_CPP_NAMESPACE_END + +#endif /* __cplusplus */ + + +#ifndef SWIG + +LIBSBML_CPP_NAMESPACE_BEGIN +BEGIN_C_DECLS + + +END_C_DECLS +LIBSBML_CPP_NAMESPACE_END + +#endif /* !SWIG */ +#endif /* DistribToAnnotationConverter_h*/ + Modified: branches/libsbml-experimental/src/sbml/packages/distrib/util/test/TestDistribAnnotationConverter.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/test/TestDistribAnnotationConverter.cpp 2019-05-22 21:55:23 UTC (rev 26055) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/test/TestDistribAnnotationConverter.cpp 2019-05-22 22:47:01 UTC (rev 26056) @@ -48,7 +48,7 @@ extern char *TestDataDirectory; -START_TEST(test_distrib_annotation_converter_normal_l3v2) +void TestAnnotationToDistrib(string filebase) { string filename(TestDataDirectory); @@ -59,7 +59,7 @@ SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); // load document - string cfile = filename + "normal_l3v2_annot.xml"; + string cfile = filename + filebase + "_annot.xml"; SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); // fail if there is no model (readSBMLFromFile always returns a valid document) @@ -73,7 +73,7 @@ string newModel = writeSBMLToStdString(doc); - string ffile = filename + "normal_l3v2_distrib.xml"; + string ffile = filename + filebase + "_distrib.xml"; SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); string flatModel = writeSBMLToStdString(fdoc); @@ -83,21 +83,20 @@ delete fdoc; delete converter; } -END_TEST -START_TEST(test_distrib_annotation_converter_normal_l3v1) +void TestDistribToAnnotation(string filebase) { string filename(TestDataDirectory); ConversionProperties props; - props.addOption("convert distrib annotations"); + props.addOption("convert distrib to annotations"); SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); // load document - string cfile = filename + "normal_l3v1_annot.xml"; + string cfile = filename + filebase + "_distrib.xml"; SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); // fail if there is no model (readSBMLFromFile always returns a valid document) @@ -111,7 +110,7 @@ string newModel = writeSBMLToStdString(doc); - string ffile = filename + "normal_l3v1_distrib.xml"; + string ffile = filename + filebase + "_annot.xml"; SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); string flatModel = writeSBMLToStdString(fdoc); @@ -121,21 +120,21 @@ delete fdoc; delete converter; } -END_TEST -START_TEST(test_distrib_annotation_converter_normal_l2v4) +void TestDistribToAnnotationWithMeans(string filebase) { string filename(TestDataDirectory); ConversionProperties props; - props.addOption("convert distrib annotations"); + props.addOption("convert distrib to annotations"); + props.addOption("writeMeans", true); SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); // load document - string cfile = filename + "normal_l2v4_annot.xml"; + string cfile = filename + filebase + "_distrib.xml"; SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); // fail if there is no model (readSBMLFromFile always returns a valid document) @@ -149,7 +148,7 @@ string newModel = writeSBMLToStdString(doc); - string ffile = filename + "normal_l2v4_distrib.xml"; + string ffile = filename + filebase + "_annot_means.xml"; SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); string flatModel = writeSBMLToStdString(fdoc); @@ -159,43 +158,36 @@ delete fdoc; delete converter; } -END_TEST -START_TEST(test_distrib_annotation_converter_normal_l3v1b) +START_TEST(test_distrib_annotation_converter_normal_l3v2) { - string filename(TestDataDirectory); + TestAnnotationToDistrib("normal_l3v2"); + TestDistribToAnnotation("normal_l3v2"); + TestDistribToAnnotationWithMeans("normal_l3v2"); +} +END_TEST - ConversionProperties props; - props.addOption("convert distrib annotations"); +START_TEST(test_distrib_annotation_converter_normal_l3v1) +{ + TestAnnotationToDistrib("normal_l3v1"); + TestDistribToAnnotation("normal_l3v1"); +} +END_TEST - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - // load document - string cfile = filename + "normal_l3v1b_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); +START_TEST(test_distrib_annotation_converter_normal_l2v4) +{ + TestAnnotationToDistrib("normal_l2v4"); +} +END_TEST - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "normal_l3v1b_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; +START_TEST(test_distrib_annotation_converter_normal_l3v1b) +{ + TestAnnotationToDistrib("normal_l3v1b"); + TestDistribToAnnotation("normal_l3v1b"); } END_TEST @@ -202,38 +194,8 @@ START_TEST(test_distrib_annotation_converter_normal_event_assignment) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "normal_event_assignment_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "normal_event_assignment_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("normal_event_assignment"); + TestDistribToAnnotation("normal_event_assignment"); } END_TEST @@ -240,38 +202,8 @@ START_TEST(test_distrib_annotation_converter_normal_delay) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "normal_delay_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "normal_delay_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("normal_delay"); + TestDistribToAnnotation("normal_delay"); } END_TEST @@ -278,38 +210,8 @@ START_TEST(test_distrib_annotation_converter_normal_priority) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "normal_priority_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "normal_priority_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("normal_priority"); + TestDistribToAnnotation("normal_priority"); } END_TEST @@ -316,38 +218,16 @@ START_TEST(test_distrib_annotation_converter_normal_submodel) { - string filename(TestDataDirectory); + TestAnnotationToDistrib("normal_submodel"); + TestDistribToAnnotation("normal_submodel"); + TestDistribToAnnotationWithMeans("normal_submodel"); +} +END_TEST - ConversionProperties props; - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "normal_submodel_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "normal_submodel_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; +START_TEST(test_distrib_annotation_converter_normal_submodel2) +{ + TestAnnotationToDistrib("normal_submodel2"); } END_TEST @@ -354,38 +234,7 @@ START_TEST(test_distrib_annotation_converter_truncated_normal) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "truncated_normal_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "truncated_normal_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("truncated_normal"); } END_TEST @@ -392,38 +241,9 @@ START_TEST(test_distrib_annotation_converter_uniform) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "uniform_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "uniform_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("uniform"); + TestDistribToAnnotation("uniform"); + TestDistribToAnnotationWithMeans("uniform"); } END_TEST @@ -468,38 +288,9 @@ START_TEST(test_distrib_annotation_converter_exponential) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "exponential_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "exponential_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("exponential"); + TestDistribToAnnotation("exponential"); + TestDistribToAnnotationWithMeans("exponential"); } END_TEST @@ -506,38 +297,7 @@ START_TEST(test_distrib_annotation_converter_truncated_exponential) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "truncated_exponential_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "truncated_exponential_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("truncated_exponential"); } END_TEST @@ -544,38 +304,9 @@ START_TEST(test_distrib_annotation_converter_gamma) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "gamma_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "gamma_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("gamma"); + TestDistribToAnnotation("gamma"); + TestDistribToAnnotationWithMeans("gamma"); } END_TEST @@ -582,38 +313,7 @@ START_TEST(test_distrib_annotation_converter_truncated_gamma) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "truncated_gamma_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "truncated_gamma_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("truncated_gamma"); } END_TEST @@ -620,38 +320,9 @@ START_TEST(test_distrib_annotation_converter_poisson) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "poisson_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "poisson_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("poisson"); + TestDistribToAnnotation("poisson"); + TestDistribToAnnotationWithMeans("poisson"); } END_TEST @@ -658,38 +329,7 @@ START_TEST(test_distrib_annotation_converter_truncated_poisson) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "truncated_poisson_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "truncated_poisson_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("truncated_poisson"); } END_TEST @@ -696,38 +336,9 @@ START_TEST(test_distrib_annotation_converter_lognormal) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "lognormal_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "lognormal_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("lognormal"); + TestDistribToAnnotation("lognormal"); + TestDistribToAnnotationWithMeans("lognormal"); } END_TEST @@ -734,38 +345,9 @@ START_TEST(test_distrib_annotation_converter_chisquare) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "chisquare_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "chisquare_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("chisquare"); + TestDistribToAnnotation("chisquare"); + TestDistribToAnnotationWithMeans("chisquare"); } END_TEST @@ -772,38 +354,9 @@ START_TEST(test_distrib_annotation_converter_laplace) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "laplace_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "laplace_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("laplace"); + TestDistribToAnnotation("laplace"); + TestDistribToAnnotationWithMeans("laplace"); } END_TEST @@ -810,38 +363,9 @@ START_TEST(test_distrib_annotation_converter_cauchy) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "cauchy_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "cauchy_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("cauchy"); + TestDistribToAnnotation("cauchy"); + TestDistribToAnnotationWithMeans("cauchy"); } END_TEST @@ -848,38 +372,9 @@ START_TEST(test_distrib_annotation_converter_rayleigh) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "rayleigh_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "rayleigh_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("rayleigh"); + TestDistribToAnnotation("rayleigh"); + TestDistribToAnnotationWithMeans("rayleigh"); } END_TEST @@ -886,38 +381,9 @@ START_TEST(test_distrib_annotation_converter_binomial) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "binomial_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "binomial_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("binomial"); + TestDistribToAnnotation("binomial"); + TestDistribToAnnotationWithMeans("binomial"); } END_TEST @@ -924,38 +390,9 @@ START_TEST(test_distrib_annotation_converter_bernoulli) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "bernoulli_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "bernoulli_distrib.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("bernoulli"); + TestDistribToAnnotation("bernoulli"); + TestDistribToAnnotationWithMeans("bernoulli"); } END_TEST @@ -962,38 +399,8 @@ START_TEST(test_distrib_annotation_converter_none) { - string filename(TestDataDirectory); - - ConversionProperties props; - - props.addOption("convert distrib annotations"); - - SBMLConverter* converter = SBMLConverterRegistry::getInstance().getConverterFor(props); - - // load document - string cfile = filename + "no_annot.xml"; - SBMLDocument* doc = readSBMLFromFile(cfile.c_str()); - - // fail if there is no model (readSBMLFromFile always returns a valid document) - fail_unless(doc->getModel() != NULL); - - converter->setDocument(doc); - int result = converter->convert(); - - // fail if conversion was not valid - fail_unless(result == LIBSBML_OPERATION_SUCCESS); - - string newModel = writeSBMLToStdString(doc); - - string ffile = filename + "no_annot.xml"; - SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str()); - string flatModel = writeSBMLToStdString(fdoc); - - fail_unless(flatModel == newModel); - - delete doc; - delete fdoc; - delete converter; + TestAnnotationToDistrib("no"); + TestDistribToAnnotation("no"); } END_TEST @@ -1042,37 +449,38 @@ TCase *tcase = tcase_create("SBMLDistribAnnotationConverter"); Suite *suite = suite_create("SBMLDistribAnnotationConverter"); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v2); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v1); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_l2v4); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v1b); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_event_assignment); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_delay); -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_priority); -//#ifdef USE_COMP -// tcase_add_test(tcase, test_distrib_annotation_converter_normal_submodel); -//#endif -// tcase_add_test(tcase, test_distrib_annotation_converter_truncated_normal); -// tcase_add_test(tcase, test_distrib_annotation_converter_uniform); -// tcase_add_test(tcase, test_distrib_annotation_converter_uniformb); -// tcase_add_test(tcase, test_distrib_annotation_converter_exponential); -// tcase_add_test(tcase, test_distrib_annotation_converter_truncated_exponential); -// tcase_add_test(tcase, test_distrib_annotation_converter_gamma); -// tcase_add_test(tcase, test_distrib_annotation_converter_truncated_gamma); -// tcase_add_test(tcase, test_distrib_annotation_converter_poisson); -// tcase_add_test(tcase, test_distrib_annotation_converter_truncated_poisson); -// tcase_add_test(tcase, test_distrib_annotation_converter_lognormal); -// tcase_add_test(tcase, test_distrib_annotation_converter_chisquare); -// tcase_add_test(tcase, test_distrib_annotation_converter_laplace); -// tcase_add_test(tcase, test_distrib_annotation_converter_cauchy); -// tcase_add_test(tcase, test_distrib_annotation_converter_rayleigh); -// tcase_add_test(tcase, test_distrib_annotation_converter_binomial); -// tcase_add_test(tcase, test_distrib_annotation_converter_bernoulli); -// tcase_add_test(tcase, test_distrib_annotation_converter_none); -// -// -// tcase_add_test(tcase, test_distrib_annotation_converter_chisquare_wrongargs); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v2); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v1); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_l2v4); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_l3v1b); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_event_assignment); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_delay); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_priority); +#ifdef USE_COMP + tcase_add_test(tcase, test_distrib_annotation_converter_normal_submodel); + tcase_add_test(tcase, test_distrib_annotation_converter_normal_submodel2); +#endif + tcase_add_test(tcase, test_distrib_annotation_converter_truncated_normal); + tcase_add_test(tcase, test_distrib_annotation_converter_uniform); + tcase_add_test(tcase, test_distrib_annotation_converter_uniformb); + tcase_add_test(tcase, test_distrib_annotation_converter_exponential); + tcase_add_test(tcase, test_distrib_annotation_converter_truncated_exponential); + tcase_add_test(tcase, test_distrib_annotation_converter_gamma); + tcase_add_test(tcase, test_distrib_annotation_converter_truncated_gamma); + tcase_add_test(tcase, test_distrib_annotation_converter_poisson); + tcase_add_test(tcase, test_distrib_annotation_converter_truncated_poisson); + tcase_add_test(tcase, test_distrib_annotation_converter_lognormal); + tcase_add_test(tcase, test_distrib_annotation_converter_chisquare); + tcase_add_test(tcase, test_distrib_annotation_converter_laplace); + tcase_add_test(tcase, test_distrib_annotation_converter_cauchy); + tcase_add_test(tcase, test_distrib_annotation_converter_rayleigh); + tcase_add_test(tcase, test_distrib_annotation_converter_binomial); + tcase_add_test(tcase, test_distrib_annotation_converter_bernoulli); + tcase_add_test(tcase, test_distrib_annotation_converter_none); + + tcase_add_test(tcase, test_distrib_annotation_converter_chisquare_wrongargs); + suite_add_tcase(suite, tcase); return suite; Modified: branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot.xml 2019-05-22 21:55:23 UTC (rev 26055) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot.xml 2019-05-22 22:47:01 UTC (rev 26056) @@ -9,7 +9,7 @@ <math xmlns="http://www.w3.org/1998/Math/MathML"> <lambda> <bvar> - <ci> p </ci> + <ci> prob </ci> </bvar> <notanumber/> </lambda> Added: branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot_means.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot_means.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/bernoulli_annot_means.xml 2019-05-22 22:47:01 UTC (rev 26056) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="__main" name="__main"> + <listOfFunctionDefinitions> + <functionDefinition id="bernoulli"> + <annotation> + <distribution xmlns="http://sbml.org/annotations/distribution" definition="http://en.wikipedia.org/wiki/Bernoulli_distribution"/> + </annotation> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <lambda> + <bvar> + <ci> prob </ci> + </bvar> + <ci> prob </ci> + </lambda> + </math> + </functionDefinition> + </listOfFunctionDefinitions> + <listOfParameters> + <parameter id="a" constant="true"/> + </listOfParameters> + <listOfInitialAssignments> + <initialAssignment symbol="a"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <ci> bernoulli </ci> + <cn type="integer"> 7 </cn> + </apply> + </math> + </initialAssignment> + </listOfInitialAssignments> + </model> +</sbml> Modified: branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/binomial_annot.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-data/binomial_annot.xml 2019-05-22 21:55:23 UTC (rev 26055) +++ branches/libsbml-experimental/src/sbml/packages/distrib/util/test/test-da... [truncated message content] |
From: <luc...@us...> - 2019-05-22 21:55:32
|
Revision: 26055 http://sourceforge.net/p/sbml/code/26055 Author: luciansmith Date: 2019-05-22 21:55:23 +0000 (Wed, 22 May 2019) Log Message: ----------- Updates from Matthias; change lognormal to use mean and stdev instead of shape and scale. Modified Paths: -------------- trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.pdf trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex Modified: trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.pdf =================================================================== (Binary files differ) Modified: trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex =================================================================== --- trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex 2019-05-22 20:36:38 UTC (rev 26054) +++ trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex 2019-05-22 21:55:23 UTC (rev 26055) @@ -113,19 +113,19 @@ 0.3 (Draft) & 16 Oct 2011 & Stuart Moodie & Filled empty invocation semantics section.\\ \midrule 0.4 (Draft) & 4 Jan 2012 & Stuart Moodie & Incorporated comments from -NlN, MS and SK. Some minor revisions and corrections.\\ \midrule +Nicolas, Maciej and Sarah. Some minor revisions and corrections.\\ \midrule 0.5 (Draft) & 6 Jan 2012 & Stuart Moodie & Incorporated addition -comments on aim of package from NlN.\\ \midrule +comments on aim of package from Nicolas.\\ \midrule 0.6 (Draft) & 19 Jul 2012 & Stuart Moodie & Incorporated revisions discussed and agreed at HARMONY 2012.\\ \midrule 0.7 (Draft) & 6 Aug 2012 & Stuart Moodie & Incorporated review -comments from Maciej Swat and Sarah Keating.\\ \midrule +comments from Maciej and Sarah.\\ \midrule 0.8 (Draft) & 21 Dec 2012 & Stuart Moodie & Incorporated changes suggested at combine and subsequently through list discussions.\\ \midrule 0.9 (Draft) & 9 Jan 2013 & Stuart Moodie & Incorporated corrections -and comments from Maciej Swat and Sarah Keating.\\ \midrule +and comments from Maciej and Sarah.\\ \midrule 0.10 (Draft) & 10 Jan 2013 & Stuart Moodie & Modified based on comments -from MS.\\ \midrule +from Maciej.\\ \midrule 0.11 (Draft) & 17 May 2013 & Lucian Smith & Modified based on Stuart's proposals and PWG discussion.\\ \midrule 0.12 (Draft) & June 2013 & Lucian Smith and Stuart Moodie & Modified based on HARMONY 2013 discussion.\\ \midrule 0.13 (Draft) & July 2013 & Lucian Smith and Stuart Moodie & Modified based PWG discussion, particularly with respect to UncertML.\\ \midrule @@ -140,13 +140,13 @@ \midrule 0.20 (Draft) & December 2018 & Lucian Smith & Updates to allow distributions as new MathML csymbols.\\ \midrule -0.21 (Draft) & January 2019 & Lucian Smith & Revisions based on suggestions from sbml-distrib, including extensive edits from Matthias. Also removed the extended function definitions entirely.\\ +0.21 (Draft) & January 2019 & Lucian Smith & Revisions based on suggestions from sbml-distrib, including extensive edits from Matthias. Extended function definitions removed.\\ \midrule 0.22 (Draft) & February 2019 & Lucian Smith & Addition of \token{sampleSize} and mean values of distributions for fallback.\\ \midrule -0.23 (Draft) & February 2019 & Lucian Smith and Michael Hucka & Removal of Distribution and all subclasses; replaced with a \Math element instead; collapsed UncertStatistics into Uncertainty; some other edits from Michael Hucka.\\ +0.23 (Draft) & February 2019 & Lucian Smith and Michael Hucka & Removal of Distribution and all subclasses; replaced with a \Math element instead; collapsed UncertStatistics into Uncertainty; some other edits.\\ \midrule -0.24 (Draft) & April 2019 & Lucian Smith & Removal of second distrib namespace, and consolidation of the \UncertParameter class.\\ +0.24 (Draft) & April 2019 & Lucian Smith & Removal of second distrib namespace, and consolidation of the \UncertParameter class based on HARMONY 2019 discussions.\\ \bottomrule \end{edtable} \end{table} @@ -157,17 +157,10 @@ \section{Introduction and motivation} -\subsection{What is it?} +\subsection{What is the Distributions package?} -The \distrib package (also known as \distribshort) provides an extension to SBML Level 3 that enables a model to encode and sample from -both discrete and continuous probability distributions, and provides -the ability to annotate elements with information about the distribution their -values were drawn from. -Uses of the package include, for instance, descriptions of -population-based models, an important subset of which are -pharmacokinetic/pharmacodynamic (PK/PD) models\footnote{For more - information see: \url{http://www.pharmpk.com/}.}, which are used to -model the action of drugs. +The \distrib package (also known as \distribshort) provides an extension to SBML Level 3 that \changed{extends MathML to allow draws from distributions, and also provides the ability to annotate model elements with information about the distribution their +values were drawn from.} \subsection{Scope} @@ -175,8 +168,8 @@ probability distribution. In particular the following are in scope: \begin{itemize} -\item Sampling from a continuous distribution -\item Sampling from a discrete distribution +\item Sampling from a \changed{univariate} continuous distribution +\item Sampling from a \changed{univariate} discrete distribution \item Sampling from a user-defined discrete probability density function \item Specification of descriptive statistics (mean, standard deviation, standard error, etc.) @@ -186,7 +179,8 @@ package but are now \textbf{out of scope}: \begin{itemize} -\item Definitions of ranges (the original name of the package was 'Distributions and Ranges') +\item \changed{Sampling from a multivariate distribution} +\item Definitions of ranges \changed{as new first-order objects (the 'Arrays' package now fills that objective)} \item Sampling from user-defined probability density function \item Stochastic differential equations \item Other functions used to characterise a probability distribution, @@ -221,7 +215,7 @@ \subsection{Past work on this problem or similar topics} -\subsubsection{The Newcastle Proposal} +\subsubsection{Newcastle Proposal 2005} \label{sec:newcastle proposal} In 2005, Colin Gillespie and others put forward a proposal @@ -252,7 +246,7 @@ set of commonly used distributions. The proposal was never implemented. -\subsubsection{Seattle 2010} +\subsubsection{SBML Hackathon 2010: Seattle} The ``distrib'' package was discussed at the Seattle SBML Hackathon% \footnote{\url{http://sbml.org/Events/Hackathons/The_2010_SBML-BioModels.net_Hackathon}} @@ -337,7 +331,7 @@ \end{itemize} \end{itemize} -\subsubsection{Hinxton 2011} +\subsubsection{Statistical Models Workshop 2011: Hinxton} Detailed discussion was continued at the Statistical Models Workshop in Hinxton in June 2011% @@ -346,7 +340,7 @@ together to work out the details of how this package would work in detail. Dan Cornford from the \uncertml project\footnote{\url{http://www.uncertml.org/}} attended the meeting -and described how that resource could be used to describe uncertainty +and described how \changed{UncertML} could be used to describe uncertainty and in particular probability distributions. Perhaps the most significant decision at this meeting was to adopt the \uncertml resource as a controlled vocabulary that is referenced by the \distrib package. @@ -400,7 +394,7 @@ at the end of 2012, based on the results of an investigation into how feasible it would be to implement \arrays as a package. -\subsubsection{2013 Package Working Group discussions} +\subsubsection{Package Working Group discussions 2013} Early 2013 saw a good amount of discussion on the \distribshort Package Working Group mailing list, spurred by proposals by Stuart Moodie\footnote{\url{http://thestupott.wordpress.com/2013/03/12/an-improved-distrib-proposal/}}. While not all of his suggestions ended up being fully accepted by the group, several changes were accepted, including: @@ -420,18 +414,18 @@ there is demand for it in the future support for explicit PDFs could be reintroduced. -\subsubsection{Early 2017 and HARMONY: Seattle} +\subsubsection{HARMONY 2017: Seattle} In early 2017, it became clear that UncertML was no longer being worked on; the web page had lapsed, and its authors had moved on to other things. At the same time, the ProbOnto ontology (\citealt{swat:2016}; \url{http://probonto.org/}) was developed that included all the distributions from UncertML as well as a huge number of other distributions. On the ``distrib'' mailing list, there was discussion about whether to create essentially our own version of UncertML, or to implement a generic ``reference'' format that used ProbOnto. The~v0.17 draft specification was developed as a compromise 'hybrid' system that did parts of both, so that basic distributions would be hard-coded, but the ability to reference any ProbOnto ontology would also be present. The hope is that with working examples of both approaches, either the hybrid approach will be approved, or if one is preferred, the other approach may be removed. This version of the specification was created for presentation at HARMONY 2017 in Seattle. -\subsubsection{Early 2018 and HARMONY: Oxford} +\subsubsection{HARMONY 2018: Oxford} At the HARMONY held at the University of Oxford, for the first time since the change from UncertML, a libSBML implementation of the specification was available. This let people experiment with the package, and conclude that a simpler method of defining calls to distributions was desired. It was proposed to define new MathML \texttt{csymbol} definitions for the common distributions. Eventually, these new \token{csymbols} were used instead of the old Distribution class, greatly simplifying the proposal. -\subsubsection{2019 HARMONY: Pasadena} +\subsubsection{HARMONY 2019: Pasadena} -In the weeks leading up to the HARMONY held at Caltech, the PWG discussed various options for encoding uncertainties, based on different people's requirements. At HARMONY, we were able to coalesce around an approach that seems likely to be able to work for everyone, with multiple uncertainties per element, and a single \UncertParameter class with a \token{type} that encapsulates what used to be encoded in an element's class. +In the weeks leading up to the HARMONY held at Caltech, the PWG discussed various options for encoding uncertainties, based on different people's requirements. At HARMONY, we were able to coalesce around an approach that seems likely to work for everyone, with multiple uncertainties per element, and a single \UncertParameter class with a \token{type} that encapsulates what used to be encoded in an element's class. \section{Proposed syntax and semantics} @@ -522,7 +516,7 @@ \uri{http://www.sbml.org/sbml/level3/version1/distrib/version1} \end{center} -Note that the \distrib package may be used with both \threeone and \threetwo documents, with the no semantic changes between the two in any \distribshort element, due to the addition of \token{id} and \token{name} to the \DistribBase class. +Note that the \distrib package may be used with both \threeone and \threetwo documents, with no semantic changes between the two in any \distribshort element, due to the addition of \token{id} and \token{name} to the \DistribBase class. In addition, SBML documents using a given package must indicate whether the package may be used to change the mathematical meaning of \sbmlthreecore elements. This is done using the attribute \token{required} on the \token{<sbml>} element in the SBML document. For the \distrib package, the value of this attribute must be \val{true}, as it defines new csymbols that may be used in any MathML. Note that the value of this attribute must \emph{always} be set to \val{true}, even if the particular model does not contain any of these csymbols. @@ -578,13 +572,13 @@ \subsubsection{The approach} -The \distrib package has two simple purposes. First, it provides a mechanism for sampling a random value from a probability distribution. This implies that it must define the probability distribution and then must sample a random value from that distribution. Second, it provides a mechanism for describing elements with information about their uncertainty. One common use case for this is to provide the standard deviation for a value. Another is describing a parameter's distribution so that a better search can be performed in parameter scan experiments. +The \distrib package has two simple purposes. First, it provides a mechanism for sampling a random value from a probability distribution. This implies that it must define the probability distribution and then must sample a random value from that distribution. Second, it provides a mechanism for describing elements with information about their uncertainty. \changed{An example} use case for this is to provide the standard deviation for a value. Another \changed{might be} describing a parameter's distribution \changed{so it could be used in a} parameter scan experiment. -The first purpose is achieved by allowing new \mathml elements, and the second by extending \SBase, which in turn uses the \Uncertainty class. Several distributions and statistics are defined explicitly in this specification, but more can be defined by referencing an external ontology such as ProbOnto through the \UncertParameter class. +\changed{Sampling from probability distributions} is achieved by allowing new \mathml elements, and \changed{encoding uncertainty} by extending \SBase, which in turn uses the \Uncertainty class. Several distributions and statistics are defined explicitly in this specification, but more can be defined by referencing an external ontology such as ProbOnto through the \UncertParameter class. %It is hoped that with this approach, modelers may use the extensions defined in this specification with a reasonable expectation that most other software packages will also recognize them. However, if another distribution is required, those distributions may still be encoded through reference to an external ontology, even if this makes the model less exchangeable. -When a call to a distribution is defined in the extended \Math, it is sampled when it is invoked. If a particular returned value needs to be used again, that value must be assigned to a parameter first, such as through the use of an \InitialAssignment or \EventAssignment. When a distribution is defined elsewhere, that information may be used outside of the model, using whatever methodology is appropriate to answer the question being pursued. +When a call to a distribution is defined in the extended \Math, it is sampled when it is invoked. If a particular \changed{sampled value should be used multiple times}, that value must be assigned to a parameter first, such as through the use of an \InitialAssignment or \EventAssignment. When an \changed{external} distribution is defined, \changed{it is not used in the math of the model, but may be used externally where appropriate.} \begin{table}[] @@ -620,8 +614,8 @@ http://www.sbml.org/sbml/symbols/distrib/laplace & laplace(location, scale) \\ & laplace(location, scale, min, max) \\ \midrule -http://www.sbml.org/sbml/symbols/distrib/lognormal & lognormal(shape, scale) \\ - & lognormal(shape, scale, min, max) +http://www.sbml.org/sbml/symbols/distrib/lognormal & lognormal(mean, stdev) \\ + & lognormal(mean, stdev, min, max) \\ \midrule http://www.sbml.org/sbml/symbols/distrib/poisson & poisson(rate) \\ & poisson(rate, min, max) @@ -644,7 +638,7 @@ The value of \token{min} must be less than the value of \token{max} for all continuous distributions, and the value of \token{min} must be less than or equal to the value of \token{max} for all discrete distributions. Additionally, the \token{min} and \token{max} values of a discrete distribution must span at least one integer between them, inclusive. -If a user wishes to define a distribution with only one bound, the other bound should be defined as INF or -INF, as appropriate. For those distributions that have an intrisic lower bound of 0, setting \token{min} to 0 or any negative number will have no effect, but is legal. +To define a distribution with only one bound, the other bound should be defined as INF or -INF, as appropriate. For those distributions that have an intrisic lower bound of 0, setting \token{min} to 0 or any negative number will have no effect, but is legal. \paragraph{Fallback functions} @@ -677,7 +671,7 @@ \\ \midrule laplace(location, scale) & location \\ \midrule -lognormal(shape, scale) & $\text{exp}(\text{scale} + \text{shape}/2)$ +lognormal(mean, stdev) & $\text{exp}(\text{mean} + \text{stdev}^{2}/2)$ \\ \midrule poisson(rate) & rate \\ \midrule @@ -898,7 +892,7 @@ \paragraph{Propagation of error} -It may be possible to calculate the propagation of error for a simulation of an SBML model. Be advised that this will be a complicated system, and may involve calculating partial derivates of equations that are not explicitly encoded. Many simulators choose instead to estimate the error through stochastic simulations. Either approach should be possible with a properly encoded \distribshort model. +It may be possible to \changed{propagate the error defined in \Uncertainty elements through the mathematics defined in a simulation of the model}. Be advised that this will be a complicated system, and may involve calculating partial derivates of equations that are not explicitly encoded. Many simulators choose instead to estimate the error through stochastic simulations. Either approach should be possible with a properly encoded \distribshort model. \subsubsection{Attributes inherited from \SBase} @@ -993,7 +987,7 @@ An \UncertParameter always inherits the optional \token{metaid} and \token{sboTerm} attributes, and inherits optional \token{id} and \token{name} attributes as described in \sec{sec:idname}. The \token{id} of a \UncertParameter takes the mathematical value of its \token{value} attribute if that attribute is defined, and the mathematical value of the corresponding \token{var} if that attribute is defined. This meaning may be used in other contexts, but that meaning may not be set directly by any other SBML element of any Level, Version, or package. If setting the value is desired, the \token{var} attribute should be used, and that referenced element set as per normal SBML procedures. The meaning is provided mostly to allow access to the \token{val} attribute, which otherwise would be undiscoverable to any other SBML element. \subsubsection{The child \token{math} element} -The optional \token{math} element contains MathML, and may only be used for an \UncertParameter of type \val{distribution} or \val{externalParameter}. When defined for a \val{distribution}, the MathML should define that distribution, such as by using one of the \token{csymbol} definitions from this specification. +The optional \token{math} element contains MathML, and may only be used for an \UncertParameter of type \val{distribution} or \val{externalParameter}. When defined for a \val{distribution}, the MathML should define that distribution, such as by using one of the extended \token{csymbol} definitions from this specification. \subsubsection{The child \token{ListOfUncertParameters} element} The optional child \token{ListOfUncertParameters} element may only be used for an \UncertParameter of type \val{distribution} or \val{externalParameter}. Unlike an \Uncertainty, there are no uniqueness restrictions among the children of this element: any number of \UncertParameter elements of any \token{type} may be used, according to whatever makes sense for the statistic defined by the parent \token{definitionURL}. @@ -1011,7 +1005,7 @@ -\subsection{The different \UncertParameter and \UncertSpan \token{type} values.} +\subsection{The different \class{UncertParameter} and \class{UncertSpan} \token{type} values.} The \primtype{UncertKind} values each have a particular definition. The following kinds are all single-value types, and thus may either be defined by \token{value} or \token{var}, and must only be used for \UncertParameter elements, not \UncertSpan elements. Definitions taken from \url{https://web.archive.org/web/20161029215725/uncertml.org/}). @@ -1166,7 +1160,7 @@ -\subsection{Examples using \Uncertainty} +\subsection{Examples using \class{Uncertainty}} \label{extended-sbase-examples} Several examples are given to illustrate the use of the \Uncertainty class: @@ -1208,7 +1202,7 @@ In this example, the initial amount of 3.22 is noted as having a mean of 3.2, a standard deviation of 0.3, and a variance of 0.09. Note that the standard deviation can be calculated from the variance (or visa versa), but the modeler has chosen to include both here for convenience. Note too that this use of the \Uncertainty element does not imply that the species amount comes from a normal distribution with a mean of 3.2 and standard deviation of 0.3, but rather that the species amount comes from an unknown distribution with those qualities. If it is known that the value was drawn from a particular distribution, an \UncertParameter of type \val{distribution} should be used, rather than \UncertParameter elements of type \val{mean} and \val{standardDeviation}. -Note also that 3.22 (the \token{initialAmount}) is different from 3.2 (the \token{mean}): evidently, this model was constructed as a realization of the underlying uncertainty, instead of trying to capture the single most likely model of the underlying process. +Note also that 3.22 (the \token{initialAmount}) is different from 3.2 (the \token{mean}): evidently, this model was constructed as a realization of the underlying uncertainty, instead of \changed{simply using the mean}. \subsubsection{Defining a random variable} @@ -1219,11 +1213,11 @@ as following a gamma distribution, with a given shape and scale. No value is given for the parameter so it is then up the modeler to decide how to use this random variable. For example they may choose to -simulate the model in which case they may provide values for \token{mu\_Z} -and \token{sd\_Z} and then sample a random value from the +simulate the model in which case they may provide values for \token{shape\_Z} +and \token{scale\_Z} and then sample a random value from the simulation. Alternatively they may choose to carry out a parameter -estimation and use experimental observations to estimate \token{mu\_Z} and -\token{sd\_Z}. +estimation and use experimental observations to estimate \token{shape\_Z} and +\token{scale\_Z}. For added information, the modeler has chosen to include the observed mean and variance of the value. These are close to the expected mean and variance from the given distribution (1.0 and 0.1, respectively, given the shape and scale), but were slightly different due to the sample size. @@ -1319,7 +1313,7 @@ \subsection{Custom annotations for function definitions} \label{sec:annotation-scheme} -Before this package was available, a collection of SBML simulator authors developed an \emph{ad hoc} convention for exchanging annotated \FunctionDefinition objects that represented draws from distributions. This convention is described by Frank T. Bergmann at \url{https://docs.google.com/file/d/0B_wMqVOQLkZ3TVZHblNNRWgzNTg/}, and represents a basic starting point for any modeler interested in exchanging SBML models containing draws from distributions. +Before this package was available, a collection of SBML simulator authors developed an \emph{ad hoc} convention for exchanging annotated \FunctionDefinition objects that represented draws from distributions. This convention is described by Frank T. Bergmann at \url{http://co.mbine.org/specifications/sbml.proposal.distrib-annotations.version-1}, and represents a basic starting point for any modeler interested in exchanging SBML models containing draws from distributions. When implementing \distrib support, it would be possible to include ``backwards'' support for this annotation convention by wrapping any calls to a distribution in a \FunctionDefinition, and annotating that using this scheme. @@ -1440,7 +1434,7 @@ \subsection{The \arrays package} This package is dependent on no other package, but might rely on the \arrays package -to provide vector and matrix structures if those are desired/used. Note that currently, the only way to need arrays is if an \UncertParameter of type \val{externalParameter} is defined that requires array input or output. +to provide vector and matrix structures if those are desired/used. Note that currently, the only \changed{case where arrays could be used is when} an \UncertParameter of type \val{externalParameter} is defined that requires array input or output. \subsection{SBML Level~3 Version~2} This package may be used with either SBML Level~3 Version~1 Core, or SBML Level~3 Version~2 Core, and no construct in this package changes as a result: the addition of \token{id} and \token{name} to \DistribBase means that the addition of those attributes to \SBase in SBML Level~3 Version~2 Core is redundant. |
From: <luc...@us...> - 2019-05-22 20:36:46
|
Revision: 26054 http://sourceforge.net/p/sbml/code/26054 Author: luciansmith Date: 2019-05-22 20:36:38 +0000 (Wed, 22 May 2019) Log Message: ----------- Ensure ast isn't NULL. Modified Paths: -------------- trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp Modified: trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp =================================================================== --- trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-05-22 20:35:46 UTC (rev 26053) +++ trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-05-22 20:36:38 UTC (rev 26054) @@ -1262,10 +1262,12 @@ while (!used && i < mMathElements->getSize()) { const ASTNode* ast = static_cast<SBase*>(mMathElements->get(i))->getMath(); - for (unsigned int j = 0; j < mSRIds->size(); j++) - { - used = containsId(ast, mSRIds->at(j)); - if (used) break; + if (ast != NULL) { + for (unsigned int j = 0; j < mSRIds->size(); j++) + { + used = containsId(ast, mSRIds->at(j)); + if (used) break; + } } i++; } |
From: <luc...@us...> - 2019-05-22 20:35:56
|
Revision: 26053 http://sourceforge.net/p/sbml/code/26053 Author: luciansmith Date: 2019-05-22 20:35:46 +0000 (Wed, 22 May 2019) Log Message: ----------- Fix: functions defined in extensions (like those for the L3v2 ones) were also being read as symbols: 'min(5, 3)' was a function, but so was just 'min'. Test added to ensure this stays fixed. Also, expose the number of allowed children for extension functions. Modified Paths: -------------- trunk/libsbml/src/sbml/extension/ASTBasePlugin.cpp trunk/libsbml/src/sbml/extension/ASTBasePlugin.h trunk/libsbml/src/sbml/math/L3Parser.cpp trunk/libsbml/src/sbml/math/L3Parser.ypp trunk/libsbml/src/sbml/math/L3ParserSettings.cpp trunk/libsbml/src/sbml/math/L3ParserSettings.h trunk/libsbml/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp Modified: trunk/libsbml/src/sbml/extension/ASTBasePlugin.cpp =================================================================== --- trunk/libsbml/src/sbml/extension/ASTBasePlugin.cpp 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/extension/ASTBasePlugin.cpp 2019-05-22 20:35:46 UTC (rev 26053) @@ -222,6 +222,19 @@ return false; } +vector<unsigned int> ASTBasePlugin::getNumAllowedChildren(ASTNodeType_t type) const +{ + for (size_t t = 0; t < mPkgASTNodeValues.size(); t++) + { + if (mPkgASTNodeValues[t].type == type) + { + return mPkgASTNodeValues[t].numAllowedChildren; + } + } + vector<unsigned int> empty; + return empty; +} + bool ASTBasePlugin::isLogical(ASTNodeType_t type) const { return false; @@ -722,6 +735,25 @@ } +ASTNodeType_t +ASTBasePlugin::getPackageSymbolFor(const std::string& function, bool strCmpIsCaseSensitive) const +{ + for (size_t t = 0; t < mPkgASTNodeValues.size(); t++) + { + if (emStrCmp(mPkgASTNodeValues[t].name, function, strCmpIsCaseSensitive)) + { + ASTNodeType_t ret = mPkgASTNodeValues[t].type; + if (!mPkgASTNodeValues[t].isFunction) + { + return ret; + } + return AST_UNKNOWN; + } + } + return AST_UNKNOWN; +} + + LIBSBML_CPP_NAMESPACE_END #endif /* __cplusplus */ Modified: trunk/libsbml/src/sbml/extension/ASTBasePlugin.h =================================================================== --- trunk/libsbml/src/sbml/extension/ASTBasePlugin.h 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/extension/ASTBasePlugin.h 2019-05-22 20:35:46 UTC (rev 26053) @@ -96,6 +96,7 @@ virtual bool defines(ASTNodeType_t type) const; virtual bool defines(const std::string& name, bool strCmpIsCaseSensitive = false) const; virtual bool isFunction(ASTNodeType_t type) const; + virtual std::vector<unsigned int> getNumAllowedChildren(ASTNodeType_t type) const; virtual bool isLogical(ASTNodeType_t type) const; virtual bool isMathMLNodeTag(const std::string& node) const; virtual bool isMathMLNodeTag(ASTNodeType_t type) const; @@ -439,6 +440,15 @@ */ virtual ASTNodeType_t getPackageFunctionFor(const std::string& name, bool strCmpIsCaseSensitive = false) const; + /** + * The user input a string of the form "name" with no parentheses, and we want to know if + * 'name' is recognized by a package as being a particular symbol. We already + * know that it is not used in the Model as the id of a mathematically-meaningful element. Should do + * caseless string comparison. Return the type of the symbol, or @sbmlconstant{AST_UNKNOWN, ASTNodeType_t} + * if nothing found. + */ + virtual ASTNodeType_t getPackageSymbolFor(const std::string& name, bool strCmpIsCaseSensitive = false) const; + /*-- data members --*/ // Modified: trunk/libsbml/src/sbml/math/L3Parser.cpp =================================================================== --- trunk/libsbml/src/sbml/math/L3Parser.cpp 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/math/L3Parser.cpp 2019-05-22 20:35:46 UTC (rev 26053) @@ -2545,7 +2545,7 @@ if (l3StrCmp(name, "nan")) return AST_REAL; if (l3StrCmp(name, "notanumber")) return AST_REAL; - return currentSettings->getPackageFunctionFor(name); + return currentSettings->getPackageSymbolFor(name); } ASTNodeType_t L3Parser::getFunctionFor(string name) const Modified: trunk/libsbml/src/sbml/math/L3Parser.ypp =================================================================== --- trunk/libsbml/src/sbml/math/L3Parser.ypp 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/math/L3Parser.ypp 2019-05-22 20:35:46 UTC (rev 26053) @@ -903,7 +903,7 @@ if (l3StrCmp(name, "nan")) return AST_REAL; if (l3StrCmp(name, "notanumber")) return AST_REAL; - return currentSettings->getPackageFunctionFor(name); + return currentSettings->getPackageSymbolFor(name); } ASTNodeType_t L3Parser::getFunctionFor(string name) const Modified: trunk/libsbml/src/sbml/math/L3ParserSettings.cpp =================================================================== --- trunk/libsbml/src/sbml/math/L3ParserSettings.cpp 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/math/L3ParserSettings.cpp 2019-05-22 20:35:46 UTC (rev 26053) @@ -255,6 +255,33 @@ /** @endcond */ /** @cond doxygenLibsbmlInternal */ +ASTNodeType_t +L3ParserSettings::getPackageSymbolFor(const std::string& name) const +{ + ASTNode * temp = new ASTNode(); + const ASTBasePlugin * baseplugin = temp->getASTPlugin(name, false, mStrCmpIsCaseSensitive); + delete temp; + if (baseplugin != NULL) + { + + /* If the plugin is the l3v2 plugin, but we have been asked not to use l3v2, continue*/ + ExtendedMathType_t emp = baseplugin->getExtendedMathType(); + std::map<ExtendedMathType_t, bool>::const_iterator found_emp = mParsePackages.find(emp); + if (found_emp != mParsePackages.end() && found_emp->second == false) + { + return AST_UNKNOWN; + } + ASTNodeType_t ret = baseplugin->getPackageSymbolFor(name, mStrCmpIsCaseSensitive); + if (ret != AST_UNKNOWN) + { + return ret; + } + } + return AST_UNKNOWN; +} +/** @endcond */ + +/** @cond doxygenLibsbmlInternal */ void L3ParserSettings::visitPackageInfixSyntax(const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb) const Modified: trunk/libsbml/src/sbml/math/L3ParserSettings.h =================================================================== --- trunk/libsbml/src/sbml/math/L3ParserSettings.h 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/math/L3ParserSettings.h 2019-05-22 20:35:46 UTC (rev 26053) @@ -1009,6 +1009,16 @@ ASTNodeType_t getPackageFunctionFor(const std::string& name) const; + /** + * The user input a string of the form "name" with no parentheses, and we want to know if + * 'name' is recognized by a package as being a particular function. We + * already know that it is not used in the Model as the id of an element with mathematical meaning. + * Should do caseless string comparison. Return the type of the symbol, + * or AST_UNKNOWN if nothing found. + */ + ASTNodeType_t getPackageSymbolFor(const std::string& name) const; + + }; Modified: trunk/libsbml/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp =================================================================== --- trunk/libsbml/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp 2019-05-22 19:59:01 UTC (rev 26052) +++ trunk/libsbml/src/sbml/packages/l3v2extendedmath/extension/test/TestReadWriteInfix.cpp 2019-05-22 20:35:46 UTC (rev 26053) @@ -322,6 +322,42 @@ END_TEST +START_TEST (test_L3v2EMExtension_infix_parser_symbols) +{ + ASTNode* math = SBML_parseL3Formula("max"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "max") == 0); + delete math; + + math = SBML_parseL3Formula("min"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "min") == 0); + delete math; + + math = SBML_parseL3Formula("quotient"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "quotient") == 0); + delete math; + + math = SBML_parseL3Formula("rateof"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "rateof") == 0); + delete math; + + math = SBML_parseL3Formula("rem"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "rem") == 0); + delete math; + + math = SBML_parseL3Formula("implies"); + fail_unless(math->getType() == AST_NAME); + fail_unless( strcmp(math->getName(), "implies") == 0); + delete math; + +} +END_TEST + + Suite * create_suite_L3v2EMExtensionReadWriteInfix (void) { @@ -333,6 +369,7 @@ tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_capitalization); tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_no_capitalization); tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_roundtrip); + tcase_add_test( tcase, test_L3v2EMExtension_infix_parser_symbols); suite_add_tcase(suite, tcase); |
From: <luc...@us...> - 2019-05-22 19:59:05
|
Revision: 26052 http://sourceforge.net/p/sbml/code/26052 Author: luciansmith Date: 2019-05-22 19:59:01 +0000 (Wed, 22 May 2019) Log Message: ----------- Remove non-const 'getMath': most classes don't have both const and non-const versions, meaning that if the non-const version is selected, NULL is always returned. Modified Paths: -------------- trunk/libsbml/src/sbml/SBase.cpp trunk/libsbml/src/sbml/SBase.h Modified: trunk/libsbml/src/sbml/SBase.cpp =================================================================== --- trunk/libsbml/src/sbml/SBase.cpp 2019-05-21 17:13:15 UTC (rev 26051) +++ trunk/libsbml/src/sbml/SBase.cpp 2019-05-22 19:59:01 UTC (rev 26052) @@ -3367,13 +3367,6 @@ } -ASTNode* -SBase::getMath() -{ - return NULL; -} - - bool SBase::isSetMath() const { Modified: trunk/libsbml/src/sbml/SBase.h =================================================================== --- trunk/libsbml/src/sbml/SBase.h 2019-05-21 17:13:15 UTC (rev 26051) +++ trunk/libsbml/src/sbml/SBase.h 2019-05-22 19:59:01 UTC (rev 26052) @@ -2481,16 +2481,6 @@ /** @cond doxygenLibsbmlInternal */ /** - * Returns @c NULL. SBase subclasses that define a child Math object - * will override this function to return that child. - * - * @return @c NULL. - */ - virtual ASTNode* getMath (); - /** @endcond */ - - /** @cond doxygenLibsbmlInternal */ - /** * Returns @c false. SBase subclasses that define a child Math object * will override this function and return whether or not that Math * object is set. |
From: <luc...@us...> - 2019-05-21 17:13:20
|
Revision: 26051 http://sourceforge.net/p/sbml/code/26051 Author: luciansmith Date: 2019-05-21 17:13:15 +0000 (Tue, 21 May 2019) Log Message: ----------- Fix double declaration. Modified Paths: -------------- trunk/libsbml/src/sbml/SBase.h Modified: trunk/libsbml/src/sbml/SBase.h =================================================================== --- trunk/libsbml/src/sbml/SBase.h 2019-05-21 17:11:23 UTC (rev 26050) +++ trunk/libsbml/src/sbml/SBase.h 2019-05-21 17:13:15 UTC (rev 26051) @@ -2465,12 +2465,6 @@ /** @cond doxygenLibsbmlInternal */ - virtual int setMath(const ASTNode* math); - - /** @endcond */ - - /** @cond doxygenLibsbmlInternal */ - virtual int setMessage (const std::string& message, bool addXHTMLMarkup = false); /** @endcond */ |
From: <luc...@us...> - 2019-05-21 17:11:30
|
Revision: 26050 http://sourceforge.net/p/sbml/code/26050 Author: luciansmith Date: 2019-05-21 17:11:23 +0000 (Tue, 21 May 2019) Log Message: ----------- Put in docs for math functions on SBase; make non-const 'getMath' version. Modified Paths: -------------- trunk/libsbml/src/sbml/SBase.cpp trunk/libsbml/src/sbml/SBase.h Modified: trunk/libsbml/src/sbml/SBase.cpp =================================================================== --- trunk/libsbml/src/sbml/SBase.cpp 2019-05-20 17:52:07 UTC (rev 26049) +++ trunk/libsbml/src/sbml/SBase.cpp 2019-05-21 17:11:23 UTC (rev 26050) @@ -3367,6 +3367,13 @@ } +ASTNode* +SBase::getMath() +{ + return NULL; +} + + bool SBase::isSetMath() const { Modified: trunk/libsbml/src/sbml/SBase.h =================================================================== --- trunk/libsbml/src/sbml/SBase.h 2019-05-20 17:52:07 UTC (rev 26049) +++ trunk/libsbml/src/sbml/SBase.h 2019-05-21 17:11:23 UTC (rev 26050) @@ -2475,18 +2475,51 @@ /** @endcond */ - /** @cond doxygenLibsbmlInternal */ + /** @cond doxygenLibsbmlInternal */ + /** + * Returns @c NULL. SBase subclasses that define a child Math object + * will override this function to return that child. + * + * @return @c NULL. + */ + virtual const ASTNode* getMath () const; + /** @endcond */ - virtual const ASTNode* getMath() const; + /** @cond doxygenLibsbmlInternal */ + /** + * Returns @c NULL. SBase subclasses that define a child Math object + * will override this function to return that child. + * + * @return @c NULL. + */ + virtual ASTNode* getMath (); + /** @endcond */ + /** @cond doxygenLibsbmlInternal */ + /** + * Returns @c false. SBase subclasses that define a child Math object + * will override this function and return whether or not that Math + * object is set. + * + * @return @c false. + */ + bool isSetMath () const; /** @endcond */ /** @cond doxygenLibsbmlInternal */ + /** + * Does nothing and returns @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}. + * SBase subclasses that define a child Math object + * will override this function to set that Math child. + * + * @param math an ASTNode representing a formula tree. + * + * @copydetails doc_returns_one_success_code + * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} + */ + virtual int setMath (const ASTNode* math); + /** @endcond */ - virtual bool isSetMath() const; - - /** @endcond */ - /** @cond doxygenLibsbmlInternal */ virtual std::string getMessageString () const; |
From: <luc...@us...> - 2019-05-20 17:52:15
|
Revision: 26049 http://sourceforge.net/p/sbml/code/26049 Author: luciansmith Date: 2019-05-20 17:52:07 +0000 (Mon, 20 May 2019) Log Message: ----------- Remove 'changed' bits for next version; add Chris as Contributor. Modified Paths: -------------- trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.pdf trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex Modified: trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.pdf =================================================================== (Binary files differ) Modified: trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex =================================================================== --- trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex 2019-05-20 06:37:38 UTC (rev 26048) +++ trunk/specifications/sbml-level-3/version-1/distrib/sbml-level-3-distrib-package-proposal.tex 2019-05-20 17:52:07 UTC (rev 26049) @@ -51,8 +51,8 @@ \packageTitle{The Distributions Package\\for SBML Level 3} -\packageVersion{Version \changed{0.24} (Draft)} -\packageVersionDate{\changed{April 24, 2019}} +\packageVersion{Version \changed{0.25} (Draft)} +\packageVersionDate{\changed{June XX, 2019}} %\packageGeneralURL{http://sbml.org/Community/Wiki/SBML_Level_3_Proposals/Distributions_and_Ranges} %\packageThisVersionURL{} @@ -66,20 +66,24 @@ \multicolumn{2}{c}{\Large\bf{Contributors}}\\ \\ Nicolas Le Nov\`{e}re & Darren Wilkinson \\ Babraham Institute & University of Newcastle -\\ Babraham, UK & Newcastle, UK +\\ Babraham, UK & Newcastle, UK \\ \\ Maciej J Swat & Sarah Keating \\ QSP Simcyp & EMBL-EBI -\\ Certara, Sheffield, UK & Hinxton, UK +\\ Certara, Sheffield, UK & Hinxton, UK \\ \\ Matthias K\"{o}nig & Michael Hucka \\ Humboldt University & California Institute of Technology -\\ Berlin, DE & Pasadena, CA +\\ Berlin, DE & Pasadena, CA, USA \\ +\\ Colin Gillespie & Chris Meyers +\\ University of Newcastle & University of Utah +\\ Newcastle, UK & Salt Lake City, UT, USA \\ - \multicolumn{2}{c}{ Colin Gillespie}\\ - \multicolumn{2}{c}{University of Newcastle}\\ - \multicolumn{2}{c}{ Newcastle, UK}\\ +%\\ +% \multicolumn{2}{c}{ Colin Gillespie}\\ +% \multicolumn{2}{c}{University of Newcastle}\\ +% \multicolumn{2}{c}{ Newcastle, UK}\\ \end{tabular} } @@ -94,7 +98,7 @@ \section*{Revision History} -The following table summarizes the history of revisions to this document and the development of the Distributions package for SBML Level~3. +The following table summarizes the history of this document. \tightspacing \begin{table}[bh] @@ -138,11 +142,11 @@ \midrule 0.21 (Draft) & January 2019 & Lucian Smith & Revisions based on suggestions from sbml-distrib, including extensive edits from Matthias. Also removed the extended function definitions entirely.\\ \midrule -0.22 (Draft) & February 2019 & Lucian Smith & Addition of \token{sampleSize}, mean values of distributions for fallback.\\ +0.22 (Draft) & February 2019 & Lucian Smith & Addition of \token{sampleSize} and mean values of distributions for fallback.\\ \midrule 0.23 (Draft) & February 2019 & Lucian Smith and Michael Hucka & Removal of Distribution and all subclasses; replaced with a \Math element instead; collapsed UncertStatistics into Uncertainty; some other edits from Michael Hucka.\\ \midrule -0.24 (Draft) & April 2019 & Lucian Smith & \changed{Removal of second distrib namespace, and consolidation of the \UncertParameter class.}\\ +0.24 (Draft) & April 2019 & Lucian Smith & Removal of second distrib namespace, and consolidation of the \UncertParameter class.\\ \bottomrule \end{edtable} \end{table} @@ -191,7 +195,7 @@ \subsection{This document} -This draft specification describes the consensus view of workshop participants and subscribers to the sbml-distrib mailing list. Although it was written by the listed authors, it does not solely reflect their views nor is it their proposal \changed{alone}. Rather, it is their understanding of the consensus view of what the \distrib package should do and how it should do it. The contributors listed have made significant contributions to the development and writing of this specification and are credited accordingly, but a more comprehensive attribution is provided in the acknowledgements (\sec{sec:acknowledgements}). +This draft specification describes the consensus view of workshop participants and subscribers to the sbml-distrib mailing list. Although it was written by the listed authors, it does not solely reflect their views nor is it their proposal alone. Rather, it is their understanding of the consensus view of what the \distrib package should do and how it should do it. The contributors listed have made significant contributions to the development and writing of this specification and are credited accordingly, but a more comprehensive attribution is provided in the acknowledgements (\sec{sec:acknowledgements}). \subsection{Conventions used in this document} @@ -427,7 +431,7 @@ \subsubsection{2019 HARMONY: Pasadena} -\changed{In the weeks leading up to the HARMONY held at Caltech, the PWG discussed various options for encoding uncertainties, based on different people's requirements. At HARMONY, we were able to coalesce around an approach that seems likely to be able to work for everyone, with multiple uncertainties per element, and a single \UncertParameter class with a \token{type} that encapsulates what used to be encoded in an element's class.} +In the weeks leading up to the HARMONY held at Caltech, the PWG discussed various options for encoding uncertainties, based on different people's requirements. At HARMONY, we were able to coalesce around an approach that seems likely to be able to work for everyone, with multiple uncertainties per element, and a single \UncertParameter class with a \token{type} that encapsulates what used to be encoded in an element's class. \section{Proposed syntax and semantics} @@ -541,7 +545,7 @@ distrib:required="true"> \end{example} -There is no difference between \changed{the 'distrib' part of these documents}, and all package semantics are identical. +There is no difference between the 'distrib' part of these documents, and all package semantics are identical. \paragraph{XML Namespace use} @@ -638,13 +642,13 @@ Many of the distributions take exactly two or four arguments (or exactly one or three arguments). For those functions, the optional last two arguments are \textit{min} and \textit{max}, for when the draw from the distribution is constrained to be between those two values. For all functions, the \textit{min} boundary is inclusive; that is, a value of \textit{min} may be returned by the function (though this may be very unlikely for draws from a continuous distribution). For all continuous distributions, the \textit{max} boundary is \emph{not} inclusive; that is, a value of \textit{max} will never be returned. The continuous distributions are \token{normal}, \token{cauchy}, \token{chisquare}, \token{exponential}, \token{gamma}, \token{laplace}, \token{lognormal}, and \token{rayleigh}. For the discrete distributions, the \textit{max} boundary is inclusive: that is, a value of \textit{max} may indeed be returned. The discrete distributions are \token{binomial} and \token{poisson}. -\changed{The value of \token{min} must be less than the value of \token{max} for all continuous distributions, and the value of \token{min} must be less than or equal to the value of \token{max} for all discrete distributions. Additionally, the \token{min} and \token{max} values of a discrete distribution must span at least one integer between them, inclusive.} +The value of \token{min} must be less than the value of \token{max} for all continuous distributions, and the value of \token{min} must be less than or equal to the value of \token{max} for all discrete distributions. Additionally, the \token{min} and \token{max} values of a discrete distribution must span at least one integer between them, inclusive. -\changed{If a user wishes to define a distribution with only one bound, the other bound should be defined as INF or -INF, as appropriate. For those distributions that have an intrisic lower bound of 0, setting \token{min} to 0 or any negative number will have no effect, but is legal.} +If a user wishes to define a distribution with only one bound, the other bound should be defined as INF or -INF, as appropriate. For those distributions that have an intrisic lower bound of 0, setting \token{min} to 0 or any negative number will have no effect, but is legal. \paragraph{Fallback functions} -If an SBML interpreter is unable to calculate one or more of the above extended \mathml functions, it may simply fail, or it might choose to return the mean of the given function instead. In either case, it is a good idea to inform the user that the model cannot be interpreted by the software as intended. \changed{Note that the mean of a discrete distribution is not necessarily a legal return value for that function, as it may not be an integer.} +If an SBML interpreter is unable to calculate one or more of the above extended \mathml functions, it may simply fail, or it might choose to return the mean of the given function instead. In either case, it is a good idea to inform the user that the model cannot be interpreted by the software as intended. Note that the mean of a discrete distribution is not necessarily a legal return value for that function, as it may not be an integer. The mean values in \tab{tab:meanvals} may be used as a fallback for software that cannot perform draws from a distribution. Note that truncated versions of these functions will have different means. Note also that the \token{cauchy} distribution has no mean, by definition. @@ -700,7 +704,7 @@ \subsubsection{Using a normal distribution} -In this example, the initial value of \token{y} is set as a draw from the normal distribution \changed{$normal(z, 10)$}: +In this example, the initial value of \token{y} is set as a draw from the normal distribution $normal(z, 10)$: \begin{example} <initialAssignment symbol="y"> @@ -719,7 +723,7 @@ \subsubsection{Defining a truncated normal distribution} -When used with four arguments instead of two, the normal distribution is truncated \changed{to $normal(z, 10, z-2, z+2)$}: +When used with four arguments instead of two, the normal distribution is truncated to $normal(z, 10, z-2, z+2)$: \begin{example} <initialAssignment symbol="y"> @@ -862,9 +866,9 @@ \label{extended-sbase-class} \label{ListOfUncertainties-class} -As can be seen in \fig{fig:extended-sbase-uml}, the SBML base class \SBase is extended to include \changed{an optional \ListOfUncertainties child element, which in turn contains optional \Uncertainty elements, each of which may contain a set of \UncertParameter objects that describe the uncertainty of the extended element. Multiple \Uncertainty elements are allowed as children of \SBase to allow the modeler to record \Uncertainty measurements from different sources (papers, experiments, etc.) that may overlap and/or contradict one another.} +As can be seen in \fig{fig:extended-sbase-uml}, the SBML base class \SBase is extended to include an optional \ListOfUncertainties child element, which in turn contains optional \Uncertainty elements, each of which may contain a set of \UncertParameter objects that describe the uncertainty of the extended element. Multiple \Uncertainty elements are allowed as children of \SBase to allow the modeler to record \Uncertainty measurements from different sources (papers, experiments, etc.) that may overlap and/or contradict one another. -In \sbmlthreecore, one should only extend those \SBase elements with mathematical meaning (\Compartment, \Parameter, \Reaction, \Species, and \SpeciesReference), or those \SBase elements with \Math children (\Constraint, \Delay, \EventAssignment, \FunctionDefinition, \InitialAssignment, \KineticLaw, \Priority, \Rule, and \Trigger). The \Uncertainty child is added to \SBase instead of to each SBML element so that other packages inherit the ability to extend their own elements in the same fashion: for example, the \changed{Qualitative Models package has the \QualitativeSpecies class which has mathematical meaning, and a \FunctionTerm class which has a \Math child. Both could be given an \Uncertainty child containing information about the distribution or set of samples from which they were drawn.} +In \sbmlthreecore, one should only extend those \SBase elements with mathematical meaning (\Compartment, \Parameter, \Reaction, \Species, and \SpeciesReference), or those \SBase elements with \Math children (\Constraint, \Delay, \EventAssignment, \FunctionDefinition, \InitialAssignment, \KineticLaw, \Priority, \Rule, and \Trigger). The \Uncertainty child is added to \SBase instead of to each SBML element so that other packages inherit the ability to extend their own elements in the same fashion: for example, the Qualitative Models package has the \QualitativeSpecies class which has mathematical meaning, and a \FunctionTerm class which has a \Math child. Both could be given an \Uncertainty child containing information about the distribution or set of samples from which they were drawn. \begin{figure}[b] \vspace*{2em} @@ -886,11 +890,11 @@ \label{Uncertainty-class} \label{uncertainty-class} -The \Uncertainty class is a collection of zero or more statistical measures related to the uncertainty of the parent SBML element. \changed{It may only contain one of each type of measurement, which means that each of its \UncertParameter children must have a unique \token{type} attribute for every value but \val{externalParameter}. Each \UncertParameter child with a \token{type} of \val{externalParameter} must, in turn, have a unique \token{definitionURL} value. If a given SBML element has multiple measures of the same \token{type} (for example, as measured from different sources or different experiments), it should be given multiple \Uncertainty children. Each \Uncertainty child must be a unique set of statistical measures.} +The \Uncertainty class is a collection of zero or more statistical measures related to the uncertainty of the parent SBML element. It may only contain one of each type of measurement, which means that each of its \UncertParameter children must have a unique \token{type} attribute for every value but \val{externalParameter}. Each \UncertParameter child with a \token{type} of \val{externalParameter} must, in turn, have a unique \token{definitionURL} value. If a given SBML element has multiple measures of the same \token{type} (for example, as measured from different sources or different experiments), it should be given multiple \Uncertainty children. Each \Uncertainty child must be a unique set of statistical measures. Note that for elements that change in value over time, the described uncertainty applies only to the element's initial state, and not to how it changes in time. For typical simulations, this means the element's initial assignment. -\changed{The child \UncertParameter children are named according to their class, so any \UncertSpan child will have the element name \token{uncertSpan}, and any \UncertParameter base class child will have the element name \token{uncertParameter}.} +The child \UncertParameter children are named according to their class, so any \UncertSpan child will have the element name \token{uncertSpan}, and any \UncertParameter base class child will have the element name \token{uncertParameter}. \paragraph{Propagation of error} @@ -906,13 +910,11 @@ \begin{figure}[htb] \includegraphics[width=0.8\linewidth]{figs/uncertParameter.pdf} -\caption{\changed{The definition of the \UncertParameter, \UncertSpan, and \ListOfUncertParameters classes. These classes allow an \Uncertainty to define an uncertainty numerically.}} +\caption{The definition of the \UncertParameter, \UncertSpan, and \ListOfUncertParameters classes. These classes allow an \Uncertainty to define an uncertainty numerically.} \label{fig:uncertParameter} \end{figure} -\begin{blockChanged} - \newcommand*\rot{\rotatebox{90}} \begin{table}[] @@ -985,7 +987,7 @@ The optional \token{units} attribue of an \UncertParameter is of type \primtype{UnitSIdRef}. The \primtype{UnitSIdRef} is defined in the \sbmlthreecore specification, but in brief, it may either be the \primtype{SId} of a \UnitDefinition in the \Model, or a predefined SI unit from the Table~2 in the \sbmlthreecore specification. The units of uncertainty statistics are generally either dimensionless or the same as the units of the parent, according to the formula that defines the value. A \token{mean} and a \token{standardDeviation}, for example, are always the same units as the parent, while a \token{coefficientOfVariation} is dimensionless. \subsubsection{The \token{definitionURL} attribute} -The optional \token{definitionURL} attribute (of type \primtype{ExternalRef}) may be used when the \token{type} of the \UncertParameter is \val{distribution}, \changed{and must be used when the \token{type} of the \UncertParameter is \val{externalParameter}}. The \primtype{ExternalRef} should point to an ontology URL, distribution \token{csymbol}, or other unique definition string that defines what is meant by this \UncertParameter. The \token{definitionURL} must not be defined if the \token{type} is any other value: the other types are already completely defined. +The optional \token{definitionURL} attribute (of type \primtype{ExternalRef}) may be used when the \token{type} of the \UncertParameter is \val{distribution}, and must be used when the \token{type} of the \UncertParameter is \val{externalParameter}. The \primtype{ExternalRef} should point to an ontology URL, distribution \token{csymbol}, or other unique definition string that defines what is meant by this \UncertParameter. The \token{definitionURL} must not be defined if the \token{type} is any other value: the other types are already completely defined. \subsubsection{Attributes inherited from \SBase} An \UncertParameter always inherits the optional \token{metaid} and \token{sboTerm} attributes, and inherits optional \token{id} and \token{name} attributes as described in \sec{sec:idname}. The \token{id} of a \UncertParameter takes the mathematical value of its \token{value} attribute if that attribute is defined, and the mathematical value of the corresponding \token{var} if that attribute is defined. This meaning may be used in other contexts, but that meaning may not be set directly by any other SBML element of any Level, Version, or package. If setting the value is desired, the \token{var} attribute should be used, and that referenced element set as per normal SBML procedures. The meaning is provided mostly to allow access to the \token{val} attribute, which otherwise would be undiscoverable to any other SBML element. @@ -1013,7 +1015,6 @@ The \primtype{UncertKind} values each have a particular definition. The following kinds are all single-value types, and thus may either be defined by \token{value} or \token{var}, and must only be used for \UncertParameter elements, not \UncertSpan elements. Definitions taken from \url{https://web.archive.org/web/20161029215725/uncertml.org/}). -\end{blockChanged} \begin{itemize} @@ -1025,11 +1026,11 @@ \item \token{median}: The median is described as the numeric value separating the higher half of a sample (or population) from the lower half. The median of a finite list of numbers can be found by arranging all the observations from lowest value to highest value and picking the middle one. If there is an even number of observations, then there is no single middle value, then the average of the two middle values is used. The median is also the 0.5 quantile, or 50th percentile. -\item \token{mode}: The mode is the value that occurs the most frequently in a data set (or a probability distribution). It need not be unique (e.g., two or more quantities occur equally often) and is typically defined for continuous valued quantities by first defining the histogram, and then giving the \changed{central} value of the bin containing the most counts. +\item \token{mode}: The mode is the value that occurs the most frequently in a data set (or a probability distribution). It need not be unique (e.g., two or more quantities occur equally often) and is typically defined for continuous valued quantities by first defining the histogram, and then giving the central value of the bin containing the most counts. \item \token{sampleSize}: The sample size is a direct count of the number of observations made or the number of samples measured. It is used in several other statistical measurements, and can be used to convert one to another. -\item \token{skewness}: The skewness of a random variable is a measure of how asymmetric the corresponding probability distribution is. The skewness is defined as $ \mu_3/\sigma^3 $ where $ \mu_3 $ is the 3rd \changed{central} moment of the distribution and $ \sigma $ is its standard deviation. +\item \token{skewness}: The skewness of a random variable is a measure of how asymmetric the corresponding probability distribution is. The skewness is defined as $ \mu_3/\sigma^3 $ where $ \mu_3 $ is the 3rd central moment of the distribution and $ \sigma $ is its standard deviation. \item \token{standardDeviation}: The standard deviation of a distribution or population is the square root of its variance and is given by $ \sigma = \sqrt{E[(X - \mu)^2]} $ where $ \mu = E[X] $. The population standard deviation is given by $ \sigma = \sqrt{\frac{1}{n} \sum_{i=1}^n\left(x_i - \bar{x} \right)^2} $ where $ \bar{x} = \frac{1}{n}\cdot \sum_{i=1}^n{x_i} $, and $ x_i $ represents the $ i $th observation of the quantity $ x $ in the population of size $ n $. The standard deviation is a widely used measure of the variability or dispersion since it is reported in the natural units of the quantity being considered. Note that if a finite sample of a population has been used then the sample standard deviation is the appropriate unbiased estimator to use. @@ -1039,7 +1040,7 @@ \end{itemize} -\changed{The following \token{UncertKind} values are all spans, and may only be used for \UncertSpan elements. They are defined by an upper and lower value. Definitions taken from taken from \url{https://web.archive.org/web/20161029215725/uncertml.org/}).} +The following \token{UncertKind} values are all spans, and may only be used for \UncertSpan elements. They are defined by an upper and lower value. Definitions taken from taken from \url{https://web.archive.org/web/20161029215725/uncertml.org/}). \begin{itemize} @@ -1049,11 +1050,11 @@ Unless specified otherwise, the confidence interval is usually chosen so that the remaining probability is split equally, that is $ P(x<a) = P(x>b) $. If $ x $ has a symmetric distribution, then the confidence intervals are usually centered around the mean. However, non-centered confidence intervals are possible and are better described by their lower and upper quantiles or levels. For example, a 50\% confidence interval would usually lie between the 25\% and 75\% quantiles, but could in theory also lie between the 10\% and 60\% quantiles, although this would be rare in practice. The \token{confidenceInterval} allows you the flexibility to specify non-symmetric confidence intervals however in practice we would expect the main usage to be for symmetric intervals. -The \token{confidenceInterval} child of a \Uncertainty is always the 95\% confidence interval. For other confidence intervals, use an \UncertParameter \changed{of type \val{externalParameter}} instead. } +The \token{confidenceInterval} child of a \Uncertainty is always the 95\% confidence interval. For other confidence intervals, use an \UncertParameter of type \val{externalParameter} instead. } \item {\token{credibleInterval}: In Bayesian statistics, a credible interval is similar to a confidence interval determined from the posterior distribution of a random variable $ x $. That is, given a prior distribution $ p(x) $ and some observations $ D $, the posterior probability $ p(x\mid D) $ can be computed using Bayes theorem. A 95\% credible interval is then any interval $ [a,b] $ so that $ \int_a^b p(x\mid D) = 0.95 $, that is the variable $ x $ lies in the interval $ [a,b] $ with posterior probability 0.95. Note that the interpretation of a credible interval is not the same as a (frequentist) confidence interval. -The \token{credibleInterval} child of a \Uncertainty is always the 95\% credible interval. For other credibility intervals, use an \UncertParameter \changed{of type \val{externalParameter}} instead.} +The \token{credibleInterval} child of a \Uncertainty is always the 95\% credible interval. For other credibility intervals, use an \UncertParameter of type \val{externalParameter} instead.} \item \token{interquartileRange}: The interquartile range is the range between the 1st and 3rd quartiles. It contains the middle 50\% of the sample realisations (or of the sample probability). It is typically used and shown in box plots. @@ -1062,7 +1063,6 @@ \end{itemize} -\begin{blockChanged} Finally, we have the \val{distribution} and \val{externalParameter} types: \begin{itemize} @@ -1090,12 +1090,11 @@ \end{example} \end{itemize} -\end{blockChanged} As examples, the following statistics are not defined by a single value nor by a range, and would therefore be good candidates for encoding as an external parameter. These terms were included in the now-defunct UncertML (and the definitions were again taken from \url{https://web.archive.org/web/20161029215725/uncertml.org/}), and may also be findable in other ontologies such as STATO (which has a searchable database at \url{https://www.ebi.ac.uk/ols/ontologies/stato}): \begin{itemize} -\item \changed{\token{centralMoment}}: For a given positive natural number $ k $, the $ k\textsuperscript{th} $ \changed{central} moment of a random variable $ x $ is defined as $ \mu_k = E[(x - E[x])^k] $. That is, it is the expected value of the deviation from the mean to the power $ k $. In particular, $ \mu_0 = 1 $, $ \mu_1 = 0 $ and $ \mu_2 $ is the variance of $ x $. +\item \token{centralMoment}: For a given positive natural number $ k $, the $ k\textsuperscript{th} $ central moment of a random variable $ x $ is defined as $ \mu_k = E[(x - E[x])^k] $. That is, it is the expected value of the deviation from the mean to the power $ k $. In particular, $ \mu_0 = 1 $, $ \mu_1 = 0 $ and $ \mu_2 $ is the variance of $ x $. \item \token{correlation}: The correlation between two random variables $ x_1 $ and $ x_2 $ is the extent to which these variable vary together in a linear fashion. It is characterized by the coefficient $ \rho_{1,2} = E[(x_1-\mu_1)(x_2-\mu_2)] / \sigma_1\sigma_2 $ where $ \mu_1 $ and $ \mu_2 $ are the means of $ x_1 $ and $ x_2 $ respectively, and $ \sigma_1 $ and $ \sigma_2 $ are their respective standard deviations. Note this is strictly not a description of uncertainty, but it can be useful to represent the correlation between two variables. Generally a covariance specification would be preferred since this describes the uncertainty. @@ -1102,7 +1101,7 @@ \item \token{decile}: A decile, $ d $, is any of the nine values that divide the sorted quantities into ten equal parts, so that each part represents 1/10 of the sample, population or distribution. The first decile is equivalent to the 10th percentile. \item \token{moment}: For a given positive natural number $ k $, the $ k\textsuperscript{th} $ moment of a random variable $ x $ is defined as $ \mu_k = E[x^k] $. In particular, $ \mu_0 = 1 $ and $ \mu_1 $ is the mean of $ x $. -The moments can be defined with respect to some point $ a $, that is $ \mu_k(a) = E[(x - a)^k] $. Moments defined about the mean are called \changed{central} moments. +The moments can be defined with respect to some point $ a $, that is $ \mu_k(a) = E[(x - a)^k] $. Moments defined about the mean are called central moments. \item \token{percentile}: A percentile is the value of a quantity below which a certain percent of values fall. This can be defined for samples, populations and distributions. For finite samples there is no widely accepted method, but all methods essentially rank the quantities and then use some interpolation to compute the percentile, unless the sample size $ n $ is a multiple of 100. For probability distributions the inverse cumulative density function can be used. The most widely used method is as follows: to estimate the value, $ x_p $, of the $ p $th percentile of an ascending ordered dataset containing $ n $ elements with values $ x_1, x_2, ... ,x_n $ first compute $ \rho = \frac{p}{100}\,({n}-1)+1 $. Now $ \rho $ is split into its integer component, $ k $, and decimal component, $ d $, such that $ \rho = k + d $. $ x_p $ is then calculated as $ x_p = x_k+d(x_{k+1}-x_k) $ where $ 1 < \rho < n $ with special cases $ x_p = x_1 \; [\rho=1]; \ x_n \; [\rho=n] $. @@ -1118,10 +1117,9 @@ -\begin{blockChanged} \subsection{The uncertainty of a \Species} -A \Species is a unique SBML construct in that its value is either an amount or a concentration, depending on the value of its \token{hasOnlySubstanceUnits} attribute (\val{true} for amount, or \val{false} for concentration). The value of its uncertainty tracks with this: if the value of \changed{\token{hasOnlySubstanceUnits} on the parent \Species} is \val{true}, the uncertainty is in terms of amounts, and if \val{false}, the uncertainty is in terms of concentration. +A \Species is a unique SBML construct in that its value is either an amount or a concentration, depending on the value of its \token{hasOnlySubstanceUnits} attribute (\val{true} for amount, or \val{false} for concentration). The value of its uncertainty tracks with this: if the value of \token{hasOnlySubstanceUnits} on the parent \Species is \val{true}, the uncertainty is in terms of amounts, and if \val{false}, the uncertainty is in terms of concentration. If a \Species is being modeled in SBML in amounts, but was measured in terms of its concentration, or visa versa, an \InitialAssignment should be created that explicitly handles this conversion and assigns the appropriate value to the \Species, as in the example below. @@ -1166,7 +1164,6 @@ Here, the uncertainty of the species \val{S\_amt} is not set explicitly, and instead can be derived from the uncertainty of the values in its initial assignment (\val{S\_conc} and \val{C}). -\end{blockChanged} \subsection{Examples using \Uncertainty} @@ -1209,7 +1206,7 @@ </species> \end{example} -In this example, the initial amount of 3.22 is noted as having a mean of 3.2, a standard deviation of 0.3, and a variance of 0.09. Note that the standard deviation can be calculated from the variance (or visa versa), but the modeler has chosen to include both here for convenience. Note too that this use of the \Uncertainty element does not imply that the species amount comes from a normal distribution with a mean of 3.2 and standard deviation of 0.3, but rather that the species amount comes from an unknown distribution with those qualities. If it is known that the value was drawn from a particular distribution, \changed{an \UncertParameter of type \val{distribution} should be used, rather than \UncertParameter elements of type \val{mean} and \val{standardDeviation}}. +In this example, the initial amount of 3.22 is noted as having a mean of 3.2, a standard deviation of 0.3, and a variance of 0.09. Note that the standard deviation can be calculated from the variance (or visa versa), but the modeler has chosen to include both here for convenience. Note too that this use of the \Uncertainty element does not imply that the species amount comes from a normal distribution with a mean of 3.2 and standard deviation of 0.3, but rather that the species amount comes from an unknown distribution with those qualities. If it is known that the value was drawn from a particular distribution, an \UncertParameter of type \val{distribution} should be used, rather than \UncertParameter elements of type \val{mean} and \val{standardDeviation}. Note also that 3.22 (the \token{initialAmount}) is different from 3.2 (the \token{mean}): evidently, this model was constructed as a realization of the underlying uncertainty, instead of trying to capture the single most likely model of the underlying process. @@ -1219,7 +1216,7 @@ In addition to describing the uncertainty about an experimental observation one can also use this mechanism to describe a parameter as a random variable. In the example below the parameter, \token{Z}, is defined -as following a \changed{gamma} distribution, with a given \changed{shape and scale}. No +as following a gamma distribution, with a given shape and scale. No value is given for the parameter so it is then up the modeler to decide how to use this random variable. For example they may choose to simulate the model in which case they may provide values for \token{mu\_Z} @@ -1228,7 +1225,7 @@ estimation and use experimental observations to estimate \token{mu\_Z} and \token{sd\_Z}. -\changed{For added information, the modeler has chosen to include the observed mean and variance of the value. These are close to the expected mean and variance from the given distribution (1.0 and 0.1, respectively, given the shape and scale), but were slightly different due to the sample size.} +For added information, the modeler has chosen to include the observed mean and variance of the value. These are close to the expected mean and variance from the given distribution (1.0 and 0.1, respectively, given the shape and scale), but were slightly different due to the sample size. \begin{example} <listOfParameters> @@ -1255,7 +1252,6 @@ </listOfParameters> \end{example} -\begin{blockChanged} \subsubsection{Defining external distributions} \label{sec:external-dist-example} @@ -1317,7 +1313,6 @@ </listOfUncertainties> \end{example} -\end{blockChanged} \clearpage \section{Interaction with other packages} @@ -1326,7 +1321,7 @@ \label{sec:annotation-scheme} Before this package was available, a collection of SBML simulator authors developed an \emph{ad hoc} convention for exchanging annotated \FunctionDefinition objects that represented draws from distributions. This convention is described by Frank T. Bergmann at \url{https://docs.google.com/file/d/0B_wMqVOQLkZ3TVZHblNNRWgzNTg/}, and represents a basic starting point for any modeler interested in exchanging SBML models containing draws from distributions. -When implementing \distrib support, it would be possible to include ``backwards'' support for this annotation convention by \changed{wrapping any calls to a distribution in a \FunctionDefinition, and annotating that using this scheme}. +When implementing \distrib support, it would be possible to include ``backwards'' support for this annotation convention by wrapping any calls to a distribution in a \FunctionDefinition, and annotating that using this scheme. \tab{tab:annotationURLs} is taken from the above document by Frank Bergmann, and can be used as a template if translating from that \FunctionDefinition system to the \distrib extended \Math system. The suggested fallback function returns the mean of the distribution. @@ -1445,14 +1440,12 @@ \subsection{The \arrays package} This package is dependent on no other package, but might rely on the \arrays package -to provide vector and matrix structures if those are desired/used. Note that currently, the only way to need arrays is if an \UncertParameter \changed{of type \val{externalParameter}} is defined that requires array input or output. +to provide vector and matrix structures if those are desired/used. Note that currently, the only way to need arrays is if an \UncertParameter of type \val{externalParameter} is defined that requires array input or output. -\begin{blockChanged} \subsection{SBML Level~3 Version~2} This package may be used with either SBML Level~3 Version~1 Core, or SBML Level~3 Version~2 Core, and no construct in this package changes as a result: the addition of \token{id} and \token{name} to \DistribBase means that the addition of those attributes to \SBase in SBML Level~3 Version~2 Core is redundant. However, another change between SBML Level~3 Version~1 and Version~2 is that in Version~2, core elements and core \Math may refer to package \token{ids} with mathematical meaning. Since \distrib \UncertParameter elements do indeed have mathematical meaning, this means that their ids may appear in core \Math, while this is not allowed in Version~1. If an \UncertParameter does need to be referenced in a Version~1 document, the \token{var} attribute should be used to connect the element to a core \Parameter, instead of using the \token{value} attribute. -\end{blockChanged} \section{Use-cases and examples} |
From: <fbe...@us...> - 2019-05-20 06:37:47
|
Revision: 26048 http://sourceforge.net/p/sbml/code/26048 Author: fbergmann Date: 2019-05-20 06:37:38 +0000 (Mon, 20 May 2019) Log Message: ----------- Merged revision(s) 26044-26047 from trunk/libsbml: - update version number for gnumake ........ - ensure that vs / vscode folders don't get added to source archives ........ - explicitly type all variables so it compiles with ancient compilers ........ Modified Paths: -------------- branches/libsbml-experimental/CMakeLists.txt branches/libsbml-experimental/examples/csharp/render/addRenderInformation.cs branches/libsbml-experimental/examples/csharp/render/printRenderInformation.cs Modified: branches/libsbml-experimental/CMakeLists.txt =================================================================== --- branches/libsbml-experimental/CMakeLists.txt 2019-05-18 21:50:01 UTC (rev 26047) +++ branches/libsbml-experimental/CMakeLists.txt 2019-05-20 06:37:38 UTC (rev 26048) @@ -149,7 +149,7 @@ set(CPACK_RPM_PACKAGE_GROUP "Libraries/Development") set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries") -set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/build/;/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") +set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/.vs/;/.vscode/;/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") if(UNIX) set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") Modified: branches/libsbml-experimental/examples/csharp/render/addRenderInformation.cs =================================================================== --- branches/libsbml-experimental/examples/csharp/render/addRenderInformation.cs 2019-05-18 21:50:01 UTC (rev 26047) +++ branches/libsbml-experimental/examples/csharp/render/addRenderInformation.cs 2019-05-20 06:37:38 UTC (rev 26048) @@ -23,7 +23,7 @@ Environment.Exit(4); } - var rInfo = rPlugin.createLocalRenderInformation(); + LocalRenderInformation rInfo = rPlugin.createLocalRenderInformation(); rInfo.setId("info"); rInfo.setName("Example Render Information"); rInfo.setProgramName("RenderInformation Examples"); @@ -30,7 +30,7 @@ rInfo.setProgramVersion("1.0"); // add some colors - var color = rInfo.createColorDefinition(); + ColorDefinition color = rInfo.createColorDefinition(); color.setId("black"); color.setColorValue("#000000"); @@ -43,12 +43,12 @@ color.setColorValue("#FFFFFF"); // add a linear gradient from black to white to silver - var gradient = rInfo.createLinearGradientDefinition(); + LinearGradient gradient = rInfo.createLinearGradientDefinition(); gradient.setId("simpleGradient"); gradient.setPoint1(new RelAbsVector(), new RelAbsVector()); gradient.setPoint2(new RelAbsVector(0, 100), new RelAbsVector(0, 100)); - var stop = gradient.createGradientStop(); + GradientStop stop = gradient.createGradientStop(); stop.setOffset(new RelAbsVector()); stop.setStopColor("white"); @@ -57,13 +57,13 @@ stop.setStopColor("silver"); // add a species style that represents them as ellipses with the gradient above - var style = rInfo.createStyle("ellipseStyle"); + Style style = rInfo.createStyle("ellipseStyle"); style.getGroup().setFillColor("simpleGradient"); style.getGroup().setStroke("black"); style.getGroup().setStrokeWidth(2.0); style.addType("SPECIESGLYPH"); - var ellipse = style.getGroup().createEllipse(); + Ellipse ellipse = style.getGroup().createEllipse(); ellipse.setCenter2D(new RelAbsVector(0, 50), new RelAbsVector(0, 50)); ellipse.setRadii(new RelAbsVector(0, 50), new RelAbsVector(0, 50)); @@ -78,13 +78,12 @@ } + string inputFile = args[0]; + string outputFile = args[1]; - var inputFile = args[0]; - var outputFile = args[1]; + SBMLDocument doc = libsbml.readSBMLFromFile(inputFile); + long numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); - var doc = libsbml.readSBMLFromFile(inputFile); - var numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); - if (numErrors > 0) { Console.WriteLine("Encountered errors while reading the file. "); @@ -93,9 +92,9 @@ return 2; } - var model = doc.getModel(); + Model model = doc.getModel(); - var plugin = (LayoutModelPlugin)model.getPlugin("layout"); + LayoutModelPlugin plugin = (LayoutModelPlugin)model.getPlugin("layout"); if (plugin == null || plugin.getNumLayouts() == 0) { @@ -103,7 +102,7 @@ return 3; } - var lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); + RenderListOfLayoutsPlugin lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); if (lolPlugin != null && lolPlugin.getNumGlobalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains global Render information. "); @@ -110,9 +109,9 @@ } // add render information to the first layout - var layout = plugin.getLayout(0); + Layout layout = plugin.getLayout(0); - var rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); + RenderLayoutPlugin rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); if (rPlugin != null && rPlugin.getNumLocalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains local Render information. "); @@ -119,7 +118,7 @@ } else { - var uri = doc.getLevel() == 2 ? RenderExtension.getXmlnsL2() : RenderExtension.getXmlnsL3V1V1(); + string uri = doc.getLevel() == 2 ? RenderExtension.getXmlnsL2() : RenderExtension.getXmlnsL3V1V1(); // enable render package doc.enablePackage(uri, "render", true); Modified: branches/libsbml-experimental/examples/csharp/render/printRenderInformation.cs =================================================================== --- branches/libsbml-experimental/examples/csharp/render/printRenderInformation.cs 2019-05-18 21:50:01 UTC (rev 26047) +++ branches/libsbml-experimental/examples/csharp/render/printRenderInformation.cs 2019-05-20 06:37:38 UTC (rev 26048) @@ -31,9 +31,9 @@ } - var inputFile = args[0]; + string inputFile = args[0]; - var doc = libsbml.readSBMLFromFile(inputFile); + SBMLDocument doc = libsbml.readSBMLFromFile(inputFile); Console.WriteLine("Using libSBML: {0} supporting packages for:", libsbml.getLibSBMLDottedVersion()); for (int i = 0; i < SBMLExtensionRegistry.getNumRegisteredPackages(); ++i) @@ -45,7 +45,7 @@ Console.WriteLine("\n"); - var numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); + long numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); if (numErrors > 0) { @@ -55,9 +55,9 @@ return 2; } - var model = doc.getModel(); + Model model = doc.getModel(); - var plugin = (LayoutModelPlugin) model.getPlugin("layout"); + LayoutModelPlugin plugin = (LayoutModelPlugin) model.getPlugin("layout"); if (plugin == null || plugin.getNumLayouts() == 0) { @@ -65,7 +65,7 @@ return 3; } - var lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); + RenderListOfLayoutsPlugin lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); if (lolPlugin != null && lolPlugin.getNumGlobalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains global Render information: "); @@ -72,14 +72,14 @@ for (int i = 0; i < lolPlugin.getNumGlobalRenderInformationObjects(); ++i) { - var info = lolPlugin.getRenderInformation(i); + GlobalRenderInformation info = lolPlugin.getRenderInformation(i); print_render_info(info); } } - var layout = plugin.getLayout(0); + Layout layout = plugin.getLayout(0); - var rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); + RenderLayoutPlugin rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); if (rPlugin != null && rPlugin.getNumLocalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains local Render information. "); @@ -86,7 +86,7 @@ // here we would do the same as above for the local render information ... for (int i = 0; i < rPlugin.getNumLocalRenderInformationObjects(); ++i) { - var info = rPlugin.getRenderInformation(i); + LocalRenderInformation info = rPlugin.getRenderInformation(i); print_render_info(info); } } @@ -102,7 +102,7 @@ Console.WriteLine("\nStyles: "); for (int j = 0; j < info.getNumGlobalStyles(); ++j) { - var style = info.getGlobalStyle(j); + GlobalStyle style = info.getGlobalStyle(j); print_style(style, j); } } @@ -115,7 +115,7 @@ Console.WriteLine("\nStyles: "); for (int j = 0; j < info.getNumLocalStyles(); ++j) { - var style = info.getLocalStyle(j); + LocalStyle style = info.getLocalStyle(j); print_style(style, j); } } @@ -136,7 +136,7 @@ Console.WriteLine("\nColor Definitions:"); for (int j = 0; j < info.getNumColorDefinitions(); ++j) { - var color = info.getColorDefinition(j); + ColorDefinition color = info.getColorDefinition(j); Console.WriteLine("\tcolor: " + j.ToString() + " id: " + color.getId() + " color: " + color.getValue()); @@ -145,7 +145,7 @@ Console.WriteLine("\nGradientDefinitions: "); for (int j = 0; j < info.getNumGradientDefinitions(); ++j) { - var grad = info.getGradientDefinition(j); + GradientBase grad = info.getGradientDefinition(j); print_gradient_definition(grad); } @@ -163,7 +163,7 @@ if (!style.isSetGroup()) return; - var group = style.getGroup(); + RenderGroup group = style.getGroup(); if (group.isSetStroke()) Console.WriteLine("\t\tstroke: {0}",group.getStroke()); @@ -172,11 +172,11 @@ for (int j = 0; j < group.getNumElements(); ++j) { - var element = group.getElement(j); + object element = group.getElement(j); if (element is GraphicalPrimitive2D) - Console.WriteLine("\t\tsub element {0} stroke {1}, fill {2}", element.getElementName(), ((GraphicalPrimitive2D)element).getStroke(), ((GraphicalPrimitive2D)element).getFill()); + Console.WriteLine("\t\tsub element {0} stroke {1}, fill {2}", ((GraphicalPrimitive2D)element).getElementName(), ((GraphicalPrimitive2D)element).getStroke(), ((GraphicalPrimitive2D)element).getFill()); else if (element is GraphicalPrimitive1D) - Console.WriteLine("\t\tsub element {0} stroke {1}", element.getElementName(), ((GraphicalPrimitive1D)element).getStroke()); + Console.WriteLine("\t\tsub element {0} stroke {1}", ((GraphicalPrimitive1D)element).getElementName(), ((GraphicalPrimitive1D)element).getStroke()); } } @@ -206,7 +206,7 @@ for (int k = 0; k < element.getNumGradientStops(); ++k) { - var stop = element.getGradientStop(k); + GradientStop stop = element.getGradientStop(k); if (stop == null) { continue; |
From: <fbe...@us...> - 2019-05-18 21:50:08
|
Revision: 26047 http://sourceforge.net/p/sbml/code/26047 Author: fbergmann Date: 2019-05-18 21:50:01 +0000 (Sat, 18 May 2019) Log Message: ----------- - explicitly type all variables so it compiles with ancient compilers Modified Paths: -------------- trunk/libsbml/examples/csharp/render/addRenderInformation.cs trunk/libsbml/examples/csharp/render/printRenderInformation.cs Modified: trunk/libsbml/examples/csharp/render/addRenderInformation.cs =================================================================== --- trunk/libsbml/examples/csharp/render/addRenderInformation.cs 2019-05-07 10:13:45 UTC (rev 26046) +++ trunk/libsbml/examples/csharp/render/addRenderInformation.cs 2019-05-18 21:50:01 UTC (rev 26047) @@ -23,7 +23,7 @@ Environment.Exit(4); } - var rInfo = rPlugin.createLocalRenderInformation(); + LocalRenderInformation rInfo = rPlugin.createLocalRenderInformation(); rInfo.setId("info"); rInfo.setName("Example Render Information"); rInfo.setProgramName("RenderInformation Examples"); @@ -30,7 +30,7 @@ rInfo.setProgramVersion("1.0"); // add some colors - var color = rInfo.createColorDefinition(); + ColorDefinition color = rInfo.createColorDefinition(); color.setId("black"); color.setColorValue("#000000"); @@ -43,12 +43,12 @@ color.setColorValue("#FFFFFF"); // add a linear gradient from black to white to silver - var gradient = rInfo.createLinearGradientDefinition(); + LinearGradient gradient = rInfo.createLinearGradientDefinition(); gradient.setId("simpleGradient"); gradient.setPoint1(new RelAbsVector(), new RelAbsVector()); gradient.setPoint2(new RelAbsVector(0, 100), new RelAbsVector(0, 100)); - var stop = gradient.createGradientStop(); + GradientStop stop = gradient.createGradientStop(); stop.setOffset(new RelAbsVector()); stop.setStopColor("white"); @@ -57,13 +57,13 @@ stop.setStopColor("silver"); // add a species style that represents them as ellipses with the gradient above - var style = rInfo.createStyle("ellipseStyle"); + Style style = rInfo.createStyle("ellipseStyle"); style.getGroup().setFillColor("simpleGradient"); style.getGroup().setStroke("black"); style.getGroup().setStrokeWidth(2.0); style.addType("SPECIESGLYPH"); - var ellipse = style.getGroup().createEllipse(); + Ellipse ellipse = style.getGroup().createEllipse(); ellipse.setCenter2D(new RelAbsVector(0, 50), new RelAbsVector(0, 50)); ellipse.setRadii(new RelAbsVector(0, 50), new RelAbsVector(0, 50)); @@ -78,13 +78,12 @@ } + string inputFile = args[0]; + string outputFile = args[1]; - var inputFile = args[0]; - var outputFile = args[1]; + SBMLDocument doc = libsbml.readSBMLFromFile(inputFile); + long numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); - var doc = libsbml.readSBMLFromFile(inputFile); - var numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); - if (numErrors > 0) { Console.WriteLine("Encountered errors while reading the file. "); @@ -93,9 +92,9 @@ return 2; } - var model = doc.getModel(); + Model model = doc.getModel(); - var plugin = (LayoutModelPlugin)model.getPlugin("layout"); + LayoutModelPlugin plugin = (LayoutModelPlugin)model.getPlugin("layout"); if (plugin == null || plugin.getNumLayouts() == 0) { @@ -103,7 +102,7 @@ return 3; } - var lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); + RenderListOfLayoutsPlugin lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); if (lolPlugin != null && lolPlugin.getNumGlobalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains global Render information. "); @@ -110,9 +109,9 @@ } // add render information to the first layout - var layout = plugin.getLayout(0); + Layout layout = plugin.getLayout(0); - var rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); + RenderLayoutPlugin rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); if (rPlugin != null && rPlugin.getNumLocalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains local Render information. "); @@ -119,7 +118,7 @@ } else { - var uri = doc.getLevel() == 2 ? RenderExtension.getXmlnsL2() : RenderExtension.getXmlnsL3V1V1(); + string uri = doc.getLevel() == 2 ? RenderExtension.getXmlnsL2() : RenderExtension.getXmlnsL3V1V1(); // enable render package doc.enablePackage(uri, "render", true); Modified: trunk/libsbml/examples/csharp/render/printRenderInformation.cs =================================================================== --- trunk/libsbml/examples/csharp/render/printRenderInformation.cs 2019-05-07 10:13:45 UTC (rev 26046) +++ trunk/libsbml/examples/csharp/render/printRenderInformation.cs 2019-05-18 21:50:01 UTC (rev 26047) @@ -31,9 +31,9 @@ } - var inputFile = args[0]; + string inputFile = args[0]; - var doc = libsbml.readSBMLFromFile(inputFile); + SBMLDocument doc = libsbml.readSBMLFromFile(inputFile); Console.WriteLine("Using libSBML: {0} supporting packages for:", libsbml.getLibSBMLDottedVersion()); for (int i = 0; i < SBMLExtensionRegistry.getNumRegisteredPackages(); ++i) @@ -45,7 +45,7 @@ Console.WriteLine("\n"); - var numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); + long numErrors = doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR); if (numErrors > 0) { @@ -55,9 +55,9 @@ return 2; } - var model = doc.getModel(); + Model model = doc.getModel(); - var plugin = (LayoutModelPlugin) model.getPlugin("layout"); + LayoutModelPlugin plugin = (LayoutModelPlugin) model.getPlugin("layout"); if (plugin == null || plugin.getNumLayouts() == 0) { @@ -65,7 +65,7 @@ return 3; } - var lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); + RenderListOfLayoutsPlugin lolPlugin = (RenderListOfLayoutsPlugin)plugin.getListOfLayouts().getPlugin("render"); if (lolPlugin != null && lolPlugin.getNumGlobalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains global Render information: "); @@ -72,14 +72,14 @@ for (int i = 0; i < lolPlugin.getNumGlobalRenderInformationObjects(); ++i) { - var info = lolPlugin.getRenderInformation(i); + GlobalRenderInformation info = lolPlugin.getRenderInformation(i); print_render_info(info); } } - var layout = plugin.getLayout(0); + Layout layout = plugin.getLayout(0); - var rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); + RenderLayoutPlugin rPlugin = (RenderLayoutPlugin)layout.getPlugin("render"); if (rPlugin != null && rPlugin.getNumLocalRenderInformationObjects() > 0) { Console.WriteLine("The loaded model contains local Render information. "); @@ -86,7 +86,7 @@ // here we would do the same as above for the local render information ... for (int i = 0; i < rPlugin.getNumLocalRenderInformationObjects(); ++i) { - var info = rPlugin.getRenderInformation(i); + LocalRenderInformation info = rPlugin.getRenderInformation(i); print_render_info(info); } } @@ -102,7 +102,7 @@ Console.WriteLine("\nStyles: "); for (int j = 0; j < info.getNumGlobalStyles(); ++j) { - var style = info.getGlobalStyle(j); + GlobalStyle style = info.getGlobalStyle(j); print_style(style, j); } } @@ -115,7 +115,7 @@ Console.WriteLine("\nStyles: "); for (int j = 0; j < info.getNumLocalStyles(); ++j) { - var style = info.getLocalStyle(j); + LocalStyle style = info.getLocalStyle(j); print_style(style, j); } } @@ -136,7 +136,7 @@ Console.WriteLine("\nColor Definitions:"); for (int j = 0; j < info.getNumColorDefinitions(); ++j) { - var color = info.getColorDefinition(j); + ColorDefinition color = info.getColorDefinition(j); Console.WriteLine("\tcolor: " + j.ToString() + " id: " + color.getId() + " color: " + color.getValue()); @@ -145,7 +145,7 @@ Console.WriteLine("\nGradientDefinitions: "); for (int j = 0; j < info.getNumGradientDefinitions(); ++j) { - var grad = info.getGradientDefinition(j); + GradientBase grad = info.getGradientDefinition(j); print_gradient_definition(grad); } @@ -163,7 +163,7 @@ if (!style.isSetGroup()) return; - var group = style.getGroup(); + RenderGroup group = style.getGroup(); if (group.isSetStroke()) Console.WriteLine("\t\tstroke: {0}",group.getStroke()); @@ -172,11 +172,11 @@ for (int j = 0; j < group.getNumElements(); ++j) { - var element = group.getElement(j); + object element = group.getElement(j); if (element is GraphicalPrimitive2D) - Console.WriteLine("\t\tsub element {0} stroke {1}, fill {2}", element.getElementName(), ((GraphicalPrimitive2D)element).getStroke(), ((GraphicalPrimitive2D)element).getFill()); + Console.WriteLine("\t\tsub element {0} stroke {1}, fill {2}", ((GraphicalPrimitive2D)element).getElementName(), ((GraphicalPrimitive2D)element).getStroke(), ((GraphicalPrimitive2D)element).getFill()); else if (element is GraphicalPrimitive1D) - Console.WriteLine("\t\tsub element {0} stroke {1}", element.getElementName(), ((GraphicalPrimitive1D)element).getStroke()); + Console.WriteLine("\t\tsub element {0} stroke {1}", ((GraphicalPrimitive1D)element).getElementName(), ((GraphicalPrimitive1D)element).getStroke()); } } @@ -206,7 +206,7 @@ for (int k = 0; k < element.getNumGradientStops(); ++k) { - var stop = element.getGradientStop(k); + GradientStop stop = element.getGradientStop(k); if (stop == null) { continue; |
From: <fbe...@us...> - 2019-05-07 10:13:52
|
Revision: 26046 http://sourceforge.net/p/sbml/code/26046 Author: fbergmann Date: 2019-05-07 10:13:45 +0000 (Tue, 07 May 2019) Log Message: ----------- - ensure that vs / vscode folders don't get added to source archives Modified Paths: -------------- trunk/libsbml/CMakeLists.txt Modified: trunk/libsbml/CMakeLists.txt =================================================================== --- trunk/libsbml/CMakeLists.txt 2019-04-29 13:36:55 UTC (rev 26045) +++ trunk/libsbml/CMakeLists.txt 2019-05-07 10:13:45 UTC (rev 26046) @@ -149,7 +149,7 @@ set(CPACK_RPM_PACKAGE_GROUP "Libraries/Development") set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries") -set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") +set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR};/.vs/;/.vscode/;/.svn/;/.libs/;/.deps/;/.bzr/;.*.o$;.*.lo$;.*.la$;${CPACK_SOURCE_IGNORE_FILES};/.DS_Store;/.svnignore;blib;libsbml-dist") if(UNIX) set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") |