Tutorial 1: Importing and Initialization

This Tutorial demonstrates how to import the Toolkit and intialize instances of its classes.

Toolkit Release

[1]:
#pip install sir3stoolkit

Imports

DLL References

The Toolkit requires the Sir3S_Toolkit.dll included in SIR 3S installations (from Quebec and Up). Furthermore the Sir3S_Repository.Interfaces.dll is required to input native SIR 3S datatypes into some Toolkit functions.

[2]:
import clr as clr
[3]:
SIR3S_SIRGRAF_DIR = r"C:\3S\SIR 3S Entwicklung\SirGraf-90-15-00-11_Quebec_x64"
[4]:
clr.AddReference(SIR3S_SIRGRAF_DIR+r"\Sir3S_Repository.Interfaces")
import Sir3S_Repository.Interfaces as Interfaces
[5]:
clr.AddReference(SIR3S_SIRGRAF_DIR+r"\Sir3S_Toolkit")
import Sir3S_Toolkit

PythonWrapperToolkit

[6]:
import sir3stoolkit

The core of sir3stoolkit is a Python Wrapper around C#, that can be used to read, write, etc. to a SIR 3S Model. In the future pure python subpackages may be added.

[7]:
from sir3stoolkit.core import wrapper
[8]:
sir3stoolkit
[8]:
<module 'sir3stoolkit' from 'c:\\Users\\jablonski\\AppData\\Local\\anaconda3\\Lib\\site-packages\\sir3stoolkit\\__init__.py'>

The wrapper package has to be initialized with reference to a SIR Graf installation.

[9]:
wrapper.Initialize_Toolkit(SIR3S_SIRGRAF_DIR)

Initialization

Toolkit contains two classes: SIR3S_Model(model and data) and SIR3S_View(depiction in SIR Graf). All Toolkit functionality is accessed via the methods of these classes.

[10]:
s3s = wrapper.SIR3S_Model()
Initialization complete
[11]:
s3s_view = wrapper.SIR3S_View()
Initialization complete

Now follows: Tutorial 2: Creating or Opening a SIR 3S Model