dimer_builder_step package#

Submodules#

dimer_builder_step.dimer_analysis module#

Distribution diagnostics for a generated dimer ensemble.

Pure, framework-free analysis intended to be shared by two consumers:

  • the SEAMM dimer_builder_step – called from analyze() to write the charts automatically whenever the step runs; and

  • a standalone notebook script – to re-analyze an exported ensemble offline.

Keeping the math in one place means the in-step charts and the offline analysis never drift. The module depends only on numpy for the metrics; plotly is imported lazily inside make_dashboard, so compute_metrics works in a minimal / headless environment. make_dashboard returns the combined panel as one plotly go.Figure; make_panels returns the same panels as individual go.Figure objects (a dict keyed by panel name) for callers that want each chart on its own – both share one set of trace builders, so the combined and separated views can never drift. SEAMM uses plotly throughout, so the step writes any of these with the same machinery it uses for every other graph (and the offline notebook can write_image / write_html them).

Design notes#

  • General, not motif-specific. Every default metric is defined from geometry + (optional) interaction energy alone – separation, approach direction, contact distances, relative orientation, and the energy distribution. No hydrogen-bond / donor-acceptor knowledge is assumed, in keeping with the energy-stratified sampling design (water-electrolyte plan, decision 5). A motif overlay can be layered on by a caller that knows the contact atoms; it is deliberately not baked in here.

  • Degrades gracefully. If the ensemble carries no energies (e.g. the van-der-Waals contact method was used), the energy panels are simply omitted.

  • Cheap. All metrics are O(N * nA * nB); fine for the hundreds-to-thousands of dimers a build produces.

class dimer_builder_step.dimer_analysis.Dimer(symbols_A: list, xyz_A: ndarray, symbols_B: list, xyz_B: ndarray, energy: float | None = None, label: str | None = None, separation: float | None = None, orientation: int | None = None, is_tail: bool = False)[source]#

Bases: object

One generated dimer.

Coordinates are (n, 3) arrays in Å; energy is the (surrogate) interaction energy in kJ/mol, or None if not available.

energy: float | None = None#
is_tail: bool = False#
label: str | None = None#
orientation: int | None = None#
separation: float | None = None#
symbols_A: list#
symbols_B: list#
xyz_A: ndarray#
xyz_B: ndarray#
class dimer_builder_step.dimer_analysis.DimerMetrics(n: 'int', R: 'np.ndarray', min_contact: 'np.ndarray', approach_lonlat: 'np.ndarray', approach_vec: 'np.ndarray', orient_angle: 'np.ndarray', energy: 'Optional[np.ndarray]', is_tail: 'np.ndarray' = None, contact_pairs: 'dict' = <factory>)[source]#

Bases: object

R: ndarray#
approach_lonlat: ndarray#
approach_vec: ndarray#
contact_pairs: dict#
core_energy() → ndarray[source]#

Finite interaction energies of the energy-stratified CORE only (tail-coverage configs excluded). The flatness metric is defined here: the deliberately near-zero tail otherwise inflates the near-zero bin.

energy: ndarray | None#
property has_energy: bool#
is_tail: ndarray = None#
min_contact: ndarray#
n: int#
orient_angle: ndarray#
dimer_builder_step.dimer_analysis.approach_concentration(approach_vec) → float[source]#

Mean resultant length of the approach unit vectors (in A’s frame).

0 = isotropic (uniform orientation), 1 = all partners approach from one direction. A simple scalar for “is the orientational sampling biased?”. (Multi-lobe patterns – e.g. several symmetry-equivalent H-bond directions – partially cancel, so read this together with the sphere map.)

dimer_builder_step.dimer_analysis.compute_metrics(ensemble, contact_cutoff: float = 6.0) → DimerMetrics[source]#

Compute distribution metrics for a list of Dimer.

Parameters:
  • ensemble (list[Dimer])

  • contact_cutoff (float) – Only intermolecular A-B distances below this (Å) are pooled into the contact-RDF; the per-dimer minimum contact is always exact.

