{ "cells": [ { "cell_type": "markdown", "id": "da673a84", "metadata": {}, "source": [ "(attribute-table)=\n", "\n", "# Attributes" ] }, { "cell_type": "code", "execution_count": 1, "id": "aa64ea90", "metadata": { "tags": [ "remove-input", "full-width" ] }, "outputs": [ { "data": { "text/html": [ "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
indexObject typeAttribute namePython data typeCore data typeunitI/OLicenseVersion addedDescription
\n", "\n", "
\n", "Loading ITables v2.1.4 from the internet...\n", "(need help?)
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import itables as itables\n", "from itables import init_notebook_mode\n", "import itables.options as opt\n", "import pandas as pd\n", "from IPython.core.display import HTML\n", "\n", "opt.maxBytes = 0\n", "\n", "init_notebook_mode(all_interactive=True, connected=True)\n", "table = pd.read_csv('../attributes.csv').reset_index()\n", "core_type_dict = {'int' : 'integer','double':'float','string':'string','int_array':'list-of-integer-values','double_array':'list-of-double-values','xy':'table-xy-curve','xy_array':'list-of-tables','txy':'time-series','txy_stochastic':'stochastic-time-series'}\n", "for index, row in table.iterrows():\n", " table.at[index, \"Object type\"] = f\"\"\"{row['Object type']}\"\"\"\n", " table.at[index, \"Attribute name\"] = f\"\"\"{row['Attribute name']}\"\"\"\n", " table.at[index, \"Core data type\"] = f\"\"\"{row['Core data type']}\"\"\"\n", "itables.show(\n", " table,\n", " dom='tlip',\n", " column_filters='header',\n", " columns=[\n", " {\n", " 'name': '',\n", " 'className': 'dt-control',\n", " 'orderable': False,\n", " 'data': None,\n", " 'defaultContent': '',\n", " },\n", " {\n", " 'name': 'Object type',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'Attribute name',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'Python data type',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'Core data type',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'unit',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'I/O',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'License',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'Version added',\n", " 'className': 'dt-body-left'\n", " },\n", " {\n", " 'name': 'Description',\n", " 'visible': False\n", " }\n", " ]\n", ")\n", "\n", "HTML('''''')" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.13.8" } }, "kernelspec": { "display_name": "Python 3", "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.11.9" }, "source_map": [ 11, 17 ] }, "nbformat": 4, "nbformat_minor": 5 }