aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2018-03-12 16:43:35 -0500
committerBlaise Thompson <blaise@untzag.com>2018-03-12 16:43:35 -0500
commit86dcec5fc7fb9d6a8b5d4617d5eecaa1e59c0fb4 (patch)
tree0a2ddcc798b9e7cdb577bcde8af27c78b643c6a0
parentb298788e63ea530f11ce64870d29fe91eafdb9af (diff)
2018-03-12 16:43
-rw-r--r--.gitignore1
-rwxr-xr-xbuild.sh2
-rw-r--r--dissertation.cls37
-rw-r--r--dissertation.pdfbin34267376 -> 34299047 bytes
-rw-r--r--processing/chapter.tex87
5 files changed, 84 insertions, 43 deletions
diff --git a/.gitignore b/.gitignore
index 2a47b98..8e9e032 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
*.fot
*.cb
*.cb2
+*.listing
## Intermediate documents:
*.dvi
diff --git a/build.sh b/build.sh
index f098933..bf0c5c0 100755
--- a/build.sh
+++ b/build.sh
@@ -27,7 +27,7 @@ if [[ "$1" = "all" ]] || [[ "$1" = "data" ]] ; then
#printThenPython "data/TA A.py"
#printThenPython "data/TA B.py"
#printThenPython "data/TG A.py"
- #printThenPython "data/TG B.py"
+ #printThenPython "data/TG B.py"
fi
# make figures
diff --git a/dissertation.cls b/dissertation.cls
index 74cd49b..452057b 100644
--- a/dissertation.cls
+++ b/dissertation.cls
@@ -10,7 +10,7 @@
\RequirePackage[letterpaper, margin=1in]{geometry} % 1 inch margins required
\RequirePackage{setspace}
\RequirePackage{afterpage}
-\RequirePackage{color}
+\RequirePackage{xcolor}
\RequirePackage{array}
% --- headers -------------------------------------------------------------------------------------
@@ -49,9 +49,6 @@
\newcommand{\dsignature}[1]{\hfill \normalfont{-- #1}}
-% THE FOLLOWING IS DARK MAGIC THAT I DON'T UNDERSTAND
-% I'M SURE I COULD DO BETTER...
-% - Blaise 2018-03-06
\RequirePackage[shortlabels]{enumitem}
\setlist[enumerate, 1]{nosep}
\setlist[enumerate, 2]{nosep, topsep=-5ex}
@@ -78,11 +75,35 @@
% --- code environment ----------------------------------------------------------------------------
\RequirePackage{etoolbox}
-\RequirePackage[chapter]{minted}
+\RequirePackage[section]{minted}
\usemintedstyle{colorfuli}
-\BeforeBeginEnvironment{minted}{\begin{singlespace}}
-\AfterEndEnvironment{minted}{\end{singlespace}}
-\setminted[python]{linenos=false, frame=lines}
+\setminted[python]{linenos=false, frame=none}
+
+\definecolor{bg}{rgb}{0.95,0.95,0.95}
+
+\setmintedinline[python]{bgcolor=bg}
+
+\RequirePackage[many]{tcolorbox}
+\tcbuselibrary{minted}
+
+\NewTCBListing{codefragment}{mo}{%
+ colback=bg,
+ boxrule=1pt,
+ colframe=bg,
+ arc=0,
+ shadow=false,
+ boxsep=1ex, top=0pt, left=0pt, right=0pt, bottom=0pt,
+ comment={\hfill(\arabic{chapter}.\arabic{equation})},
+ listing outside comment,
+ righthand width=2.5em,
+ sidebyside gap=0pt,
+ minted language=#1,
+ before skip =-0.5\baselinestretch,
+ after skip=2\baselinestretch,
+}
+
+\BeforeBeginEnvironment{codefragment}{\begin{singlespace}\stepcounter{equation}}
+\AfterEndEnvironment{codefragment}{\end{singlespace}}
% --- tables --------------------------------------------------------------------------------------
diff --git a/dissertation.pdf b/dissertation.pdf
index 228593d..3efe0c6 100644
--- a/dissertation.pdf
+++ b/dissertation.pdf
Binary files differ
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