Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.
Rich Signell edited this page Mar 17, 2015 · 25 revisions

The IOOS Python Environment

The recipes here create conda packages useful to the IOOS community. These packages are shared with the community at Binstar.org.

For IOOS python users, we recommend the Anaconda Scientific Python Distribution as the easiest way to get all the custom packages needed to run the IOOS system tests.

Installation instructions (for Anaconda)

Testing the environment

  1. Grab this example notebook and this example notebook by opening the link, and then clicking the download button in the upper right to save the notebook to your computer.

  2. If you don't have the Anaconda launcher installed, type conda install launcher to install it.

  3. Click on the launcher icon to start the launcher application, or just type 'launcher'.

  4. From the Launcher, make sure that the ioos environment is selected, and then click the launch"button to the right of the ipython-notebook app. If you don't see the launch button, you need to click on install to install the app.

  5. Once the Notebook is launched, you should see a list of directories and files, and near the top, instructions for importing a notebook. Note that the Ipython Notebook has now changed it's name to Jupyter.

  6. Import the downloaded notebooks (I prefer to drag the downloaded notebook onto the Notebook list).

  7. In the Notebook, click on Cell=>All Output=>Clear to clear the existing output, and then Cell=>Run all to see if the output is recreated.

Customizing the notebook settings

  • if the IOOS environment is selected in the launcher, all applications you launch from there will have the IOOS environment. On a linux or mac terminal window, you can activate the ioos environment by typing source activate ioos and deactivate it by typing source deactivate. On windows, you can open an Anaconda command prompt (in the Anaconda programs folder) and type activate ioos to activate the ioos environment, or type deactivate to deactivate.

  • If you want to always have the notebook server start in the same location, you can go to the anaconda command prompt and type ipython profile create to create a default ipython notebook configuration file. You can then type ipython locate profile default to find out the directory where the configuration file was created. Go to this directory and edit the file ipython_notebook_config.py, setting the value of c.NotebookApp.notebook_dir.

On my system my line looks like this:

c.NotebookApp.notebook_dir = u'C:\\users\\rsignell\\documents\\github\\notebook'
  • If you want to track your notebooks on github, you might want to set up the notebook server to create regular .py python versions of your notebooks (in addition to the .ipynb format that gets saved by default). The instructions for this are here: http://stackoverflow.com/a/25765194/2005869

Additional information on why we suggest Anaconda

Anaconda users can just conda install, which installs not only binary packages for their platform, but the binary libraries they depend on. So it's easier than pip install and, thanks to binary relocation, more powerful than python wheels. System-level installation of libraries and admin privileges are not required. Check out Travis Oliphant's blog piece for more info.

The recipes here are automatically built using Travis-CI with the assistance of Obvious-CI.

Some bugs, like hard-coded paths, might surface when using these packages. If you encounter one, raise an issue.

Some bullets points:

  • The numpy version is controlled by the environment variable CONDA_NPY (e.g.: export CONDA_NPY=18).
  • The python version is controlled by the environment variable CONDA_PY (e.g.: export CONDA_PY=27).
  • When rebuilding something with the same version we need to increment the build number in the meta.yaml. That will ensure the installation of the new version, rather than just what is sitting around in their cache.
  • To avoid the package cache we can add a -f to the install to force downloading, like: conda install iris -f
  • There is no need for subdirs like np18py27.
  • conda build iris will automatically build all the other dependencies (biggus, pyke, cartopy) if it finds a recipe for the requirement at the same directory level.
  • That is a strong incentive to set: conda config --set binstar_upload yes and have all packages uploaded with one "build".
Clone this wiki locally