Skip to content

Commit

Permalink
add: generalize stoichiometry for all outputs thanks to cclib 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Sep 7, 2018
1 parent 26c8af5 commit 0743d88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion devtools/conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
pip install apscheduler cclib flask flask-sslify markdown gunicorn requests GitHub-Flask requests_oauthlib
pip install apscheduler 'cclib>=1.6' flask flask-sslify markdown gunicorn requests GitHub-Flask requests_oauthlib
$PYTHON setup.py install
2 changes: 1 addition & 1 deletion docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ during the templating:
extension.
- ``{{ filename }}``: Filename, with extension.
- ``{{ filepath }}``: Full path to the file.
- ``{{ stoichiometry }}``. (Gaussian only).
- ``{{ stoichiometry }}``. Self-explanatory.
- ``{{ imaginary_freqs }}``: Number of negative frequencies.
- ``{{ mean_of_electrons }}``: Mean of ``alphaelectrons`` and
``betaelectrons``.
Expand Down
2 changes: 1 addition & 1 deletion environment-pymol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- libglu
- pip:
- apscheduler
- cclib
- cclib>=1.6
- flask
- flask-sslify
- markdown
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies:
- numpy
- pip:
- apscheduler
- cclib
- cclib>=1.6
- flask
- flask-sslify
- markdown
Expand Down
8 changes: 6 additions & 2 deletions esigen/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ccDataExtended(ccData_optdone_bool):
_attributes = ccData_optdone_bool._attributes.copy()
_attributes.update(
{# Gaussian only
'stoichiometry': Attribute(str, 'stoichiometry', 'N/A'),
'solvent': Attribute(str, 'solvent', 'N/A'),
'thermalenergy': Attribute(float, 'electronic + thermal energies', 'N/A'),
'zeropointenergy': Attribute(float, 'electronic + zero-point energies', 'N/A'),
Expand All @@ -74,7 +73,7 @@ class ccDataExtended(ccData_optdone_bool):
})
_attrlist = sorted(_attributes.keys())
_properties = ['mean_of_electrons', 'atoms', 'coordinates', 'electronic_energy',
'imaginary_freqs', 'cartesians', 'nsteps']
'imaginary_freqs', 'cartesians', 'nsteps', 'stoichiometry']

def as_dict(self):
"""
Expand Down Expand Up @@ -117,6 +116,11 @@ def nsteps(self):
if hasattr(self, 'scfenergies'):
return self.scfenergies.shape[0]

@property
def stoichiometry(self):
from cclib.method import Nuclear
return Nuclear(self).stoichiometry()

@property
def has_coordinates(self):
return hasattr(self, 'atomnos') and hasattr(self, 'atomcoords')
Expand Down

0 comments on commit 0743d88

Please sign in to comment.