{ "cells": [ { "cell_type": "markdown", "id": "9414b5c6-69f6-4caa-b776-a51999830609", "metadata": {}, "source": [ "# How-to: Convert a `ttim` model to `timflow`\n", "\n", "Conversion of a `ttim` model to a `timflow` model only requires a few minor changes. " ] }, { "cell_type": "markdown", "id": "bb3ee149-cb66-4eeb-97d3-c3acd9ed8c2a", "metadata": {}, "source": [ "## The `import` statement\n", "The `timflow.transient` model is essentially the same as `ttim`. \n", "So all that is required is to change the import statement. \n", "For example, if your model imports `ttim` as\n", "\n", "```import ttim```\n", "\n", "and you don't want to make any other changes to your model, then replace the import statement by\n", "\n", "```from timflow import transient as ttim```\n", "\n", "or, if you like that better\n", "\n", "```import timflow.transient as ttim```\n", "\n", "If you used a different name in your original model, then make sure to use the same name in the `timflow` model. So if your import statement was\n", "\n", "```import ttim as ttm```\n", "\n", "then replace it by\n", "\n", "```import timflow.transient as ttm```\n", "\n", "Note: The docs of `timflow` use the three-letter abbreviation `tft` (for **t**im**f**low **t**ransient) for the transient model." ] }, { "cell_type": "markdown", "id": "3809e6e4-2ae7-4dd1-8b2f-990b33ff2f72", "metadata": {}, "source": [ "## Combining two or more plot statements on the same graph" ] }, { "cell_type": "markdown", "id": "a7a1d702-6c53-463d-99aa-3479d270e7a2", "metadata": {}, "source": [ "All plotting commands in `timflow` are gathered in the `plots` submodule. Each plotting command optionally takes an axis as input. If no axis is provided, then a new plot is created. Each plotting command returns the axis to which is plots. When you issue multiple plotting commands in a row, then make sure that the axis created by the first plotting command is passed on to the second plotting command. For more details, see the `howto_convert_timml_model.ipynb` in the `steady` documentation." ] }, { "cell_type": "markdown", "id": "4ee57d7d-84f0-4a45-9d0a-7279ddf55304", "metadata": {}, "source": [ "### Renaming of line-sink elements\n", "\n", "The line elements in `timflow.transient` have been renamed to coincide with the line element names in `timflow.steady`. The old ones still work, but you will get a deprecation warning. These are the changes:\n", "* `HeadLineSink` -> `River`\n", "* `HeadLineSinkString` -> `RiverString`\n", "* `LineSinkDitch` -> `Ditch`\n", "* `LineSinkDitchString` -> `DitchString`\n", "* `LeakyLineDoublet` -> `LeakyWall` (these can also be impermeable by specifing `res=\"imp\"` for the resistance)\n", "* `LeakyLineDoubletString` -> `LeakyWallString`" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }