sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.

Home Page:https://sbml.org/software/libsbml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libsbml writing out empty <listOfReactants/>

luciansmith opened this issue · comments

This is a change of behavior from not long ago: if I flatten the attached model, I now get and didn't use to. Is this behavior intentional?

deleteReactant.xml.txt

Correction! This is a difference in behavior of an L3v1 model vs. an L3v2 model, because of Reaction::writeElements, which checks

    if (mReactants.hasOptionalElements() == true ||
        mReactants.hasOptionalAttributes() == true ||
        mReactants.isExplicitlyListed())
    {
      mReactants.write(stream);
    }

Is there an obvious place to turn off isExplicitlyLIsted in the flattening routines, assuming we need to do that there?

There is

ListOf::setExplicitlyListed(bool value)

so you should be able to set it on all lists you want during the flattening procedure.

Lucian sorted this