{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "85550f14-d970-4f06-93b6-dd0e7268549c", "metadata": { "tags": [] }, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "id": "7829b981", "metadata": { "ExecuteTime": { "end_time": "2021-08-01T08:00:28.106024Z", "start_time": "2021-08-01T08:00:28.077001Z" }, "tags": [] }, "outputs": [], "source": [ "from pathlib import Path\n", "import sys\n", "\n", "sys.path.insert(0, str(Path(\"../..\").resolve()))" ] }, { "attachments": {}, "cell_type": "markdown", "id": "a0468a07", "metadata": { "tags": [] }, "source": [ "# Test notebook\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "4435bdfc-f315-4745-aacd-51ac8bf52ab8", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/plain": [ "'1.3.0'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import encomp\n", "\n", "encomp.__version__" ] }, { "cell_type": "code", "execution_count": 4, "id": "8261c700", "metadata": {}, "outputs": [], "source": [ "from encomp.units import Quantity as Q\n", "import polars as pl" ] }, { "cell_type": "code", "execution_count": 5, "id": "517392cc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Q(1, \"delta_degC\").check(Q(12, \"degC\").u)" ] }, { "cell_type": "code", "execution_count": 6, "id": "204b6454", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Q(1, \"degC\").check(Q(12, \"degF\").u)" ] }, { "cell_type": "code", "execution_count": 7, "id": "b048867b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "[([(dyn float: 25) * (col(\"T\"))]) * (dyn float: 1000)] g" ], "text/latex": [ "$[([(dyn float: 25) * (col(\"T\"))]) * (dyn float: 1000)]\\ \\mathrm{g}$" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(Q(25, \"kg/K\") * Q(pl.col.T, \"delta_degC\")).to(\"g\")" ] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "encomp (3.13.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.13.3" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }