{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Usage example of loading a specification model and creating a parametrized geometry from it.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pprint\n\nimport mmbse_client as mmbse\n\n# Specify variables\nsystem_id = 41\nspecification_model = \"Specification\"\nmodel_name = \"2D iron yoke\"\n\n# Load the Geometry model\nmmbse = mmbse.MMBSE(api_token=\"\")\nsystem = mmbse.get_system(system_id)\nmodel = mmbse.get_system_model(system_id, model_name)\n\n# Get specification from Specification model\nassert any(\n dependency[\"name\"] == \"Specification\" for dependency in model[\"input_dependencies\"]\n)\nspec_model = mmbse.get_system_model(system_id, \"Specification\")\npprint.pprint(spec_model)\n\n# Retrieve parameters from the specification model\noutput_parameters = mmbse.get_model_output_parameter_list(spec_model[\"id\"])\nprint(f\"Rref: {output_parameters['Rref']}\")" ] } ], "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.9.18" } }, "nbformat": 4, "nbformat_minor": 0 }