Skip to content

Add charge to stoichiometry method (and test) #2

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

Merged
merged 6 commits into from
Aug 5, 2016

Conversation

langner
Copy link

@langner langner commented Aug 2, 2016

No description provided.

@langner
Copy link
Author

langner commented Aug 3, 2016

The convenience method allows one to do this:

cclib/data/Gaussian/basicGaussian09$ python
>>> import cclib
>>> data = cclib.parser.ccopen('water_mp4.log').parse()
>>> data.stoichiometry()
'O1H2'

@jaimergp
Copy link
Owner

jaimergp commented Aug 3, 2016

That's cool! One thing though: do we want to be explicit when there's only one atom of a given element? I find the "1" after the O really weird...

@langner
Copy link
Author

langner commented Aug 3, 2016

Here you go. Also made it compliant with the Hill system, which I think is the standard.

@langner
Copy link
Author

langner commented Aug 5, 2016

Having it be a property makes it work more like an attribute:

cclib/data/Gaussian/basicGaussian09$ python
>>> import cclib
>>> data = cclib.parser.ccopen('water_mp4.log').parse()
>>> data.stoichiometry
'O1H2'

@jaimergp jaimergp merged commit c2cb942 into jaimergp:master Aug 5, 2016
@jaimergp
Copy link
Owner

jaimergp commented Aug 5, 2016

LGTM!

jaimergp pushed a commit that referenced this pull request Feb 2, 2018
Test shape of grads for all possible parsers.
@langner langner deleted the jaime branch February 10, 2019 17:36
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 this pull request may close these issues.

2 participants