PCMSolver / pcmsolver

An API for the Polarizable Continuum Model
http://pcmsolver.readthedocs.io/
GNU Lesser General Public License v3.0
32 stars 21 forks source link

clear keywords between jobs #182

Closed loriab closed 3 years ago

loriab commented 4 years ago

Expected Behavior

One should be able to launch pcmsolver twice independently. This would be useful, long-term, for psiapi mode.

Current Behavior

self = <pcmsolver.getkw.Section object at 0x7f0116562eb0>, kw = <pcmsolver.getkw.Keyword object at 0x7f01164f34c0>, set = True
    def add_kwkw(self, kw, set=False):
        if kw.name not in self.kw:
            self.kw[kw.name] = kw
        else:
            print('Error: Keyword "%s.%s" already defined!' % \
                    (self.name, kw.name))
>           sys.exit(1)
E           SystemExit: 1
../../../toolchainconda/envs/py38/lib/python3.8/site-packages/pcmsolver/getkw.py:121: SystemExit
--------------------------------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------------------------------
Error: Keyword "toplevel.UNITS" already defined!

Possible Solution

Steps to Reproduce (for bugs)

  1. try to run https://github.com/psi4/psi4/blob/master/tests/pytests/test_addons.py#L534 twice

Context

@robertodr knows about this issue and has taken a stab at solving it. It'd be useful if anyone wanted to run more than one pcm job from psi4 as a module, but there's no urgency.

Your Environment

loriab commented 3 years ago

I forgot I opened this. Fixed by #184