You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got a KeyError when running a simple example, based on examples provided within this repos:
pythonschool ❯ pyscf --dry-run pyscf_config.yaml
import numpy as np
import pyscf
results = {}
klass = Mole
Traceback (most recent call last):
File "/Users/simenkva/anaconda3/envs/pythonschool/bin/pyscf", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/simenkva/anaconda3/envs/pythonschool/lib/python3.11/site-packages/pyscfcli/cli.py", line 454, in main
result = task.result()
^^^^^^^^^^^^^
File "/Users/simenkva/anaconda3/envs/pythonschool/lib/python3.11/site-packages/pyscfcli/cli.py", line 435, in result
self.run()
File "/Users/simenkva/anaconda3/envs/pythonschool/lib/python3.11/site-packages/pyscfcli/cli.py", line 422, in run
ctx = handlers[klass](token, ctx)
~~~~~~~~^^^^^^^
KeyError: 'Mole'
I found that handlers is a dict with uppercase keys, but klass is not uppercase. The fix was to use handlers[klass.upper()](token, ctx), and now the program seems to work.
If this is the complete solution, I could fix it and submit a pull request...
The text was updated successfully, but these errors were encountered:
I got a KeyError when running a simple example, based on examples provided within this repos:
I found that
handlers
is a dict with uppercase keys, butklass
is not uppercase. The fix was to usehandlers[klass.upper()](token, ctx)
, and now the program seems to work.If this is the complete solution, I could fix it and submit a pull request...
The text was updated successfully, but these errors were encountered: