#!/usr/bin/env python # coding: utf-8 # #
# #

#

Jonathan J. Helmus, Ph.D. #

#

#

ChiPy

#

August 13, 2015

#
# # ## About Me # # # # * Scientist and software developer at Argonne National Laboratory. # * User of the Scientific Python stack # * NumPy, SciPy, matplotlib, etc. # * Lead developer of Py-ART an open source package for working with weather radar data. # # # ## conda # # * Cross-platform **package** and **environment** management system # * Written by Continuum Analytics # * Open source, BSD license # * Created for Python programs but can package and manage any software. # * Does not require administator privileges. # ## conda : the package manager # # Conda is a cross platform package manager which installs binary conda packages. # In[ ]: # On mac python import numpy conda --help conda list # not much installed conda install scipy # notice dependency resolution conda insall matplotlib ipython conda install pandas # notice that version 0.16.2 installed conda remove pandas conda install pandas=0.14 conda list # not much installed ipython import pandas pandas.__version__ # 0.14.1 conda update pandas ipython import pandas pandas.__version__ # 0.16.2 # In[ ]: # On Windows in the ChiPy environment pip install numpy # Visual C++ what, what what... conda install numpy conda install scipy matplotlib ipython ipython --pylab import numpy import scipy plot(sin(linspace(-pi, pi))) # # * **conda install** : Install a package # * **conda remove** : Remove a package # * **conda update** : Update a package # * **conda list** : List packages installed # ## conda : the environment manager # # Conda can create isolated environments that have their own # set of installed and managed packages. # In[ ]: # source deactivate conda create --name chipy_py27 python=2.7 # who likes Python 2.7 source activate chipy_py27 python >>> 5 / 2 # 2...wait >>> 1 / 2 # 0 >>> round(1.2) 1.0 conda install numpy python import numpy numpy.__version__ soure deactivate conda create -n chipy_py34 python=3.4 numpy=1.7 # fail conda create -n chipy_py34 python=3.4 numpy=1.8 source activate chipy_py34 python >>> 5 / 2 # 2.5 better >>> 1 / 2 # 0.5 >>> round(1.2) 1 type(round(1.2)) numpy.__version__ # 1.8.2 # * **conda create** : Create a new conda environment # * **source activate** : Activate a conda enviroment # * **source deactivate** : Deactivate the current conda enviroment # # Packages are hard linked into the enviroment to save disk space. # ## Finding conda packages # # Conda can search for packages from the repository provided by Continuum as well as packages created by users and shared on Anaconda.org # In[ ]: conda search basemap conda search cartopy conda server search cartopy anaconda show shoyer/cartopy # Search on Anaconda.org # * **conda search** : Search for packages in the Continuum repository. # * **anaconda search** : Search for user created packages on Anaconda.org # ## Creating and sharing conda packages # # Conda packages can be built from a recipe and shared on Anaconda.org # In[ ]: cd recipe/pyart cd .. conda build pyart # * **conda build** : Build a conda package from a recipe # * **anaconda upload** : Upload a package to Anaconda.org # In[ ]: anaconda search pyart anaconda show jjhelmus/pyart conda create -n radar_fun python=2.7 source activate radar_fun conda install --channel https://conda.anaconda.org/jjhelmus pyart conda install ipython basemap ipython --pylab import urllib import pyart url = 'ftp://tgftp.nws.noaa.gov/SL.us008001/DF.of/DC.radar/DS.p19r0/SI.klot/sn.last' f = urllib.urlopen(url) radar = pyart.io.read_nexrad_level3(f) display = pyart.graph.RadarMapDisplay(radar) display.plot_ppi_map('reflectivity', vmin=-32, vmax=80, cmap='pyart_NWSRef', resolution='c', embelish=False) display.basemap.drawcounties() draw() # ## How to get conda? # # Conda is available through Anaconda or Miniconda. It cannot be installed seperately. # # * **Anaconda** : Python distribution which includes Python, conda and a number of common scientific packages. # * **Miniconda** : Lightweight distribution, Python and conda only, which can be used to "bootstrap" a more complete Python environment. # # Both Anaconda and Miniconda install into a single directory. Try one out! You can always remove this directory to get back your original Python setup. #
# ## Thanks #

# ## Questions? #

#
# Jonathan J. Helmus, Ph.D. #

# jjhelmus@gmail.com #

# GitHub: jjhelmus #

# http://nmrglue.com/jhelmus # # In[ ]: