Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Quantum Chemical Input Generators may raise KeyError: 'Theory' #1052

Closed
e-kwsm opened this issue Jul 24, 2022 · 7 comments · Fixed by #1136
Closed

i18n: Quantum Chemical Input Generators may raise KeyError: 'Theory' #1052

e-kwsm opened this issue Jul 24, 2022 · 7 comments · Fixed by #1136

Comments

@e-kwsm
Copy link
Contributor

e-kwsm commented Jul 24, 2022

Avogadro version: (please complete the following information from the About box):

  • Avogadrolibs: 1.96.0-218-g40daa16afe60
  • Qt: 5.15.5

Desktop version: (please complete the following information):

  • OS: EndeavourOS
  • Version: rolling
  • Compiler: GCC 12.1.0

Describe the bug
The Theory key is necessary for input generators that supports ab initio calculations to perform generateInput, but it is accidentally translated in some locales, resulting in KeyError.

To Reproduce

  1. Prepare He.xyz
1

He 0.0 0.0 0.0
  1. Open the file with LANG where Theory is translated, e.g., German: LANG=de_DE.UTF-8 avogadro2 He.xyz
  2. Select Eingabe (Input) and then DALTON...
  3. An error has occurred:
Error running script '/usr/bin/python3 /usr/lib/avogadro2/scripts/inputGenerators/dalton.py --generate-input --lang de_DE': Abnormal exit status 1 (Unbekannter Fehler.: Unbekannter Fehler)

Output:
Traceback (most recent call last):
  File "/usr/lib/avogadro2/scripts/inputGenerators/dalton.py", line 198, in <module>
    print(json.dumps(generateInput()))
  File "/usr/lib/avogadro2/scripts/inputGenerators/dalton.py", line 156, in generateInput
    inp = generateInputFile(opts['cjson'], opts['options'])
  File "/usr/lib/avogadro2/scripts/inputGenerators/dalton.py", line 87, in generateInputFile
    theory = opts['Theory']
KeyError: 'Theory'

Here, JSON like below is passed to the generator, in which Theory is translated to Theorie:

{
  "Basis": "cc-pVDZ",
  "Calculation Type": "Optimize + Frequencies",
  "Filename Base": "job",
  "Functional": "B3LYP",
  "Theorie": "SCF",
  "Title": "job"
}

Debug Script… is not helpful because debug_info tab does not appear.
It works as expected under a locale where Theory is not translated, e.g., sv_SE.UTF-8.

The following generators have the issue:

  • DALTON
  • GAMESS-UK
  • Gaussian
  • MOLPRO
  • NWChem
  • ORCA
  • PYSCF
  • Psi
  • Q-Chem
  • TeraChem

MOPAC has Theory but is successful.

Expected behavior
Generators works without error.

Screenshots
If applicable, add screenshots to help explain your problem.
de_DE DALTON

Additional context
Add any other context about the problem here. Please consider uploading or linking test files.

@ghutchis
Copy link
Member

This should be fixed by #1037 - which is part of 1.97 release. Can you please try 1.97 release or a newer source / AppImage?

Thanks.

@e-kwsm
Copy link
Contributor Author

e-kwsm commented Jul 25, 2022

@e-kwsm
Copy link
Contributor Author

e-kwsm commented Jul 25, 2022

Basis is also translated under ja_JP.UTF-8.

@github-actions
Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Ubuntu-2004.tar.gz
Win64.exe
Artifacts will only be retained for 90 days.

@laitvo
Copy link

laitvo commented Oct 3, 2022

Hello,

I am experiencing the same issues. Would you please mind sharing the fixed AppImage files with me? Apparently I cannot access the artifacts any longer.

Many thanks!

@laitvo
Copy link

laitvo commented Oct 3, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants