Skip to content

Commit

Permalink
Add missing thermochemistry contributions (#11)
Browse files Browse the repository at this point in the history
* add missing entropy contribution

* do not check for freq

* fix tests

* ... fix lint
  • Loading branch information
pierre-24 authored May 16, 2024
1 parent 737c9f1 commit c2df250
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 1 addition & 4 deletions qcip_tools/chemistry_files/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def gaussian__fchk__property__computed_energies(obj, *args, **kwargs):
"""Get the energies. Returns a dictionary of the energies at different level of approximation.
:param obj: object
:type obj: qcip_tools.chemistry_files.gaussian.FCHK
:type obj: qcip_tools.chemistry_files.gaussian.FCHK plots)
:rtype: dict
"""

Expand Down Expand Up @@ -776,9 +776,6 @@ def gaussian__fchk__property__geometrical_derivatives(obj, *args, **kwargs):
spacial_dof = 3 * len(obj.molecule)
trans_plus_rot_dof = 5 if obj.molecule.linear() else 6

if obj.calculation_type.lower() not in ['freq', 'force']:
raise PropertyNotPresent('geometrical_derivatives')

if 'Cartesian Gradient' in obj:
gradient = obj.get('Cartesian Gradient')

Expand Down
5 changes: 1 addition & 4 deletions tests/tests_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from tests import QcipToolsTestCase
from qcip_tools import derivatives_g, derivatives, derivatives_e, derivatives_exci
from qcip_tools.chemistry_files import gaussian, dalton, PropertyNotPresent, crystal
from qcip_tools.chemistry_files import gaussian, dalton, crystal


class PropertiesTestCase(QcipToolsTestCase):
Expand Down Expand Up @@ -459,9 +459,6 @@ def test_geometrical_derivatives(self):
with open(os.path.join(self.tests_files_directory, 'properties/computed_energies/gaussian_output.fchk')) as f:
fchk_file.read(f)

with self.assertRaises(PropertyNotPresent):
fchk_file.property('geometrical_derivatives')

gradient = fchk_file.get('Cartesian Gradient')
self.assertEqual(numpy.linalg.norm(gradient), .0)

Expand Down
4 changes: 1 addition & 3 deletions tests/tests_script_geometrical_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ def test_command(self):
stdout_t, stderr_t = process.communicate()

self.assertIsNotNone(stderr_t)
self.assertNotEqual(len(stderr_t), 0)
self.assertIsNotNone(stdout_t)
self.assertEqual(len(stdout_t), 0, msg=stdout_t.decode())

stdout_decoded = stdout_t.decode()

self.assertNotIn('gradient', stdout_decoded)
self.assertIn('gradient', stdout_decoded)
self.assertNotIn('hessian', stdout_decoded)

# with vibrational analysis
Expand Down

0 comments on commit c2df250

Please sign in to comment.