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

Molecule declares extras dictionary as Dict[str, Any] but value can be None #303

Closed
awvwgk opened this issue Feb 15, 2023 · 0 comments · Fixed by #305
Closed

Molecule declares extras dictionary as Dict[str, Any] but value can be None #303

awvwgk opened this issue Feb 15, 2023 · 0 comments · Fixed by #305

Comments

@awvwgk
Copy link
Contributor

awvwgk commented Feb 15, 2023

Describe the bug

The Molecule class declares the extras dictionary as Dict[str, Any] but initializes its value with None.

To Reproduce

>>> import qcelemental as qcel
>>> mol = qcel.models.Molecule(["H", "H"], [[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]])
>>> mol.extras
None

Expected behavior

An empty dictionary if extras are not initialized.

Additional context

An easy workaround is

>>> extras = mol.extras if mol.extras is not None else {}
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.

1 participant