columns

class nmrpeaklists.columns.Column(name, fmt)[source]

Represent a peak list column and map its data to Peak objects

Provide a base class for representing peak list columns and define an interface for mapping column data to Peak objects.

Parameters:
name : str

Name of the peak list column, should be unique within a peak list

fmt : str

printf-style format string specifying how the data should be printed

get_string(peak)[source]

Get column data from a Peak object and return a formatted string

Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.

Parameters:
peak : Peak

Peak object containing the corresponding column data

Returns:
value : str

A formatted string of the column data for the Peak object

get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_string(peak, string)[source]

Set the appropriate value in a Peak object from a formatted string

Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.

Parameters:
peak : Peak

Peak object in which to set the column data

string : str

Formatted string of the column data to set in the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.IgnoreColumn(name, string)[source]
get_string(peak)[source]

Get column data from a Peak object and return a formatted string

Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.

Parameters:
peak : Peak

Peak object containing the corresponding column data

Returns:
value : str

A formatted string of the column data for the Peak object

get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_string(peak, string)[source]

Set the appropriate value in a Peak object from a formatted string

Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.

Parameters:
peak : Peak

Peak object in which to set the column data

string : str

Formatted string of the column data to set in the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.PeakAttrColumn(name, fmt, attr)[source]
get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.PeakAttrListColumn(name, fmt, attr, index, length=None)[source]
get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.SpinAttrColumn(name, fmt, attr, index)[source]
get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.Res3LetterColumn(name, index)[source]
get_string(peak)[source]

Get column data from a Peak object and return a formatted string

Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.

Parameters:
peak : Peak

Peak object containing the corresponding column data

Returns:
value : str

A formatted string of the column data for the Peak object

set_string(peak, string)[source]

Set the appropriate value in a Peak object from a formatted string

Set the value in the Peak object corresponding to the associated peak list column based on a formatted string.

Parameters:
peak : Peak

Peak object in which to set the column data

string : str

Formatted string of the column data to set in the Peak object

class nmrpeaklists.columns.PipeNameColumn(index, res_width=4, atom_width=4)[source]
get_string(peak)[source]

Get column data from a Peak object and return a formatted string

Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.

Parameters:
peak : Peak

Peak object containing the corresponding column data

Returns:
value : str

A formatted string of the column data for the Peak object

get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

class nmrpeaklists.columns.PipeAnchorColumn(indices, res_width=4, atom_width=8)[source]
get_string(peak)[source]

Get column data from a Peak object and return a formatted string

Return a formatted string representing the value from the Peak object corresponding to the associated peak list column.

Parameters:
peak : Peak

Peak object containing the corresponding column data

Returns:
value : str

A formatted string of the column data for the Peak object

get_value(peak[, default])[source]

Get the appropriate column data from a Peak object

Return the value from the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object containing the corresponding column data

default : optional

If the Peak does not contain the corresponding data, return default if provided, otherwise raise an Exception.

Returns:
value

The column value taken from the Peak object

set_value(peak, value)[source]

Set the appropriate value in a Peak object from peak list column data

Set the value in the Peak object corresponding to the associated peak list column. Each subclass must provide its own definition of this interface.

Parameters:
peak : Peak

Peak object in which to set the column data

value

The column value to set in the Peak object

class nmrpeaklists.columns.SparkyNameColumn(fmt='%10s')[source]
class nmrpeaklists.columns.ColumnGroup[source]
class nmrpeaklists.columns.PeakAttrListGroup(possible_names, fmt, attr)[source]
class nmrpeaklists.columns.SpinAttrGroup(possible_names, fmt, attr)[source]
class nmrpeaklists.columns.PipeNameGroup[source]
class nmrpeaklists.columns.ColumnTemplate(columns=None)[source]
insert(i, v)[source]

S.insert(index, object) – insert object before index

class nmrpeaklists.columns.PipeTemplate(columns=None)[source]
class nmrpeaklists.columns.SparkyTemplate(columns=None)[source]
class nmrpeaklists.columns.UplTemplate(columns=None)[source]
class nmrpeaklists.columns.XeasyTemplate(columns=None)[source]