cgexplore.molecular.BeadLibrary

class cgexplore.molecular.BeadLibrary(beads)[source]

Bases: object

Define a library of beads used in a model.

Methods

from_bead_types

Create a BeadLibrary from a dictionary of bead types.

get_from_class

Get CgBead from matching to bead class.

get_from_element

Get CgBead from matching to element string.

get_from_type

Get CgBead from matching to bead type.

get_present_beads

Get a list of present beads.

Parameters:

beads (Sequence[CgBead])

classmethod from_bead_types(bead_types)[source]

Create a BeadLibrary from a dictionary of bead types.

Parameters:

bead_types (dict[str, int]) – Dictionary mapping between bead types (user nomenclature) and their expected coordination.

Return type:

Self

get_from_class(bead_class)[source]

Get CgBead from matching to bead class.

Parameters:

bead_class (str)

Return type:

CgBead

get_from_element(estring)[source]

Get CgBead from matching to element string.

Parameters:

estring (str)

Return type:

CgBead

get_from_type(bead_type)[source]

Get CgBead from matching to bead type.

Parameters:

bead_type (str)

Return type:

CgBead

get_present_beads()[source]

Get a list of present beads.

Return type:

list[CgBead]