dimer_builder_step.dimer_analysis.energy_histogram(energy, nbins: int = 24, clip_high: float | None = None)[source]#

Histogram of interaction energies plus a flatness metric.

Returns (edges, counts, flatness) where flatness is the coefficient of variation of the non-empty bin counts – 0 is perfectly flat (ideal for the energy-stratified sampler); large values mean the samples pile up in a few energy bins (what uniform / Boltzmann sampling does).

dimer_builder_step.dimer_analysis.make_dashboard(metrics: DimerMetrics, title: str = 'Dimer sampling')[source]#

Assemble all diagnostics as a single combined plotly go.Figure.

Panels (energy panels dropped automatically when no energies are present):

separation histogram | contact distances | approach-direction sphere map | relative-orientation histogram | energy histogram + flatness | ΔE vs R.

See make_panels() for the same panels as individual figures.

dimer_builder_step.dimer_analysis.make_panels(metrics: DimerMetrics) → dict[source]#

Return each diagnostic as its own go.Figure.

Keys: separation, contact, approach, orientation always; energy and energy_vs_R only when the ensemble carries energies. Uses the same trace builders as make_dashboard().

dimer_builder_step.dimer_analysis.panel_approach(m: DimerMetrics, title: str = 'Approach direction (A frame)')[source]#
dimer_builder_step.dimer_analysis.panel_contact(m: DimerMetrics, title: str = 'Contact distribution')[source]#
dimer_builder_step.dimer_analysis.panel_energy(m: DimerMetrics, title: str | None = None)[source]#

Energy-distribution panel, or None if the ensemble has no energies.

dimer_builder_step.dimer_analysis.panel_energy_vs_R(m: DimerMetrics, title: str = 'Binding-curve envelope')[source]#

ΔE-vs-R panel, or None if the ensemble has no energies.

dimer_builder_step.dimer_analysis.panel_orientation(m: DimerMetrics, title: str = 'Relative orientation')[source]#
dimer_builder_step.dimer_analysis.panel_separation(m: DimerMetrics, title: str = 'Separation coverage')[source]#
dimer_builder_step.dimer_analysis.summarize(metrics: DimerMetrics) → dict[source]#

A compact dict of scalar diagnostics (for logging / assertions / the step’s text summary).

dimer_builder_step.dimer_builder module#

Non-graphical part of the Dimer Builder step in a SEAMM flowchart

class dimer_builder_step.dimer_builder.DimerBuilder(flowchart=None, title='Dimer Builder', namespace='org.molssi.seamm', extension=None, logger=<Logger dimer_builder_step.dimer_builder (WARNING)>)[source]#

Bases: Node

The non-graphical part of a Dimer Builder step in a flowchart.

parser#

The parser object.

Type:

configargparse.ArgParser

options#

It contains a two item tuple containing the populated namespace and the list of remaining argument strings.

Type:

tuple

subflowchart#

A SEAMM Flowchart object that represents a subflowchart, if needed.

Type:

seamm.Flowchart

parameters#

The control parameters for Dimer Builder.

Type:

DimerBuilderParameters

See also

TkDimerBuilder, DimerBuilder, DimerBuilderParameters

analyze(P=None, stats=None, indent='', **kwargs)[source]#

Summarize what was generated.

create_parser()[source]#

Setup the command-line / config file parser

description_text(P=None, short=False)[source]#

Create the text description of what this step will do.

Parameters:
  • P (dict) – An optional dictionary of the current values of the control parameters.

  • short (bool) – If True, omit the description of the sub-flowchart steps.

Returns:

A description of the current step.

Return type:

str

property git_revision#

The git version of this module.

run()[source]#

Run a Dimer Builder step.

Returns:

The next node object in the flowchart.

Return type:

seamm.Node

set_id(node_id=())[source]#

Sequentially number the subnodes

set_subids(node_id=())[source]#

Set the ids of the nodes in the subflowchart

