{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The model book" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This example only requires the `foxes` package:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import foxes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `model book` contains all models that are selectable during a `foxes` run. They are organized according to their model type and stored under a `str` type key, i.e., the model name. The default constructor of the `ModelBook` class provides a number of default models, and the complete list can be printed using the `print_toc` function:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mbook = foxes.models.ModelBook()\n", "mbook.print_toc()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can simply add a model by storing the model object under the new model name, for example:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mbook.wake_models[\"my_Jensen\"] = foxes.models.wake_models.wind.JensenWake(\n", " k=0.042, superposition=\"ws_linear_lim\"\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mbook.print_toc(subset=\"wake_models\", search=\"Jensen\")" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Our freshly created model can now be found in the model book and is ready to use for calculations. Similarly, all other types of models can be added to the corresponding sections of the model book." ] } ], "metadata": { "kernelspec": { "display_name": "foxescf", "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.8.10" }, "vscode": { "interpreter": { "hash": "49e77450ac3b792529b8ec53c4156102ea20ff425b704a19d2a6ff376cdbc220" } } }, "nbformat": 4, "nbformat_minor": 2 }