-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The test if a plugin is loaded returns true when JSBML has a parser loaded #216
Comments
Along with this issue, while running the statements |
I can see that it can be confusing. We need at least to make the documentation clearer. My thinking on allowing namespace as well was to make it more convenient for people but make it work like when you use the package label, meaning returning the plugin if it does exist. I don't think this method is use too much with namespace so we could change it's behaviour. I see two options:
What do you think ? |
Also if you are really writing a piece of code for only a specific version of a package, you might just test it at the SBMLDocument level and stop right without doing anything else if it is not the right one. |
@niko-rodrigue which convenient method in JSBML can be used to answer the question if an arbitrary instance of an |
Not really related to the issue but you have: https://sbmlteam.github.io/jsbml/files/doc/api/1.5/org/sbml/jsbml/SBase.html#getNumPlugins-- as well as SBase#getExtensionCount() Or if I misunderstood your question, SBase#isSetPlugin |
Ok, but these methods won't answer the question if a specific extension, such as fbc, is attached to an instance of SBase. So, we can check if there is any extension but then don't know which one, nor if the one of interest is there. |
The test
isSetPlugin
onAbstractSBase
should returntrue
if theSBase
has a child with the given namespace. In the current implementation, however, it returnstrue
if JSBML has (at some point) loaded a parser for parsing that namespace.For example, if a model has an FBC extension in package version 1, JSBML will return
true
when askingmodel.isSetPlugin
with the namespace of FBC package version 2 as argument. For testing, the model 01190 from the SBML test suite can be used.The desired behavior of this method (and the corresponding method
hasExtension
) is that it should only returntrue
if an extension with the given namespace exists.The text was updated successfully, but these errors were encountered: