{ "cells": [ { "cell_type": "markdown", "id": "5556432f", "metadata": {}, "source": [ "# Tutorial 0: Importing and initialization of the SIR 3S Toolkit" ] }, { "cell_type": "markdown", "id": "c9397791", "metadata": {}, "source": [ "This tutorial demonstrates how to import the SIR 3S Toolkit and initialize instances of its classes.\n" ] }, { "cell_type": "markdown", "id": "a1affc3c-90c0-4590-ae08-28b6d5799dba", "metadata": {}, "source": [ "## SIR 3S Installation" ] }, { "cell_type": "code", "execution_count": 15, "id": "99b10f8f-1537-4ce9-8a6d-b6954b23a51c", "metadata": {}, "outputs": [], "source": [ "SIR3S_SIRGRAF_DIR = r\"C:\\3S\\SIR 3S Entwicklung\\SirGraf-90-15-00-16_Quebec_x64\" #change to local path" ] }, { "cell_type": "markdown", "id": "d6773e12", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "markdown", "id": "0c29ae20", "metadata": {}, "source": [ "Note: The SIR 3S Toolkit requires the Sir3S_Toolkit.dll included in SIR 3S installations (version Quebec and higher)." ] }, { "cell_type": "code", "execution_count": 16, "id": "4552a777", "metadata": {}, "outputs": [], "source": [ "import sir3stoolkit" ] }, { "cell_type": "markdown", "id": "29743e38", "metadata": {}, "source": [ "The core of sir3stoolkit is a Python wrapper around basic functionality of SIR 3S, offering a low-level access to the creation, modification and simulation of SIR 3S models. In the future pure python subpackages may be added." ] }, { "cell_type": "code", "execution_count": 17, "id": "ff2227b3", "metadata": {}, "outputs": [], "source": [ "from sir3stoolkit.core import wrapper" ] }, { "cell_type": "code", "execution_count": 18, "id": "a5910232", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sir3stoolkit" ] }, { "cell_type": "markdown", "id": "b05c8cae", "metadata": {}, "source": [ "The [wrapper package](https://3sconsult.github.io/sir3stoolkit/references/sir3stoolkit.core.html#sir3stoolkit.core.wrapper.Initialize_Toolkit) has to be initialized with reference to a SIR 3S (SirGraf) installation." ] }, { "cell_type": "code", "execution_count": 19, "id": "7540fe7b", "metadata": {}, "outputs": [], "source": [ "wrapper.Initialize_Toolkit(SIR3S_SIRGRAF_DIR)" ] }, { "cell_type": "markdown", "id": "0352dd43", "metadata": {}, "source": [ "## Initialization" ] }, { "cell_type": "markdown", "id": "e14ffe06", "metadata": {}, "source": [ "The SIR 3S Toolkit contains two classes: [SIR3S_Model](https://3sconsult.github.io/sir3stoolkit/references/sir3stoolkit.core.html#sir3stoolkit.core.wrapper.SIR3S_Model) (model and data) and [SIR3S_View](https://3sconsult.github.io/sir3stoolkit/references/sir3stoolkit.core.html#sir3stoolkit.core.wrapper.SIR3S_View) (depiction in SirGraf). All SIR 3S Toolkit functionality is accessed via the methods of these classes. In this line of tutorials (0-49) we focus on SIR3S_Model" ] }, { "cell_type": "code", "execution_count": 20, "id": "7e40a5af", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialization complete\n" ] } ], "source": [ "s3s = wrapper.SIR3S_Model()" ] }, { "cell_type": "code", "execution_count": 21, "id": "3770c93f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialization complete\n" ] } ], "source": [ "s3s_view = wrapper.SIR3S_View()" ] }, { "cell_type": "markdown", "id": "18aa477e", "metadata": {}, "source": [ "__Next__: Tutorial 2: Creating a new or opening an existing SIR 3S Model" ] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.8" } }, "nbformat": 4, "nbformat_minor": 5 }