Skip to content

Commit

Permalink
Merge pull request #130 from NWChemEx-Project/export_aoenergy
Browse files Browse the repository at this point in the history
Export AOEnergy property type
  • Loading branch information
keceli authored Oct 27, 2023
2 parents 60baa4e + 7674fa9 commit 7bf46ee
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
5 changes: 3 additions & 2 deletions include/simde/energy/energy_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ DECLARE_PROPERTY_TYPE(Energy);
//-------------------------------Implementations--------------------------------
PROPERTY_TYPE_INPUTS(Energy) {
using chem_sys_t = const type::chemical_system&;
auto rv = pluginplay::declare_input().add_field<chem_sys_t>("system");
rv["system"].set_description("The molecular system");
auto rv =
pluginplay::declare_input().add_field<chem_sys_t>("Chemical System");
rv["Chemical System"].set_description("The chemical system");
return rv;
}

Expand Down
4 changes: 4 additions & 0 deletions src/python/energy/export_energy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ inline void export_energy(python_module_reference m) {
EXPORT_PROPERTY_TYPE(Energy, m);
}

inline void export_aoenergy(python_module_reference m) {
EXPORT_PROPERTY_TYPE(AOEnergy, m);
}

} // namespace simde
1 change: 1 addition & 0 deletions src/python/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PYBIND11_MODULE(simde, m) {
"PySimDE: Python bindings for the Simulation development environment";

export_energy(m);
export_aoenergy(m);
export_molecular_basis_set(m);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cxx/unit/derivative/nuclear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

TEST_CASE("Nuclear Derivative Property Types") {
test_property_type<simde::AOEnergyNuclearGradient>(
{"AOs", "system", "Arg 1"}, {"Derivative"});
{"AOs", "Chemical System", "Arg 1"}, {"Derivative"});

test_property_type<simde::AOEnergyNuclearHessian>(
{"AOs", "system", "Arg 1", "Arg 2"}, {"Derivative"});
{"AOs", "Chemical System", "Arg 1", "Arg 2"}, {"Derivative"});
}
4 changes: 3 additions & 1 deletion tests/cxx/unit/energy/energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

using namespace simde;

TEST_CASE("Energy") { test_property_type<Energy>({"system"}, {"Energy"}); }
TEST_CASE("Energy") {
test_property_type<Energy>({"Chemical System"}, {"Energy"});
}
7 changes: 4 additions & 3 deletions tests/python/unit_tests/basis_set/test_basis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

import simde
import pluginplay
import unittest

class TestEnergy(unittest.TestCase):
class TestBasisSet(unittest.TestCase):
def test_molecular_basis_set_pt(self):
pt = simde.MolecularBasisSet()
self.assertIn('Molecule', pt.inputs())
self.assertIn('Molecular Basis Set', pt.results())
self.assertEqual(len(pt.inputs()), 1)
self.assertIn('Molecular Basis Set', pt.results())
self.assertEqual(len(pt.results()), 1)
10 changes: 9 additions & 1 deletion tests/python/unit_tests/energy/test_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
class TestEnergy(unittest.TestCase):
def test_energy_pt(self):
pt = simde.Energy()
self.assertIn('system', pt.inputs())
self.assertIn('Chemical System', pt.inputs())
self.assertIn('Energy', pt.results())

def test_aoenergy_pt(self):
pt = simde.AOEnergy()
self.assertIn('Chemical System', pt.inputs())
self.assertIn('AOs', pt.inputs())
self.assertEqual(len(pt.inputs()), 2)
self.assertIn('Energy', pt.results())
self.assertEqual(len(pt.results()), 1)

0 comments on commit 7bf46ee

Please sign in to comment.