Style Guide

Table of Contents

Definitions

Certain text will be defined with special font when discussed within a body of text. The following table illustrates the definitions:

Definition Example
Data UNDEFINED
Function get2dmarkerat()
Arguments filename
Class RunFile
Exception ModelError
Filename samp15.dat

Arguments, when used within a square brackets ([]), are defined as optional.

Sample Definitions

In addition, there will be definitions of various functions, classes and exceptions used throughout the documentation. Some examples of the definitions are as follows,

UNDEFINED
The value used to mark a particular model cell's item as not used.
get2dmarkerat(index)

Retrieves a 2d marker from the geometry MSR.

Argument:

index : integer
index into the list of internal markers.

Returns (list) the marker at the given index.

ispointcoincident(p1, p2 [,epsilon])

Indicates if two points are nearly the same (within a given EPSILON).

Two points are compared on an element by element basis. That is they the points are deemed coincident if they satisfy,

(|x1-x2| < epsilon) and (|y1-y2| < epsilon) and (|z1-z2| < epsilon)

Arguments:

p1 : list
a point, defined as a list [x, y, z].
p2 : list
another point, defined as a list [x, y, z].
epsilon : float
the tolerance that decides the level of equality such that: |x1-x2| < epsilon.

Returns (integer) 1 if both points are equal; 0 otherwise.

class RunFile
File like object that makes runfile composition easier.
exception ModelError
Generated when a model is unable to complete a requested action.

A code block will be defined as follows,

pit1path = os.path.join(datamanager.ROOT, "phase2", "pit1")

References

References will be done in the standard MLA style. References to external hyperlink pages will be, generally, of the form,

Author. "Name of page." Name of Site. Date of Page. Date Accessed. <hyperlink>.

If a particular field is missing, it may be omitted from the overall reference. For example, site often do not have a single author, in that case you may omit the author from the reference.

An example would be something like,

"os.path -- Common pathname manipulations." Python Library Reference. 21 December 2001. 11 May 2004. <http://www.python.org/doc/2.2/lib/module-os.path.html>