property version#

The semantic version of this module.

dimer_builder_step.dimer_builder.vdw_radii(symbols)[source]#

Van der Waals radii, in Å, for a list of element symbols.

Uses the mendeleev package (radii are tabulated in picometres). Falls back to the Pyykkö covalent radius, then to 1.5 Å, for any element lacking a vdW radius.

Parameters:

symbols ([str]) – The element symbols.

Returns:

The van der Waals radii in Å, in the same order as symbols.

Return type:

numpy.ndarray

dimer_builder_step.dimer_builder_parameters module#

Control parameters for the Dimer Builder step in a SEAMM flowchart

class dimer_builder_step.dimer_builder_parameters.DimerBuilderParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Dimer Builder.

The keys are the parameters for this plug-in; each value is a dictionary describing that parameter (default, kind, units, enumeration, format, description, help). This is the Tier-1 set (engine-free generation); the “energy” contact method and any further options are layered on later.

parameters{str: {str: str}}

A dictionary containing the parameters for the current step.

parameters = {'analysis plots': {'default': 'basic', 'default_units': '', 'description': 'Sampling diagnostics:', 'enumeration': ('none', 'basic', 'detailed'), 'format_string': '', 'help_text': "Distribution diagnostics for the generated ensemble (separation coverage, contact distances, approach direction, relative orientation, and -- if interaction energies were computed -- the ΔE distribution and flatness). 'none' skips them. 'basic' prints the scalar summary and writes the combined interactive 'dimer_sampling.graph' for the Dashboard. 'detailed' additionally writes each panel as its own 'dimer_sampling_<panel>.graph' for closer inspection. Any extra image formats (png/pdf/svg/...) are controlled by graph-formats in seamm.ini.", 'kind': 'enum'}, 'anchor separation': {'default': 15.0, 'default_units': 'Å', 'description': 'Anchor separation:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The largest center-to-center separation sampled for the asymptote anchors (the profile is extended to here so the ≈0 tail is represented out to this distance).', 'kind': 'float'}, 'asymptote anchors': {'default': 20, 'default_units': '', 'description': 'Asymptote anchors:', 'enumeration': (), 'format_string': '', 'help_text': "How many far-separation configurations (between the maximum separation and the 'anchor separation', over a spread of orientations) to add to pin the interaction energy to zero at large distance. 0 disables them.", 'kind': 'integer'}, 'configuration name': {'default': 'orientation,distance', 'default_units': '', 'description': 'Name the configurations:', 'enumeration': ('orientation,distance', 'separation', 'sequential'), 'format_string': '', 'help_text': "How to name each generated configuration. 'orientation,distance' labels them by orientation and point index (1,1  1,2  ...  2,1  ...) so the points of one scan group together; 'separation' labels them by their separation; 'sequential' numbers them 1, 2, ... across all configurations. A comma (not '/') is used since '/' separates system and configuration names elsewhere.", 'kind': 'string'}, 'contact method': {'default': 'van der Waals radii', 'default_units': '', 'description': 'Find contact using:', 'enumeration': ('van der Waals radii', 'energy'), 'format_string': '', 'help_text': "How to locate the contact distance that anchors the scan. 'van der Waals radii' is a fast geometric estimate (Tier 1). 'energy' uses the energy from the sub-flowchart to find the onset of repulsion (requires an engine in the sub-flowchart).", 'kind': 'enum'}, 'energy levels': {'default': '-De, -De/2, 0, kBT, 5*kBT', 'default_units': '', 'description': 'ΔE levels:', 'enumeration': (), 'format_string': '', 'help_text': "Sets the interaction-energy window for 'energy-stratified' spacing, as a comma-separated list of linear expressions in the well depth 'De' and thermal energy 'kBT' (kJ/mol) -- e.g. '-De, -De/2, 0, kBT, 5*kBT'. The largest positive value caps the repulsive wall (points above it are dropped); the candidates are then globally binned across this range and capped per bin.", 'kind': 'string'}, 'energy weight': {'default': 8.0, 'default_units': '', 'description': 'Energy weight:', 'enumeration': (), 'format_string': '.1f', 'help_text': "For the 'descriptor diversity' selection: how strongly the interaction energy counts relative to each geometric collective variable in the clustering (1 = equal; larger keeps the sample flatter in energy at the cost of some geometric diversity).", 'kind': 'float'}, 'innermost gap': {'default': -0.5, 'default_units': 'Å', 'description': 'Innermost gap:', 'enumeration': (), 'format_string': '.2f', 'help_text': "The closest point of the scan, measured as the gap beyond contact (0 = touching). A negative value starts inside contact, i.e. with a slight overlap. Not used for 'energy-stratified' spacing, which anchors on the energy minimum and sets its inner bound by energy (the repulsive-wall target level).", 'kind': 'float'}, 'input mode': {'default': 'two monomer sets', 'default_units': '', 'description': 'Input:', 'enumeration': ('two monomer sets', 'prepared dimers'), 'format_string': '', 'help_text': "'two monomer sets' assembles dimers from conformers of monomer A and monomer B at random relative orientations. 'prepared dimers' takes already-assembled dimers (from 'monomer A') and scans each, splitting it into its two molecules by connectivity.", 'kind': 'enum'}, 'maximum separation': {'default': 10.0, 'default_units': 'Å', 'description': 'Maximum separation:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The largest center-of-mass separation to scan out to.', 'kind': 'float'}, 'minimum well depth': {'default': 2.5, 'default_units': 'kJ/mol', 'description': 'Minimum well depth:', 'enumeration': (), 'format_string': '.2f', 'help_text': "For 'reject shallow orientations', the smallest ΔE well depth an orientation must have to be kept (defaults to ~kBT at 300 K). For 'downweight by depth', the half-weight depth. Ignored when orientation weighting is 'none'.", 'kind': 'float'}, 'monomer A configuration name': {'default': '', 'default_units': '', 'description': 'matching:', 'enumeration': (), 'format_string': 's', 'help_text': 'The configuration name, wildcard pattern or regular expression.', 'kind': 'string'}, 'monomer A configurations': {'default': 'all', 'default_units': '', 'description': 'using configurations:', 'enumeration': ('current', 'all', 'last', 'first', 'name is', 'name matches', 'name regexp'), 'format_string': 's', 'help_text': 'Which configurations of the monomer A system(s) form the conformer pool: all (the default), the current, last or first, or those chosen by name.', 'kind': 'string'}, 'monomer A system name': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The system name, wildcard pattern or regular expression.', 'kind': 'string'}, 'monomer A systems': {'default': 'current', 'default_units': '', 'description': 'Monomer A:', 'enumeration': ('current', 'all', 'name is', 'name matches', 'name regexp'), 'format_string': 's', 'help_text': "Where monomer A comes from: the current system, all systems, systems chosen by name, or a variable ($name) holding a list of configurations. In 'prepared dimers' mode monomer A is the source of the dimers; monomer B is ignored.", 'kind': 'string'}, 'monomer B configuration name': {'default': '', 'default_units': '', 'description': 'matching:', 'enumeration': (), 'format_string': 's', 'help_text': 'The configuration name, wildcard pattern or regular expression.', 'kind': 'string'}, 'monomer B configurations': {'default': 'all', 'default_units': '', 'description': 'using configurations:', 'enumeration': ('current', 'all', 'last', 'first', 'name is', 'name matches', 'name regexp'), 'format_string': 's', 'help_text': 'Which configurations of the monomer B system(s) form the conformer pool: all (the default), the current, last or first, or those chosen by name.', 'kind': 'string'}, 'monomer B system name': {'default': '', 'default_units': '', 'description': '', 'enumeration': (), 'format_string': 's', 'help_text': 'The system name, wildcard pattern or regular expression.', 'kind': 'string'}, 'monomer B systems': {'default': 'current', 'default_units': '', 'description': 'Monomer B:', 'enumeration': ('current', 'all', 'name is', 'name matches', 'name regexp'), 'format_string': 's', 'help_text': "Where monomer B comes from: the current system, all systems, systems chosen by name, or a variable ($name) holding a list of configurations. In 'prepared dimers' mode monomer A is the source of the dimers; monomer B is ignored.", 'kind': 'string'}, 'number of energy bins': {'default': 12, 'default_units': '', 'description': 'Number of energy bins:', 'enumeration': (), 'format_string': '', 'help_text': "For 'energy-stratified' spacing: the number of interaction-energy bins the pooled candidate configurations are sorted into for the global stratification. Each bin is capped at the same count, so the kept ensemble is flat in energy from the repulsive wall through the well to the asymptote.", 'kind': 'integer'}, 'number of orientations': {'default': 10, 'default_units': '', 'description': 'Number of orientations:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples to generate. Each sample draws a random conformer of monomer A, a random conformer of monomer B, and a random relative orientation, then is scanned radially.', 'kind': 'integer'}, 'number of separations': {'default': 15, 'default_units': '', 'description': 'Number of separations:', 'enumeration': (), 'format_string': '', 'help_text': "How many points to place along each radial profile, for 'geometric' or 'linear' spacing. For 'energy-stratified' spacing this is the resolution of the ΔE(R) profile (the number of energy evaluations), not the number of output points -- those are set by the 'energy levels'.", 'kind': 'integer'}, 'orientation weighting': {'default': 'none', 'default_units': '', 'description': 'Weight orientations by well depth:', 'enumeration': ('none', 'reject shallow orientations', 'downweight by depth'), 'format_string': '', 'help_text': "Optional per-orientation pre-filter for 'energy-stratified' spacing ('two monomer sets' mode). The default 'none' keeps every orientation and lets the global energy-stratification balance the ensemble. 'reject shallow orientations' skips any orientation whose well is shallower than the 'minimum well depth'; 'downweight by depth' keeps each with probability 1 - 2^(-De/minimum well depth). Prepared dimers are always kept.", 'kind': 'enum'}, 'random seed': {'default': 'random', 'default_units': '', 'description': 'Random seed:', 'enumeration': ('random',), 'format_string': '', 'help_text': "The seed for the random-number generator. Use 'random' for a fresh, non-reproducible seed, or an integer for reproducible orientations.", 'kind': 'string'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables.', 'kind': 'dictionary'}, 'sampling temperature': {'default': 300.0, 'default_units': 'K', 'description': 'Sampling temperature:', 'enumeration': (), 'format_string': '.1f', 'help_text': "The temperature that sets kBT for the thermal 'energy levels' in 'energy-stratified' spacing.", 'kind': 'float'}, 'save scan variables as properties': {'default': 'yes', 'default_units': '', 'description': 'Save scan variables as properties:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to store the separation, gap, and orientation index on each configuration as properties, for downstream filtering.', 'kind': 'boolean'}, 'selection method': {'default': 'energy bins + diversity', 'default_units': '', 'description': 'Down-select by:', 'enumeration': ('energy bins + diversity', 'descriptor diversity', 'energy bins'), 'format_string': '', 'help_text': "How to down-select the pooled candidate configurations for 'energy-stratified' spacing (all target about 'target configurations'). 'energy bins + diversity' bins by interaction energy (flat in energy) and, within each bin, keeps a geometrically diverse, de-duplicated subset (DIRECT clustering of the geometric collective variables). 'descriptor diversity' is a single global DIRECT clustering over those variables PLUS the interaction energy (scaled by 'energy weight') -- maximally diverse, but flatness depends on the weight. 'energy bins' caps each energy bin equally with a random pick (flat in energy, no geometric de-duplication).", 'kind': 'enum'}, 'separations': {'default': '', 'default_units': 'Å', 'description': 'Separations:', 'enumeration': (), 'format_string': '', 'help_text': "An explicit list of gaps beyond contact (e.g. '-0.5, 0.0, 0.5, 1:5:0.5'), used when spacing is 'explicit'.", 'kind': 'string'}, 'spacing': {'default': 'geometric', 'default_units': '', 'description': 'Spacing:', 'enumeration': ('geometric', 'linear', 'explicit', 'energy-stratified'), 'format_string': '', 'help_text': "How the scan points are distributed along the gap coordinate. 'geometric' clusters points near contact and thins them in the tail; 'linear' spaces them evenly; 'explicit' uses the list in 'separations'. 'energy-stratified' places points at target interaction-energy levels along the ΔE(R) profile (requires the 'energy' contact method), giving a flat-in-energy sample from the repulsive wall through the well to the asymptote.", 'kind': 'enum'}, 'system name': {'default': 'from monomers', 'default_units': '', 'description': 'Name the dimer system:', 'enumeration': ('from monomers',), 'format_string': '', 'help_text': "The name for the new system holding the dimer configurations. 'from monomers' builds it from the two monomer names; otherwise the literal text is used.", 'kind': 'string'}, 'tail configurations per bin': {'default': 5, 'default_units': '', 'description': 'Tail configurations per bin:', 'enumeration': (), 'format_string': '', 'help_text': "The number of configurations to keep in each separation bin of the distance-coverage floor (chosen for geometric diversity). The tail floor and anchors come OUT of 'target configurations' (they are not added on top), so raise the target to keep the same energy-region coverage. ~5-8 per bin is a good starting density for the constantly-traversed 5-8 Å region.", 'kind': 'integer'}, 'tail coverage': {'default': 'yes', 'default_units': '', 'description': 'Add long-range distance coverage:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': "Energy-stratified selection is flat in energy, which starves the weak long-range tail (5+ Å maps to ≈0 ΔE, so it gets only ~one bin's worth) even though molecular dynamics traverses it constantly. With this on, the kept set is supplemented with a distance-coverage floor and a few far-separation anchors so the tail is sampled independently of interaction strength: energy-flat where the interaction is strong, distance-dense in the weak tail.", 'kind': 'boolean'}, 'tail minimum separation': {'default': 4.0, 'default_units': 'Å', 'description': 'Tail coverage from:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The start of the distance-coverage floor. From here out to the maximum separation the kept set is guaranteed a minimum number of configurations in each separation bin (over a spread of orientations), on top of the energy-based selection.', 'kind': 'float'}, 'tail spacing': {'default': 0.5, 'default_units': 'Å', 'description': 'Tail coverage spacing:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The separation-bin width of the distance-coverage floor (smaller = denser tail coverage).', 'kind': 'float'}, 'target configurations': {'default': 300, 'default_units': '', 'description': 'Target configurations:', 'enumeration': (), 'format_string': '', 'help_text': "For 'energy-stratified' spacing: the approximate total number of configurations to keep. The per-bin cap is this divided by the number of energy bins; sparsely-populated energy ranges (e.g. the deep well) may yield fewer, so the actual total can be smaller. Increase the number of orientations to fill the deep bins.", 'kind': 'integer'}, 'wall ceiling': {'default': 200.0, 'default_units': 'kJ/mol', 'description': 'Wall coverage up to:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The most repulsive interaction energy the wall coverage samples up to (measured from the far-point asymptote, like all the ΔE levels). The inward scan is extended until ΔE reaches this ceiling, and the wall configurations are spread in energy from the repulsive-wall cap up to here.', 'kind': 'float'}, 'wall configurations per bin': {'default': 5, 'default_units': '', 'description': 'Wall configurations per bin:', 'enumeration': (), 'format_string': '', 'help_text': "The number of configurations to keep in each energy bin of the wall coverage (chosen for geometric diversity over orientations). Like the long-range tail coverage, the wall configurations come OUT of 'target configurations' (they are not added on top), so raise the target to keep the same coverage of the attractive region.", 'kind': 'integer'}, 'wall coverage': {'default': 'no', 'default_units': '', 'description': 'Add repulsive-wall coverage:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': "Energy-stratified selection caps the repulsive side at the largest positive 'ΔE level' (~+5·kBT), so the training set gets no points on the steep repulsive wall above that and a machine-learned force field extrapolates the wall too softly -- a stability risk under high-temperature or non-equilibrium dynamics. With this on, the kept set is supplemented with short-separation configurations walked up the wall to 'Wall coverage up to', spread in energy, so the hard wall is sampled directly. Off by default (a robustness / high-T add-on that costs extra energy evaluations).", 'kind': 'boolean'}, 'wall energy spacing': {'default': 25.0, 'default_units': 'kJ/mol', 'description': 'Wall coverage spacing:', 'enumeration': (), 'format_string': '.1f', 'help_text': "The interaction-energy bin width of the wall coverage, from the repulsive-wall cap up to 'Wall coverage up to' (smaller = a denser sampling of the wall).", 'kind': 'float'}}#
update(data)[source]#

