def _clean_psi_environ(do_clean: bool): """Reset work environment to new Psi4 instance state. This includes global variables (P::e.globals, P::e.arrays, P::e.options) and any non-explicitly-retained PSIO-managed scratch files. """ if do_clean: core.clean_variables() core.clean_options() core.clean()
def reset_pe_options(pofm): """Acts on Process::environment.options to clear it, the set it to state encoded in `pofm`. Parameters ---------- pofm : dict Result of psi4.driver.p4util.prepare_options_for_modules(changedOnly=True, commandsInsteadDict=False) Returns ------- None """ core.clean_options() for go, dgo in pofm['GLOBALS'].items(): if dgo['has_changed']: core.set_global_option(go, dgo['value']) for module in _modules: for lo, dlo in pofm[module].items(): if dlo['has_changed']: core.set_local_option(module, lo, dlo['value'])
def _reset_pe_options(pofm: Dict): """Acts on ``Process::environment.options`` to clear it, then set it to state encoded in **pofm**. Parameters ---------- pofm Result of :py:func:`psi4.driver.p4util.prepare_options_for_modules(changedOnly=True, commandsInsteadDict=False, stateInsteadMediated=True)` Returns ------- None """ core.clean_options() for go, dgo in pofm['GLOBALS'].items(): if dgo['has_changed']: core.set_global_option(go, dgo['value']) for module in _modules: for lo, dlo in pofm[module].items(): if dlo['has_changed']: core.set_local_option(module, lo, dlo['value'])
def _clean_psi_environ(do_clean): if do_clean: core.clean_variables() core.clean_options() core.clean()