schrodinger.ui.qt.forcefield.metals_forcefield module

class schrodinger.ui.qt.forcefield.metals_forcefield.ConfigButtonState

Bases: Enum

DEFAULT = 'default'
SELECTED = 'selected'
WARNING = 'warning'
class schrodinger.ui.qt.forcefield.metals_forcefield.MetalsForcefieldPopUp(*args, **kwargs)

Bases: InitMixin, PopUp

A pop-up widget for configuring and analyzing the Metals force field compatibility of given structures.

Usage Example:

pop_up = MetalsForcefieldPopUp(parent)
pop_up.registerInputGetter(get_input_system_callback)
pop_up.onInputChanged()

# After analysis
is_selected = pop_up.shouldUseMetalsForcefield()
prepared_file_path = pop_up.getAnalyzedOutput()
ui_module = <module 'schrodinger.ui.qt.forcefield.metals_forcefield_gui_dir.metals_forcefield_ui' from '/scr/buildbot/builds/build/internal/lib/python3.11/site-packages/schrodinger/ui/qt/forcefield/metals_forcefield_gui_dir/metals_forcefield_ui.py'>
initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initSetDefaults()

Set widget to its default state. If the widget uses a model/mapper, it’s preferable to reset the widget state by resetting the model.

registerInputGetter(callback)

Register a callback to get the input system when analysis is run.

Note: The callback should return either a file path to the input system, a Structure object, or an iterable of Structure objects.

Parameters:

callback – A callable that returns the input system.

shouldUseMetalsForcefield() → bool

Return whether the Metals force field option is currently selected by the user.

getAnalyzedOutput() → str

Get the file path to the prepared metal complex file.

Raises:

RuntimeError – If the analysis has not been run yet.

Returns:

The file path to the prepared metal complex file.

onInputChanged()

Reset the pop-up when input structures change.

Note: This has to be called by the parent widget when input structures change.

setup()

Subclass-specific initialization. Subclasses can re-implement this function with custom set up code.

class schrodinger.ui.qt.forcefield.metals_forcefield.MetalsForcefieldConfigButton(parent, *args, **kwargs)

Bases: FlatButtonWithPopUp

A button to open the Metals Force Field configuration pop-up.

Usage Example:

button = MetalsForcefieldConfigButton(parent)
button.registerInputGetter(get_input_system_callback)
button.onInputChanged()

# After analysis
is_selected = button.shouldUseMetalsForcefield()
prepared_file_path = button.getAnalyzedOutput()
PRESSED_ICON_PATH = ':icons/settings-ON-light.png'
STYLESHEET_PROPERTY = 'state'
__init__(parent, *args, **kwargs)
Parameters:

parent (PyQt5.QtWidgets.QWidget) – The Qt parent widget

registerInputGetter(callback)

Register a callback to get the input system when analysis is run.

Note: The callback should return either a file path to the input system, a Structure object, or an iterable of Structure objects.

Parameters:

callback – A callable that returns the input system.

onInputChanged()

Set the button to warning state if input changes and the Metals force field was previously selected. Also notify the pop-up of the input change.

Note: This has to be called by the parent widget when input changes.

shouldUseMetalsForcefield() → bool

Return whether the Metals force field option is currently selected (checked) by the user in the pop-up.

getAnalyzedOutput() → str

Get the file path to the prepared metal complex file

Raises:

RuntimeError – If the analysis has not been run yet.

Returns:

The file path to the prepared metal complex file.

updateStyleSheet()

Override to update the stylesheet based on the button state.