Update from a dictionary, translating the legacy ‘monomer A’ / ‘monomer B’ source entries from flowcharts saved before 2026.9.18.

dimer_builder_step.dimer_builder_parameters.monomer_selection_keys(prefix)[source]#

Map the standard structure-selection keys to this monomer’s keys.

dimer_builder_step.dimer_builder_step module#

class dimer_builder_step.dimer_builder_step.DimerBuilderStep(flowchart=None, gui=None)[source]#

Bases: object

Helper class needed for the stevedore integration.

This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.

The dictionary for the description is the class variable just below these comments. The felds are as follows:

my_description{str, str}

A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.

my_description[“description”]tuple

A description of the Dimer Builder step. It must be clear to non-experts.

my_description[“group”]str

Which group in the menus to put this step. If the group does not exist it will be created. Common groups are “Building”, “Control”, “Custom”, “Data”, and “Simulations”.

my_description[“name”]str

The name of this step, to be displayed in the menus.

create_node(flowchart=None, **kwargs)[source]#

Create and return the new node object.

Parameters:
  • flowchart (seamm.Node) – A non-graphical SEAMM node

  • **kwargs (keyword arguments) – Various keyword arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.

Return type:

DimerBuilder

create_tk_node(canvas=None, **kwargs)[source]#

