{ "cells": [ { "cell_type": "markdown", "id": "8309631d", "metadata": {}, "source": [ "# Fitting post processing\n", "\n", "In this notebook it is demonstrated how to work with the result file generated by the fitter\n", "\n", "Diagnostic plotting is shown, as well as the construction of deviation plots, and so on\n", "\n", "General notes:\n", " \n", "* To keep the approach flexible, each of the plotting routines assumes that an axis is already prepared for plotting. This allows you to make complex grids of axes and plot different things (different model results) in each axis.\n", "* For other plots that do not generalize as easily, example plots are shown demonstrating the workflow generally" ] }, { "cell_type": "code", "execution_count": 1, "id": "b02bfa8c", "metadata": { "execution": { "iopub.execute_input": "2024-12-19T00:50:05.035989Z", "iopub.status.busy": "2024-12-19T00:50:05.035516Z", "iopub.status.idle": "2024-12-19T00:50:09.930394Z", "shell.execute_reply": "2024-12-19T00:50:09.929717Z" } }, "outputs": [ { "data": { "text/plain": [ "['index.rst',\n", " 'runc709530e-e431-11ed-b7b3-8e94f88bf11a.tar.xz',\n", " 'FittingPostProcessingPlotting.ipynb']" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "import matplotlib.pyplot as plt\n", "from temo.analyze.plotting import ModelAssessmentPlotter, PairMinFilter, ResultsParser\n", "\n", "from temo.fit.cost_contributions import calc_errrho\n", "from temo.fit.data_loaders import _density_processing, only_the_fluids\n", "import CoolProp.CoolProp as CP\n", "\n", "# Files in this folder, make sure we have the desired fitting result file\n", "os.listdir()" ] }, { "cell_type": "code", "execution_count": 2, "id": "5ab05d32", "metadata": { "execution": { "iopub.execute_input": "2024-12-19T00:50:09.932560Z", "iopub.status.busy": "2024-12-19T00:50:09.932220Z", "iopub.status.idle": "2024-12-19T00:50:09.977652Z", "shell.execute_reply": "2024-12-19T00:50:09.977124Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "./c709cf8c-e431-11ed-b7b3-8e94f88bf11a.json\n" ] }, { "data": { "text/html": [ "
| \n", " | model | \n", "cost | \n", "pair | \n", "Ndep | \n", "uid | \n", "bounds | \n", "mutant_kwargs | \n", "x | \n", "elapsed / s | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "{'0': {'1': {'BIP': {'Fij': 1.0, 'betaT': 1.00... | \n", "1.003476 | \n", "[R32, R1234YF] | \n", "3 | \n", "c709cf8c-e431-11ed-b7b3-8e94f88bf11a | \n", "[[0.75, 1.25], [0.75, 1.25], [0.75, 1.25], [0.... | \n", "{'Npoly': 3, 'Ngaussian': 0, 'd': [1, 1, 1], '... | \n", "[1.0063665465492047, 0.9590637406962529, 0.998... | \n", "342.416965 | \n", "