diff options
author | Blaise Thompson <blaise@untzag.com> | 2018-03-12 16:43:35 -0500 |
---|---|---|
committer | Blaise Thompson <blaise@untzag.com> | 2018-03-12 16:43:35 -0500 |
commit | 86dcec5fc7fb9d6a8b5d4617d5eecaa1e59c0fb4 (patch) | |
tree | 0a2ddcc798b9e7cdb577bcde8af27c78b643c6a0 /processing | |
parent | b298788e63ea530f11ce64870d29fe91eafdb9af (diff) |
2018-03-12 16:43
Diffstat (limited to 'processing')
-rw-r--r-- | processing/chapter.tex | 87 |
1 files changed, 53 insertions, 34 deletions
diff --git a/processing/chapter.tex b/processing/chapter.tex index 9d50bac..a1967c9 100644 --- a/processing/chapter.tex +++ b/processing/chapter.tex @@ -2,6 +2,8 @@ % TODO: cool quote, if I can think of one
+\clearpage
+
From a data science perspective, CMDS has several unique challenges:
\begin{ditemize}
\item Dimensionality of datasets can typically be greater than two, complicating
@@ -27,52 +29,69 @@ each multidimensional (or one-dimensional) spectra. % WrightTools is written in Python, and endeavors to have a ``pythonic'', explicit and ``natural''
application programming interface (API). %
To use WrightTools, simply import:
-
-\begin{minted}{python}
-import numpy as np
-
-def incmatrix(genl1,genl2):
- m = len(genl1)
- n = len(genl2)
- M = None #to become the incidence matrix
- VT = np.zeros((n*m,1), int) #dummy variable
-
- #compute the bitwise xor matrix
- M1 = bitxormatrix(genl1)
- M2 = np.triu(bitxormatrix(genl2),1)
-
- for i in range(m-1):
- for j in range(i+1, m):
- [r,c] = np.where(M2 == M1[i,j])
- for k in range(len(r)):
- VT[(i)*n + r[k]] = 1;
- VT[(i)*n + c[k]] = 1;
- VT[(j)*n + r[k]] = 1;
- VT[(j)*n + c[k]] = 1;
-
- if M is None:
- M = np.copy(VT)
- else:
- M = np.concatenate((M, VT), 1)
-
- VT = np.zeros((n*m,1), int)
-
- return M
-\end{minted}
+\begin{codefragment}{python}
+>>> import WrightTools as wt
+>>> wt.__version__
+3.0.0
+\end{codefragment}
+I'll discuss more about how exactly WrightTools packaging, distribution, and instillation works in
+\autoref{sec:processing_distbribution}.
+
+We can use the builtin Python function \mintinline{python}{dir} to interrogate the contents of the
+WrightTools package. %
+\begin{codefragment}{python}
+>>> dir(wt)
+['Collection',
+ 'Data',
+ '__branch__',
+ '__builtins__',
+ '__cached__',
+ '__doc__',
+ '__file__',
+ '__loader__',
+ '__name__',
+ '__package__',
+ '__path__',
+ '__spec__',
+ '__version__',
+ '__wt5_version__',
+ '_dataset',
+ '_group',
+ '_open',
+ '_sys',
+ 'artists',
+ 'collection',
+ 'data',
+ 'diagrams',
+ 'exceptions',
+ 'kit',
+ 'open',
+ 'units']
+\end{codefragment}
+Many of these are dunder (double underscore) attributes---Python internals that are not normally
+used directly. %
+The ten attributes that do not start with underscore are the public API that users of WrightTools
+typically use. %
+Within the public API are two classes, \mintinline{python}{Collection} \&
+\mintinline{python}{Data}, which are the two main classes in the WrightTools object model. %
+\mintinline{python}{Data} stores spectra directly as multidimensional arrays, and
+\mintinline{python}{Collection} stores \textit{groups} of data objects (and other collection
+objects) in a hierarchical way for internal organization purposes. %
\subsubsection{wt5 file format} % ----------------------------------------------------------------
\section{Artists} % ==============================================================================
+\subsection{Colormaps} % -------------------------------------------------------------------------
+\subsection{Interpolation} % ---------------------------------------------------------------------
\section{Fitting} % ==============================================================================
-\section{Distribution and licensing} % ===========================================================
-
+\section{Distribution and licensing} \label{sec:processing_disbribution} % =======================
\section{Future directions} % ====================================================================
\ No newline at end of file |