{ "cells": [ { "cell_type": "markdown", "id": "f233bd54-261e-497a-9c91-f1b7a8031a70", "metadata": {}, "source": [ "# Notebook Name" ] }, { "cell_type": "markdown", "id": "be3ffea4-9cf2-4950-8f5a-b77c4d9d1210", "metadata": {}, "source": [ "Short description of example notebook for the Examples Page\n", "Additional information" ] }, { "cell_type": "markdown", "id": "f0e59897-8e57-4f82-857b-a8698a5748c4", "metadata": {}, "source": [ "# PT3S Release" ] }, { "cell_type": "code", "execution_count": 1, "id": "931e173f-f062-4a80-a56f-0d96d5c27092", "metadata": { "tags": [] }, "outputs": [], "source": [ "#pip install PT3S -U --no-deps" ] }, { "cell_type": "markdown", "id": "fcf2b2a3-cecb-4679-a0b0-983d2a147e44", "metadata": {}, "source": [ "# Necessary packages for this Example" ] }, { "cell_type": "raw", "id": "f37aa62b-ae29-42a1-8217-2498db422b36", "metadata": {}, "source": [ "When running this example for the first time on your machine, please execute the cell below. Afterward, you may need to restart the kernel (using the ‘fast-forward’ button)." ] }, { "cell_type": "code", "execution_count": 1, "id": "0730d039-0023-4545-9295-7e18a8a12dba", "metadata": {}, "outputs": [], "source": [ "#pip install - q ..." ] }, { "cell_type": "markdown", "id": "a2e6fbdc-5dd6-482b-a353-2b6f10e07aab", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 2, "id": "59415417-7808-4e32-a2a2-abcde79ff631", "metadata": {}, "outputs": [], "source": [ "import os\n", "import logging\n", "#...\n", "\n", "try:\n", " from PT3S import dxAndMxHelperFcts\n", "except:\n", " import dxAndMxHelperFcts\n", "#..." ] }, { "cell_type": "code", "execution_count": 3, "id": "0e412b0f-15a9-4d1b-9841-34a10e25b0b3", "metadata": { "tags": [] }, "outputs": [], "source": [ "import importlib" ] }, { "cell_type": "code", "execution_count": 4, "id": "8ead8811-6d1d-4376-88ba-8ac748284e77", "metadata": { "tags": [] }, "outputs": [], "source": [ "#importlib.reload(dxAndMxHelperFcts)" ] }, { "cell_type": "markdown", "id": "bd5882d4-eab8-4da6-8bbe-6776d4195dd2", "metadata": {}, "source": [ "# Logging" ] }, { "cell_type": "code", "execution_count": 5, "id": "852d5593-37d0-4ccb-be1f-29154bdc142f", "metadata": {}, "outputs": [], "source": [ "logger = logging.getLogger() \n", "\n", "logFileName= r\"ExampleX.log\" \n", "\n", "loglevel = logging.DEBUG\n", "logging.basicConfig(filename=logFileName\n", " ,filemode='w'\n", " ,level=loglevel\n", " ,format=\"%(asctime)s ; %(name)-60s ; %(levelname)-7s ; %(message)s\") \n", "\n", "fileHandler = logging.FileHandler(logFileName) \n", "\n", "logger.addHandler(fileHandler)\n", "\n", "consoleHandler = logging.StreamHandler()\n", "consoleHandler.setFormatter(logging.Formatter(\"%(levelname)-7s ; %(message)s\"))\n", "consoleHandler.setLevel(logging.INFO)\n", "logger.addHandler(consoleHandler)" ] }, { "cell_type": "markdown", "id": "1b34591a-c2d1-486b-b853-ed38cd5c8323", "metadata": {}, "source": [ "# Read Model and Results" ] }, { "cell_type": "code", "execution_count": 6, "id": "29b18b2c-f2df-4b27-a96c-0e03af6f16b0", "metadata": {}, "outputs": [], "source": [ "dbFilename=\"ExampleX\"\n", "dbFile=os.path.join(os.path.dirname(os.path.abspath(dxAndMxHelperFcts.__file__))\n", " +'/Examples/'\n", " +dbFilename\n", " +'.db3'\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "f8b5221c-0fd1-4fbc-abaf-81325ad2629d", "metadata": {}, "outputs": [], "source": [ "m=dxAndMxHelperFcts.readDxAndMx(dbFile=dbFile,preventPklDump=True,maxRecords=-1)" ] }, { "cell_type": "code", "execution_count": null, "id": "f3b64c76-17da-43e3-8562-5bdeec2a53c5", "metadata": {}, "outputs": [], "source": [ "#..." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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 }