5.6. Other Methods

5.6.1. Getting version numbers

getLibECSVersion() method of ecell.ecs module gives the version of the C++ backend library (libecs) as a string. getLibECSVersionInfo() method of the module gives the version as a Python tuple. The tuple contains three numbers in this order: ( MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION )

ecell3-session>>> import ecell
ecell3-session>>> ecell.ecs.getLibECSVersion()
'3.2.0'
ecell3-session>>> ecell.ecs.getLibECSVersionInfo()
(3, 2, 0)

5.6.2. DM loading-related methods

The search path of DM files can be specified and retrieved by using setDMSearchPath() and getDMSearchPath() methods. These methods gets and returns a colon (:) separated list of directory names. The search path can also be specified by using ECELL3_DM_PATH environment variable. See the previous section for more about DMsearch path.

ecell3-session>>> import ecell
ecell3-session>>> ecell.ecs.setDMSearchPath( '~/dm:~/test/dm' )
ecell3-session>>> ecell.ecs.getDMSearchPath()
'~/dm:~/test/dm'

A list of built-in and already loaded DM classes can be gotten with getDMInfo() method of ecell.ecs.Simulator class. The Simulator instance is available to Session as theSimulator variable. The method returns a nested Python tuple in the form of ( ( TYPE1, CLASSNAME1, PATH1 ), ( TYPE2, CLASSNAME2, PATH2 ), ... ). TYPE is one of 'Process', 'Variable', 'System', or 'Stepper'. CLASSNAME is the class name of the DM. PATH is the directory from which the DM is loaded. PATH is an empty string ('') if it is a built-in class.


ecell3-session>>> theSimulator.getDMInfo()
(('Process', 'GillespieProcess', '/usr/lib/ecell/3.2/GillespieProcess.so'), 
('Stepper', 'DiscreteTimeStepper', ''), 
('Stepper', 'NRStepper', '/usr/lib/ecell/3.2/NRStepper.so'), ... )