{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Importing Freud\n", "\n", "In order to use Freud in a Python script or application, you must first import freud. [See the python tutorial](https://docs.python.org/3/tutorial/modules.html) for importing basics.\n", "\n", "## Importing Freud as its own module\n", "\n", "The following code imports freud as a module to the current python namespace. When importing this way, you must prefix all commands with `freud.*` (where `*` is the class/command/etc)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import freud" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Importing all modules from Freud\n", "\n", "It's also common to import all modules from Freud into the current namespace. If you do this, you do not need to add the `freud.` prefix to your command." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from freud import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Importing packages\n", "\n", "You can also import individual packages, use shorthand, etc." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from freud import parallel\n", "import freud.pmft\n", "from freud import box as fbox" ] } ], "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.5.1" } }, "nbformat": 4, "nbformat_minor": 0 }