%
% This LaTeX file contains a tutorial on the preliminary steps needed to get
% a user's UNIX environment set up for working with the MLX python schema
%

\documentclass[11pt]{article}
\usepackage{html, makeidx, amssymb, graphicx, xspace}

\title{Preliminaries}
\author{Written by Lucas Scharenbroich \\ 
JPL Machine Learning Systems Group \\
Copyright 2002, California Institute of Technology. \\
ALL RIGHTS RESERVED.  U.S. Government Sponsorship acknowledged}

\begin{document}

\maketitle
\tableofcontents

\newpage

\section{Checking out from CVS}

On the woldlab servers, the MLX source repository live in \verb|/proj/code|.  If you are directly using the schema and have no desire to work on the source code, you may skip to Starting up the python interpreter.

Work locally with CVS, one need only define the \verb|CVSROOT| environment variable and export it to the shell.  The \verb|CVSROOT| defines where to tip of the repository lives.  Since our code is in \verb|/proj/code|, the CVS repository is in \verb|/proj/CVS|.  Thus, we need to set our \verb|CVSROOT| to \verb|/proj/CVS|.  In bash the command is

\begin{verbatim}
export CVSROOT=/proj/CVS/
\end{verbatim}

In csh, 
\begin{verbatim}
setenv CVSROOT /proj/CVS/
\end{verbatim}

Now that the CVSROOT path is set, create a directory in which to check out your copy of the code.  A good place might be \verb|~/checkout/| which will place the checked out code in a directory called \verb|checkout| in your home directory.  Whatever directory you decide on, lets call it \verb|LOCALCODE|

To actually check out a copy of the code, \verb|cd| to the directory you created (\verb|cd $LOCALCODE|) and execute the command

\begin{verbatim}
cvs co code 
\end{verbatim}

This will check out the entire source code directory which is ~60MB.  If you are only interested in a portion of the CVS repository, perform something similar to the following

\begin{verbatim}
cvs co code/python/mls
\end{verbatim}

This will only checkout the code under the \verb|code/python/mls| subdirectory.  This corresponds to all the python code in MLX.

\begin{verbatim}
cvs update
cvs log
cvs diff
cvs update
\end{verbatim}

Please refer to the CVS resource below for more information on these command.  And remember, {\bf always} do an \verb|update| before a \verb|commit|.

A good CVS resource is the \htmladdnormallink{cvshome.org}{http://www.cvshome.org} website.

\section{Starting the Python interpreter}

The python interpreter is started by simply invoking the command

\begin{verbatim}
python
\end{verbatim}

from the command line.  For the MLX code base to work, be sure you are using python 2.1 or greater.  The python interpreter prints out its version number of startup, so you should see something similar to the following:

\begin{verbatim}
bash-2.05a$ python
Python 2.1 (#4, Nov 16 2001, 11:19:13) 
[GCC 2.95.4 20011006 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 
\end{verbatim}

The string \verb|Python 2.1| indicates we are using version 2.1 of the interpreter.  If the version string says \verb|Python 2.0| or \verb|Python 1.5| you will not be able to use the MLX schema.

Once you are sure that you are using the correct version of python, the next step is to point python to the location of the MLX classes.  This is done by setting the \verb|PYTHONPATH| environment variable.  This is similar to the \verb|CLASSPATH| variable for java interpeters.

If you are currently in the python interpreter (\verb|>>>| prompt), press ctrl-D to exit back to the shell.  If you did not check out a local code of the source code from CVS, set \verb|PYTHONPATH| to \verb|/proj/code/python|.  In bash:

\begin{verbatim}
export PYTHONPATH=/proj/code/python/
\end{verbatim}

In csh:

\begin{verbatim}
setenv PYTHONPATH /proj/code/python/
\end{verbatim}

If you {\it did} check out a local copy, you will need to set your path to \verb|$LOCALCODE/code/python/|.  Again, in bash:

\begin{verbatim}
export PYTHONPATH=$LOCALCODE/code/python/
\end{verbatim}

In csh:

\begin{verbatim}
setenv PYTHONPATH $LOCALCODE/code/python/
\end{verbatim}

Now start up python again (by typing \verb|python| at the command line) and type the following command

\begin{verbatim}
>>> from compClust.mlx.datasets import Dataset
\end{verbatim}

If there is no error, you have set up the python environment correctly.  If the interpreter complains that it cannot find \verb|mlx.datasets| please review the instruction to ensure that you did not miss anything.

For a complete python reference, go to our \htmladdnormallink{local copy}{http://woldlab.caltech.edu/docs/python}.

\end{document}















