pytraj.core.c_core

class pytraj.core.c_core.AtomMask

Bases: object

Attributes

indices
mask_string
n_atoms
n_selected

Methods

add_atom(self, int atom_num) add atom index and sort
add_atom_range(self, int begin, int end)
add_atoms(self, vector[int] v)
add_selected_indices(self, arr0) add atom index without sorting
invert_mask(self)
is_empty(self)
mask_expression(self)
selected_indices(self)
add_atom(self, int atom_num)

add atom index and sort

add_atom_range(self, int begin, int end)
add_atoms(self, vector[int] v)
add_selected_indices(self, arr0)

add atom index without sorting

See also

add_atom

indices
invert_mask(self)
is_empty(self)
mask_expression(self)
mask_string
n_atoms
n_selected
selected_indices(self)
class pytraj.core.c_core.FileName

Bases: object

Attributes

fullname
fullname
class pytraj.core.c_core.NameType

Bases: object

Attributes

truncated_name return string

Methods

copy(self)
match(self, NameType nt) return bool
replace_asterisk(self)
to_buffer(self, char *c)
copy(self)
match(self, NameType nt)

return bool

replace_asterisk(self)
to_buffer(self, char *c)
truncated_name

return string

class pytraj.core.c_core.Command

Bases: object

Methods

dispatch(type cls, CpptrajState state, line)
get_state(type cls, trajin_text)
get_state_from_string(type cls, txt)
dispatch(type cls, CpptrajState state, line)
get_state(type cls, trajin_text)
get_state_from_string(type cls, txt)
class pytraj.core.c_core.CpptrajState

Bases: object

CpptrajState hold all data per cpptraj run. This class is for internal use. Check example

Examples

>>> import pytraj as pt
>>> text = '''
parm tz2.parm7
trajin tz2.nc
rms
distance :2 :3
'''
>>> state = pt.load_cpptraj_state(text)
>>> state.run()
CpptrajState, include:
<datasetlist: 3 datasets>
>>> print(state.data[1])
<pytraj.datasets.DatasetDouble: size=101, key=RMSD_00001>
values:
[  2.43182129e-07   4.01623189e+00   6.41421043e+00 ...,   8.27504991e+00
   8.19405473e+00   7.77917637e+00]
>>> print(state.data.keys())
['tz2.parm7', 'RMSD_00001', 'Dis_00002']

Attributes

data
datafilelist datafilelist: pytraj.datafiles.datafiles.DataFileList
datasetlist datasetlist: pytraj.datasets.c_datasetlist.DatasetList

Methods

compute(self)
run(self)
compute(self)
data
datafilelist

datafilelist: pytraj.datafiles.datafiles.DataFileList

datasetlist

datasetlist: pytraj.datasets.c_datasetlist.DatasetList

run(self)
class pytraj.core.c_core.ArgList

Bases: object

Class: ArgList
Hold a list of string arguments and keeps track of their usage. Can be set from an input line using SetList(), with arguments separated by a specified delimiter, or arguments can be added one-by-one with AddArg. Arguments can be accessed with the various getX routines, where X is specific to certain types, e.g. getNextDouble returns the next double, getNextMask returns an atom mask expression (i.e. it has :, @, % characters etc). All of the getX routines (along with the hasKey routine) mark the argument they access as used, so that subsequent calls with these functions will not return the same argument over and over.

Attributes

n_args

Methods

command_is(self, char *cm)
get_key_double(self, char *key, double defd)
get_key_int(self, char *key, int defint)
get_next_double(self, double defd)
get_next_integer(self, defint)
get_next_mask(self)
get_next_string(self)
get_next_tag(self)
get_string_key(self, c)
has_key(self, char *key)
is_empty(self)
command_is(self, char *cm)
get_key_double(self, char *key, double defd)
get_key_int(self, char *key, int defint)
get_next_double(self, double defd)
get_next_integer(self, defint)
get_next_mask(self)
get_next_string(self)
get_next_tag(self)
get_string_key(self, c)
has_key(self, char *key)
is_empty(self)
n_args