{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[](https://github.com/open-atmos/PyPartMC/blob/main/examples/hello_world.ipynb) \n", "[](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/hello_world.ipynb) (requires logging in with a Google account) \n", "[](https://mybinder.org/v2/gh/open-atmos/PyPartMC.git/main?urlpath=lab/tree/examples/hello_world.ipynb) \n", "[](https://jupyterhub.arm.gov/hub/user-redirect/git-pull?repo=https%3A//github.com/open-atmos/PyPartMC&branch=main&urlPath=) (requires [logging in with ARM account](https://www.arm.gov/capabilities/computing-resources) and directing Jupyter to a notebook within the cloned repo)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "iEavJeJoPWzg" }, "outputs": [], "source": [ "import sys\n", "import os\n", "if 'google.colab' in sys.modules:\n", " !pip --quiet install open-atmos-jupyter-utils\n", " from open_atmos_jupyter_utils import pip_install_on_colab\n", " pip_install_on_colab('PyPartMC')\n", "elif 'JUPYTER_IMAGE' in os.environ and '.arm.gov' in os.environ['JUPYTER_IMAGE']:\n", " !pip --quiet install PyPartMC\n", " _pypartmc_path = !pip show PyPartMC | fgrep Location | cut -f2 -d' '\n", " sys.path.extend(_pypartmc_path if _pypartmc_path[0] not in sys.path else [])" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "VnLSclLsOxRz" }, "outputs": [], "source": [ "import PyPartMC as ppmc" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "s2VeF72qPsKB" }, "outputs": [ { "data": { "text/plain": [ "16" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ppmc.pow2_above(13)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "I_kD6AomXW6h" }, "outputs": [], "source": [] } ], "metadata": { "colab": { "collapsed_sections": [], "name": "Untitled13.ipynb", "provenance": [] }, "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.1" } }, "nbformat": 4, "nbformat_minor": 1 }