OptionsState

class psi4.driver.p4util.OptionsState(*largs)[source]

Bases: object

Store multiple OptionState() objects. Use in driver functions to collect several keywords before altering them, then restore them before function return.

Parameters:

largs (List[List[str]]) – Specify which keywords to store value and has_changed state.

Examples

>>> optstash = OptionsState(
        ['DF_BASIS_SCF'],
        ['SCF_TYPE'],
        ['SCF', 'REFERENCE'])
>>> print(optstash)
>>> optstash.restore()

Methods Summary

add_option(item)

Store info for another keyword, item.

restore()

Restore value and has_changed status of each keyword to saved condition.

Methods Documentation

add_option(item)[source]

Store info for another keyword, item.

Parameters:

item (List[str]) – A one-membered list with a global keyword or a two-membered list with a module keyword and module.

restore()[source]

Restore value and has_changed status of each keyword to saved condition.