Skip to content

Instantly share code, notes, and snippets.

@dayne
Last active August 1, 2017 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayne/c7e92783379cebf3b569023c58ba0cf5 to your computer and use it in GitHub Desktop.
Save dayne/c7e92783379cebf3b569023c58ba0cf5 to your computer and use it in GitHub Desktop.
mac-brewing_update notes for 2016 NSF polar hackathon

This document captured as part my version of the OSX setup steps for the NSF 2017 Polar Cyberinfrastructure Hackathon

  • dependancies as homebrew steps for OSX users
  • using the jupyter notebook with demo datasets in Docker

This document captured as part my version of the OSX setup steps for the NSF 2017 Polar Cyberinfrastructure Hackathon

Install Homebrew: https://brew.sh/

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

That should walk you through need to install Xcode and accept the license of Xcode xcode-select --install

Once installed you can start using brew to install binary packages and also compiling code.

brew install cask
brew cask install xquartz
brew tap homebrew/science
brew install r
brew cask install rstudio
brew install python3
brew cask install openrefine
brew cask install docker
brew cask install github-desktop
brew cask install atom

Create a hackathon dir in your home directory and download the demo datasets into a data directory there.

mkdir ~/hackathon/
cd ~/hackathon
curl -O http://swcarpentry.github.io/shell-novice/data/shell-novice-data.zip
curl -O http://swcarpentry.github.io/python-novice-inflammation/data/python-novice-inflammation-data.zip 
curl -O http://swcarpentry.github.io/python-novice-inflammation/code/python-novice-inflammation-code.zip 
for I in *.zip; do unzip $I; done

Pull down the scipy-notebook

docker pull jupyter/scipy-notebook

Run the notebook and attach home to your ~/hackathon dir

docker run -it --rm -p 8888:8888 -v ~/hackathon:/home/jovyan jupyter/scipy-notebook

Create a new notebook and start hacking

  • Open up the URL it provides inyour web browser.
  • Select 'notebooks' folder
  • Create a new Python3 notebook
    • New (top left) drop down -> Python3

Later on you might need:

docker ps # list out running docker processes and process names.

docker stop (process id of instance) # note: you can use just part of the name

Got your notebook.. might as well get it going
####
```
data - np.loadtt(fname="data/inflammation-01.csv", delimeter=',')
Print(data)
np.loadtxt?
print(data.dtype)
print(data.shape)
data[30,20]
print(data[:5,30:])
import time
time.ctime()
print(np.mean(data,axis=1)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment