openforcefield.typing.engines.smirnoff.parameters.ParameterList

class openforcefield.typing.engines.smirnoff.parameters.ParameterList(input_parameter_list=None)[source]

Parameter list that also supports accessing items by SMARTS string.

Warning

This API is experimental and subject to change.

Methods

append(self, parameter)

Add a ParameterType object to the end of the ParameterList

clear(self, /)

Remove all items from list.

copy(self, /)

Return a shallow copy of the list.

count(self, value, /)

Return number of occurrences of value.

extend(self, other)

Add a ParameterList object to the end of the ParameterList

index(self, item)

Get the numerical index of a ParameterType object or SMIRKS in this ParameterList.

insert(self, index, parameter)

Add a ParameterType object as if this were a list

pop(self[, index])

Remove and return item at index (default last).

remove(self, value, /)

Remove first occurrence of value.

reverse(self, /)

Reverse IN PLACE.

sort(self, /, \*[, key, reverse])

Stable sort IN PLACE.

to_list(self[, discard_cosmetic_attributes])

Render this ParameterList to a normal list, serializing each ParameterType object in it to dict.

__init__(self, input_parameter_list=None)[source]

Initialize a new ParameterList, optionally providing a list of ParameterType objects to initially populate it.

Parameters
input_parameter_list: list[ParameterType], default=None

A pre-existing list of ParameterType-based objects. If None, this ParameterList will be initialized empty.

Methods

__init__(self[, input_parameter_list])

Initialize a new ParameterList, optionally providing a list of ParameterType objects to initially populate it.

append(self, parameter)

Add a ParameterType object to the end of the ParameterList

clear(self, /)

Remove all items from list.

copy(self, /)

Return a shallow copy of the list.

count(self, value, /)

Return number of occurrences of value.

extend(self, other)

Add a ParameterList object to the end of the ParameterList

index(self, item)

Get the numerical index of a ParameterType object or SMIRKS in this ParameterList.

insert(self, index, parameter)

Add a ParameterType object as if this were a list

pop(self[, index])

Remove and return item at index (default last).

remove(self, value, /)

Remove first occurrence of value.

reverse(self, /)

Reverse IN PLACE.

sort(self, /, \*[, key, reverse])

Stable sort IN PLACE.

to_list(self[, discard_cosmetic_attributes])

Render this ParameterList to a normal list, serializing each ParameterType object in it to dict.

append(self, parameter)[source]

Add a ParameterType object to the end of the ParameterList

Parameters
parametera ParameterType object
extend(self, other)[source]

Add a ParameterList object to the end of the ParameterList

Parameters
othera ParameterList
index(self, item)[source]

Get the numerical index of a ParameterType object or SMIRKS in this ParameterList. Raises ValueError if the item is not found.

Parameters
itemParameterType object or str

The parameter or SMIRKS to look up in this ParameterList

Returns
indexint

The index of the found item

insert(self, index, parameter)[source]

Add a ParameterType object as if this were a list

Parameters
indexint

The numerical position to insert the parameter at

parametera ParameterType object

The parameter to insert

to_list(self, discard_cosmetic_attributes=True)[source]

Render this ParameterList to a normal list, serializing each ParameterType object in it to dict.

Parameters
discard_cosmetic_attributesbool, optional. Default = True

Whether to discard non-spec attributes of each ParameterType object.

Returns
parameter_listList[dict]

A serialized representation of a ParameterList, with each ParameterType it contains converted to dict.

clear(self, /)

Remove all items from list.

copy(self, /)

Return a shallow copy of the list.

count(self, value, /)

Return number of occurrences of value.

pop(self, index=-1, /)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(self, value, /)

Remove first occurrence of value.

Raises ValueError if the value is not present.

reverse(self, /)

Reverse IN PLACE.

sort(self, /, *, key=None, reverse=False)

Stable sort IN PLACE.