{ "cells": [ { "cell_type": "markdown", "id": "55ec15f1", "metadata": {}, "source": [ "## Working with Reports\n", "For the use case, where you are using basico to prepare files to run later (say on a cluster environment or such). It is often useful to manipulate the report definitions we store in COPASI files. This notebook demonstrate to work with them. Lets just start by importing basico." ] }, { "cell_type": "code", "execution_count": 1, "id": "b3ca70fe", "metadata": {}, "outputs": [], "source": [ "from basico import *" ] }, { "cell_type": "markdown", "id": "4f167b1f", "metadata": {}, "source": [ "here we simply load the brusselator example: " ] }, { "cell_type": "code", "execution_count": 2, "id": "225be197", "metadata": {}, "outputs": [], "source": [ "load_example('brusselator');" ] }, { "cell_type": "markdown", "id": "cd284f99", "metadata": {}, "source": [ "### Retrieving Report Definitions\n", "The first function to look into is `get_reports` which will retrieve all report definition encoded in the file and returns its content as a data frame. You can filter by name, task or whether or not the reports is an automatically generated one. So while the following line reports there are 11 reports in the model, we can ignore them if we so choose (hence not getting a result printed at the end)" ] }, { "cell_type": "code", "execution_count": 3, "id": "e10e0996", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "there are 11 reports in the model\n" ] } ], "source": [ "print('there are {0} reports in the model'.format(len(get_reports())))\n", "get_reports(ignore_automatic=True)" ] }, { "cell_type": "markdown", "id": "1c7c4362", "metadata": {}, "source": [ "lets look at the reports that apply to steady state tasks:" ] }, { "cell_type": "code", "execution_count": 4, "id": "4b023a76", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | separator | \n", "precision | \n", "task | \n", "comment | \n", "is_table | \n", "header | \n", "body | \n", "footer | \n", "
|---|---|---|---|---|---|---|---|---|
| name | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| Steady-State | \n", "\\t | \n", "6 | \n", "Steady-State | \n", "<body xmlns=\"http://www.w3.org/1999/xhtml\">\\n ... | \n", "False | \n", "[] | \n", "[] | \n", "[CN=Root,Vector=TaskList[Steady-State]] | \n", "