| Author | Topic |
Posts: 3
Registered: September 2003
|
|
Re: python segmentation fault accessing listOfCompartments () [0]
|
13 Apr '11 15:35
|
 |
|
Hi Frank,
That IS the problem. Thank you!
- Paul
On Apr 13, 2011, at 3:06 PM, Frank T. Bergmann wrote:
> Hello Paul,
>
>
> On Apr 13, 2011, at 2:32 PM, Paul Shannon wrote:
>>
>>>>> filename = 'enzymaticReaction.xml'
>>>>> m = readModel (filename) # <libsbml.Model; proxy of <Swig Object of type 'Model_t *' at 0x10062f150> >
>>>>> c = m.getListOfCompartments () # <libsbml.ListOfCompartments; proxy of <Swig Object of type 'ListOfCompartments *' at 0x100616fc0> >
>>>>> len (c) # 1
>>>>> c [0] # Segmentation fault; c.get (0) segfaults also
>>
>
> For me this looks like a problem with the SBML Document going out of scope. As context, all SBML objects provided by libsbml live in an SBMLDocument. If that document goes out of scope, all references left to the SBML objects inside become invalid. could you try the following:
>
> from libsbml import *
> doc = readSBMLFromFile(filename)
> m = doc.getModel()
> c = m.getListOfCompartments()
> c[0]
>
> thanks
> Frank
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu
|
|
|