Create and return the graphical Tk node object.

Parameters:
  • canvas (tk.Canvas) – The Tk Canvas widget

  • **kwargs (keyword arguments) – Various keyword arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.

Return type:

TkDimerBuilder

description()[source]#

Return a description of what this step does.

Returns:

description

Return type:

dict(str, str)

my_description = {'description': 'An interface for Dimer Builder', 'group': 'Building', 'name': 'Dimer Builder'}#

dimer_builder_step.metadata module#

This file contains metadata describing the results from DimerBuilder

dimer_builder_step.tk_dimer_builder module#

The graphical part of a Dimer Builder step

class dimer_builder_step.tk_dimer_builder.TkDimerBuilder(tk_flowchart=None, node=None, namespace='org.molssi.seamm.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

The graphical part of a Dimer Builder step in a flowchart.

See also

DimerBuilder, DimerBuilderParameters

create_dialog()[source]#

Create the dialog for the Dimer Builder parameters.

The base class builds a notebook with ‘Parameters’ and ‘Results’ tabs (the step has a ‘results’ parameter). We deliberately do NOT add a ‘Flowchart’ tab: the sub-flowchart is unused now that the ‘energy’ contact method drives an engine through a model chemistry over MDI. If a sub-flowchart-based fallback is added later, the tab can be reinstated (behind an advanced option).

reset_dialog(widget=None)[source]#

Lay out the parameters frame in the Parameters tab.

reset_parameters_frame()[source]#

Lay out the control parameters for the current choices.

right_click(event)[source]#

Handle a right-click: add the Edit… item.

Module contents#

dimer_builder_step A SEAMM plug-in for Dimer Builder