mirror of
https://github.com/nwchemgit/nwchem.git
synced 2026-07-28 22:25:48 -04:00
Make bandit a mandatory test and fix some typos
This commit is contained in:
parent
370aaf701c
commit
4a7fa658bb
22 changed files with 69 additions and 69 deletions
|
|
@ -56,9 +56,9 @@ Features:
|
|||
Builtin PlotItem types:
|
||||
|
||||
* 'Data(array1)' -- data from a Python list or NumPy array
|
||||
(permits additional option 'cols' )
|
||||
(permits additional option 'cols')
|
||||
* 'File("filename")' -- data from an existing data file (permits
|
||||
additional option 'using' )
|
||||
additional option 'using')
|
||||
* 'Func("exp(4.0 * sin(x))")' -- functions (passed as a string
|
||||
for gnuplot to evaluate)
|
||||
* 'GridData(m, x, y)' -- data tabulated on a grid of (x,y) values
|
||||
|
|
@ -245,7 +245,7 @@ class Func(PlotItem):
|
|||
|
||||
gnuplot> plot sin(x)
|
||||
|
||||
The argument to the contructor is a string which is a expression.
|
||||
The argument to the constructor is a string which is a expression.
|
||||
Example:
|
||||
|
||||
g.plot(Func("sin(x)", with_="line 3"))
|
||||
|
|
@ -302,10 +302,10 @@ def write_array(f, set,
|
|||
A general recursive array writer. The last four parameters allow a
|
||||
great deal of freedom in choosing the output format of the
|
||||
array. The defaults for those parameters give output that is
|
||||
gnuplot-readable. But using, for example, ( ',', '{', '}', ',\\n'
|
||||
) would output an array in a format that Mathematica could
|
||||
read. item_sep should not contain '%' (or if it does, it should be
|
||||
escaped to '%%' ) since item_sep is put into a format string.
|
||||
gnuplot-readable. But using, for example, ( ',', '{', '}', ',\\n')
|
||||
would output an array in a format that Mathematica could read.
|
||||
item_sep should not contain '%' (or if it does, it should be
|
||||
escaped to '%%') since item_sep is put into a format string.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -398,7 +398,7 @@ class File(PlotItem):
|
|||
'<file>' can be either a string holding the filename of an
|
||||
existing file, or it can be an object of a class derived from
|
||||
'AnyFile' (such as a 'TempArrayFile'). Keyword arguments
|
||||
recognized (in addition to those recognized by 'PlotItem' ):
|
||||
recognized (in addition to those recognized by 'PlotItem'):
|
||||
|
||||
'using=<n>' -- plot that column against line number
|
||||
'using=<tuple>' -- plot using a:b:c:d etc.
|
||||
|
|
@ -611,7 +611,7 @@ class Gnuplot:
|
|||
options; a string, which is plotted as a Func; or
|
||||
anything else, which is plotted as a Data.
|
||||
'hardcopy' -- replot the plot to a postscript file (if filename
|
||||
argument is specified) or pipe it to lpr othewise.
|
||||
argument is specified) or pipe it to lpr otherwise.
|
||||
If the option `color' is set to true, then output
|
||||
color postscript.
|
||||
'replot' -- replot the old items, adding any arguments as
|
||||
|
|
@ -769,7 +769,7 @@ class Gnuplot:
|
|||
'splot(item, ...)' -- Clear the current plot and create a new
|
||||
3-d plot containing the specified items. Arguments can
|
||||
be of the following types:
|
||||
'PlotItem' (e.g., 'Data', 'File', 'Func', 'GridData' ) -- This
|
||||
'PlotItem' (e.g., 'Data', 'File', 'Func', 'GridData') -- This
|
||||
is the most flexible way to call plot because the
|
||||
PlotItems can contain suboptions. Moreover, PlotItems
|
||||
can be saved to variables so that their lifetime is
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import array
|
|||
|
||||
'''
|
||||
A simple class and helper functions to read and compute with a
|
||||
Guassian cube file as produced by NWChem with the DPLOT module.
|
||||
Gaussian cube file as produced by NWChem with the DPLOT module.
|
||||
It can read the file (or tabulate any function) and then compute the
|
||||
value at an arbitrary interior point using tri-linear interpolation.
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ def read_i_f_f_f(f):
|
|||
return int(line[0]), float(line[1]), float(line[2]), float(line[3])
|
||||
|
||||
def read_atom(f):
|
||||
''' Read line from Guassian cube file containing atomic info '''
|
||||
''' Read line from Gaussian cube file containing atomic info '''
|
||||
line = f.readline().lstrip().rstrip().split()
|
||||
return int(line[0]), (float(line[2]), float(line[3]), float(line[4]))
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def numderiv(func,x,step,eps):
|
|||
|
||||
Some care is taken to adjust the step so that the gradient and
|
||||
Hessian diagonal are estimated with about 4 digits of precision
|
||||
but some noise is unavaoidable due either to the noise in the
|
||||
but some noise is unavoidable due either to the noise in the
|
||||
function or cubic/higher terms in the Taylor expansion.
|
||||
'''
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ def geom_set_coords(name,coords):
|
|||
|
||||
def bond_length(i,j): # atoms numbered 1,2,...
|
||||
#
|
||||
# Return the distance betwen atoms i and j in user
|
||||
# Return the distance between atoms i and j in user
|
||||
# units in the default geometry
|
||||
#
|
||||
coords = geom_get_coords('geometry')
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from string import uppercase
|
|||
|
||||
class Excel:
|
||||
'''
|
||||
Wrapper for MS Excel derived from that in Python Programing on Win32
|
||||
Wrapper for MS Excel derived from that in Python Programming on Win32
|
||||
'''
|
||||
def __init__(self,filename=None):
|
||||
'''
|
||||
|
|
@ -125,7 +125,7 @@ class Excel:
|
|||
|
||||
Optionally, you specify only the top-left corner of range in
|
||||
row1, cell1 and specify row2<=0 - the other coordinate is figured
|
||||
out from the dimension of the data. This can always be overriden by
|
||||
out from the dimension of the data. This can always be overridden by
|
||||
specifying the full range coordinates.
|
||||
|
||||
If no coordinates are given, the data is put into the top left
|
||||
|
|
@ -146,7 +146,7 @@ class Excel:
|
|||
|
||||
def getContiguousRange(self, row1, col1, sheet=1):
|
||||
'''
|
||||
Returns data in the range which forms a continguous
|
||||
Returns data in the range which forms a contiguous
|
||||
block with top-left corner in cell (row1,col1).
|
||||
|
||||
Starting from the specified cell, scan down/across
|
||||
|
|
@ -208,14 +208,14 @@ class Excel:
|
|||
|
||||
charttype = 'xy' ... XY scatter plot with lines and points.
|
||||
. First series is X. Others are y1, y2, etc.
|
||||
. = 'surface' ... Surfce plot of a scalar function of
|
||||
. = 'surface' ... Surface plot of a scalar function of
|
||||
. two variables. Data should be a grid of the function.
|
||||
. = 'contour' or 'colorcontour' ... Contour plot of a scalar
|
||||
. function of two variables. Data should be a grid of
|
||||
. values.
|
||||
xmin and xmax = min/max values of the x or category axis
|
||||
. It defaults to autoscale by Excel. This only applies to
|
||||
. XY plots (since the surfce/contor plots do not use
|
||||
. XY plots (since the surface/contor plots do not use
|
||||
. values for the category axes ... they use string labels)
|
||||
ymin and ymax = min/max values of the y or value axis
|
||||
. It defaults to auto by Excel. Applies to all charts.
|
||||
|
|
@ -239,7 +239,7 @@ class Excel:
|
|||
try:
|
||||
charttype = charttypes[charttype]
|
||||
except KeyError:
|
||||
print('Excel.chartSelectedRange: Unkown charttype', charttype, ' defaulting to XY')
|
||||
print('Excel.chartSelectedRange: Unknown charttype', charttype, ' defaulting to XY')
|
||||
charttype = charttypes['xy']
|
||||
|
||||
# Make the chart and set how the data will be interpreted
|
||||
|
|
@ -307,21 +307,21 @@ class Excel:
|
|||
|
||||
def a1(self, row, col, absrow=0, abscol=0):
|
||||
'''
|
||||
Return a string that may be used to adress the cell in
|
||||
a formula. The row and/or column adress may be made absolute
|
||||
Return a string that may be used to address the cell in
|
||||
a formula. The row and/or column address may be made absolute
|
||||
by setting absrow/col to true values.
|
||||
|
||||
Internally we are adressing cells in the spreadsheet using
|
||||
Internally we are addressing cells in the spreadsheet using
|
||||
integers (row,col), which is what Excel calls R1C1 style
|
||||
references. But, unless the user has turned-on R1C1 style
|
||||
adressing (unlikely!) this will not work in formulae
|
||||
so we must translate to the usual adressing style, called A1,
|
||||
addressing (unlikely!) this will not work in formulae
|
||||
so we must translate to the usual addressing style, called A1,
|
||||
which uses letters for the columns and numbers for the rows,
|
||||
writing the column index first.
|
||||
|
||||
E.g., A1 = R1C1 = (1,1), and B3 = R3C2 = (3,2).
|
||||
|
||||
Absolute adresses are preceded with a $ symbol.
|
||||
Absolute addresses are preceded with a $ symbol.
|
||||
'''
|
||||
ar = ac = ''
|
||||
if absrow: ar = '$'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue