Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » python segmentation fault accessing listOfCompartments () [0]
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Paul Shannon


Posts: 3
Registered:
September 2003
Re: python segmentation fault accessing listOfCompartments () [0] 13 Apr '11 15:35 Go to previous message

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

      

SubjectPosterDate
Read Message   python segmentation fault accessing listOfCompartm... Paul Shannon13 Apr '11 14:32
Read Message   Re: python segmentation fault accessing listOfComp... fbergman13 Apr '11 15:06
Read Message   Re: python segmentation fault accessing listOfComp...  Paul Shannon13 Apr '11 15:35
Previous Topic:libsbml-5.0.0 + Matlab bindings
Next Topic:Mapping MIRIAM annotations for reactions
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.