peleffy.forcefield.selectors.ForceFieldSelector

class peleffy.forcefield.selectors.ForceFieldSelector[source]

It defines a force field selector.

__init__()

Initialize self. See help(type(self)) for accurate signature.

get_by_name(forcefield_name)[source]

Given a forcefield name, it returns the corresponding force field class.

Parameters

forcefield_name (str) – The name of the requested forcefield

Returns

forcefield – The force field that corresponds to the supplied name

Return type

a peleffy.forcefield.forcefield.ForceField

Raises

ValueError – If the supplied forcefield_name is unknown

Examples

Use the force field selector to select a force field by name

>>> from peleffy.forcefield import ForceFieldSelector
>>> selector = ForceFieldSelector()
>>> openff = selector.get_by_name('openff_unconstrained-1.2.1.offxml')
get_list()[source]

It returns the complete list of available force fields.

Returns

forcefields – The complete list of available force fields

Return type

list[str]