{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Running Simulations from the Commandline\n", "\n", "All inputs are specified in YAML configuration files.\n", "\n", "Example makes are run on the command line within jupyter (using [system magic](https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-system) via `!`)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Help" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# display help \n", "! ctwrap --help" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# help of subcommand 'list'\n", "! ctwrap list --help" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# list available modules\n", "! ctwrap list" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# help of subcommand 'run'\n", "! ctwrap run --help" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## `minimal` Module\n", "\n", "This example uses the YAML configuration file `yaml/minimal.yaml`, which specifies \n", "two batch strategies (`sequence` and `matrix`)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%time\n", "# run minimal module (with 'sequence' strategy)\n", "! ctwrap run minimal minimal.yaml --strategy sequence" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%time\n", "# run minimal module in parallel (with 'matrix' strategy)\n", "! ctwrap run minimal minimal.yaml --parallel --strategy matrix" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## `solution` Module\n", "\n", "This example uses the YAML configuration file `yaml/solution.yaml`, which queries\n", "a Cantera `Solution` object at a range of temperatures." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%time\n", "# run parameter variation using multiple cores (if made available)\n", "! ctwrap run solution solution.yaml -v --parallel --output solution_example.csv" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# delete output file\n", "! rm solution_example.csv" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.8" } }, "nbformat": 4, "nbformat_minor": 2 }