<commit_before># Installation

The workshop will have workstations available in the CTCMS with a
correctly configured scientific Python environment already
installed. However, it is often preferable to use one's own laptop,
with your favored software and development environment. I much prefer
this. If you have experience with scientific Python, you probably
already have a satisfactory Python environment, which won't need many
alterations. Just skip over the
[Anaconda Python section](#anaconda-python) and install the packages
in the [Regular Python section](#regular-python).

## Anaconda Python 

If you have no experience with scientific Python, I would highly
recommend using the
[Anaconda Python distribution](https://store.continuum.io/cshop/anaconda/),

https://store.continuum.io/cshop/anaconda/

I believe that it "just works" on all platforms and has mostly
everything included. Just follow the instructions for your
platform. To test whether Anaconda is working try

    $ python
    Python 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18) 
    ...
    >>> 1 + 1
    2
    >>> import numpy; numpy.__file__
    '/home/wd15/anaconda/lib/python2.7/site-packages/numpy/__init__.pyc'
    
and check that you are actually using Anaconda's Python. Then update Anaconda,

    $ conda update conda
    
Once Anaconda has updated, install the following.

    $ conda install ez_setup
    $ conda install fipy
    $ conda install scikit-learn
    $ conda install numexpr

## Regular Python

Install the following (if you are not using Anaconda). If you are a
seasoned Python user you probably have most of these, but you might
want to update them anyway, just use `pip install package --upgrade`.

    $ pip install ipython
    $ pip install numpy
    $ pip install scipy
    $ pip install matplotlib
    $ pip install scikit-learn
    $ pip install ez_setup
    $ pip install fipy
    $ pip install scikit-learn
    $ pip install line_profiler
    $ pip install numexpr

## FFTW

The main requirement for `pyfftw` is FFTW3, which can be installed
via,

    $ sudo apt-get install libfftw3-dev
    
on Debian/Ubuntu. Windows and Mac users should consult

https://github.com/hgomersall/pyFFTW#platform-specific-build-info

Once this is installed, do

    $ pip install pyfftw
    
If you have issues with `pyfftw` and can't install it, don't
worry. Most of the notebooks do not require it and those that do are
easily modified to work with `numpy.fft`. We can also try and get this
working during the tutorial.

## `line_profiler`

One additional package is `line_profiler`. Unfortunately, this has an issue when installing with

    $ pip install line_profiler
    
If will throw an error. To install it, go to

https://pypi.python.org/pypi/line_profiler

and download and install the package by hand (rather than using
pip). If you have issues, we can get this working during the tutorial.

## Git

You'll need to use Git to clone the Github
[`pymks`](https://github.com/wd15/pymks) repository. There are Github
GUI style clients for both [Mac](http://mac.github.com/) and
[Windows](http://windows.github.com/). See,

https://help.github.com/articles/set-up-git
    
for help.

## Install the `pymks` module

Once you have Git installed, all you need to do is clone the
repository. At the command line this would be

    $ git clone https://github.com/wd15/pymks.git

The above should create a `pymks` directory with a working copy of the
repository. Next install `pymks` at the command line with,
<commit_msg>Installation has more detailed `line_profiler` instructions.<commit_after># Installation

The workshop will have workstations available in the CTCMS with a
correctly configured scientific Python environment already
installed. However, it is often preferable to use one's own laptop,
with your favored software and development environment. I much prefer
this. If you have experience with scientific Python, you probably
already have a satisfactory Python environment, which won't need many
alterations. Just skip over the
[Anaconda Python section](#anaconda-python) and install the packages
in the [Regular Python section](#regular-python).

## Anaconda Python 

If you have no experience with scientific Python, I would highly
recommend using the
[Anaconda Python distribution](https://store.continuum.io/cshop/anaconda/),

https://store.continuum.io/cshop/anaconda/

I believe that it "just works" on all platforms and has mostly
everything included. Just follow the instructions for your
platform. To test whether Anaconda is working try

    $ python
    Python 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18) 
    ...
    >>> 1 + 1
    2
    >>> import numpy; numpy.__file__
    '/home/wd15/anaconda/lib/python2.7/site-packages/numpy/__init__.pyc'
    
and check that you are actually using Anaconda's Python. Then update Anaconda,

    $ conda update conda
    
Once Anaconda has updated, install the following.

    $ conda install ez_setup
    $ conda install fipy
    $ conda install scikit-learn
    $ conda install numexpr

## Regular Python

Install the following (if you are not using Anaconda). If you are a
seasoned Python user you probably have most of these, but you might
want to update them anyway, just use `pip install package --upgrade`.

    $ pip install ipython
    $ pip install numpy
    $ pip install scipy
    $ pip install matplotlib
    $ pip install scikit-learn
    $ pip install ez_setup
    $ pip install fipy
    $ pip install scikit-learn
    $ pip install numexpr

## FFTW

The main requirement for `pyfftw` is FFTW3, which can be installed
via,

    $ sudo apt-get install libfftw3-dev
    
on Debian/Ubuntu. Windows and Mac users should consult

https://github.com/hgomersall/pyFFTW#platform-specific-build-info

Once this is installed, do

    $ pip install pyfftw
    
If you have issues installing the FFTW3 requirement, don't worry. Most
of the notebooks do not require it and those that do are easily
modified to work with `numpy.fft`. We can also try and make this work
during the tutorial session.

## `line_profiler`

One additional package is `line_profiler`. Unfortunately, this has an
issue when installing with

    $ pip install line_profiler
    
If will throw an error. To install it, go to

https://pypi.python.org/pypi/line_profiler

and download and install the package by hand (rather than using
pip). On Windows, just run the `.exe` installer. On Mac and Linux,
just get the `.tar.gz` unpack it, change to the base directory and run
`python setup.py install`.

## Git

You'll need to use Git to clone the Github
[`pymks`](https://github.com/wd15/pymks) repository. There are Github
GUI style clients for both [Mac](http://mac.github.com/) and
[Windows](http://windows.github.com/). See,

https://help.github.com/articles/set-up-git
    
for help.

## Install the `pymks` module

Once you have Git installed, all you need to do is clone the
repository. At the command line this would be

    $ git clone https://github.com/wd15/pymks.git

The above should create a `pymks` directory with a working copy of the
repository. Next install `pymks` at the command line with,

{'fraction_non_alphanumeric': 0.07303135888501743, 'fraction_numerical': 0.009337979094076656, 'mean_word_length': 3.6840731070496084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '713089', 'n_tokens_mistral': 2165, 'n_tokens_neox': 2049, 'n_words': 916}