From 5bcf0ffb84f94e7cd7d45271047cc65ffaa55486 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Wed, 29 Nov 2023 10:54:07 -0600 Subject: [PATCH 01/18] Create the skeleton --- CMakeLists.txt | 118 ++++++++++++++++++ src/python/structurefinder/__init__.py | 0 src/python/structurefinder/chemisttools.py | 0 .../structurefinder/optimizer_modules.py | 0 .../python/unit_tests/test_structurefinder.py | 37 ++++++ 5 files changed, 155 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/python/structurefinder/__init__.py create mode 100644 src/python/structurefinder/chemisttools.py create mode 100644 src/python/structurefinder/optimizer_modules.py create mode 100644 tests/python/unit_tests/test_structurefinder.py diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..093a2b3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,118 @@ +# Copyright 2022 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.14) +set(VERSION 1.0.0) #TODO: get from git +project(structurefinder VERSION "${VERSION}" LANGUAGES CXX) + +include(FetchContent) +FetchContent_Declare( + nwx_cmake + GIT_REPOSITORY https://github.com/NWChemEx-Project/NWXCMake +) +FetchContent_MakeAvailable(nwx_cmake) +list(APPEND CMAKE_MODULE_PATH "${nwx_cmake_SOURCE_DIR}/cmake") + +set( + CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake" + CACHE STRING "" FORCE +) + +include(get_cmaize) +include(nwx_versions) + +### Options ### +option(BUILD_TESTING "Should we build the tests?" OFF) +option(BUILD_PYBIND11_PYBINDINGS "Use Pybind11 to build Python bindings?" ON) +option(ENABLE_NWCHEM "Should we build supporf for friend: NWChem ?" ON) + +## Build StructureFinder's dependencies ## +cpp_find_or_build_dependency( + nwchemex + URL github.com/NWChemEx-Project/NWChemEx + PRIVATE TRUE + VERSION ${NWX_SIMDE_VERSION} + BUILD_TARGET nwchemex + FIND_TARGET nwx::nwchemex + CMAKE_ARGS BUILD_TESTING=OFF +) + +if("${NWX_MODULE_DIRECTORY}" STREQUAL "") + message( + FATAL_ERROR "NWX_MODULE_DIRECTORY must be set to the directory " + "where you would like the Python modules installed." + ) +endif() + + +if("${BUILD_TESTING}") + include(CTest) + include(nwx_pybind11) + +# override +function(nwx_pybind11_tests npt_name npt_driver) + if(NOT "${BUILD_PYBIND11_PYBINDINGS}") + return() + endif() + + set(_npt_options "") + set(_npt_one_val "") + set(_npt_lists SUBMODULES) + cmake_parse_arguments( + "_npt" "${_npt_options}" "${_npt_one_val}" "${_npt_lists}" ${ARGN} + ) + + if("${BUILD_TESTING}") + include(CTest) + find_package(Python COMPONENTS Interpreter REQUIRED) + + # Build the PYTHONPATH for the test + set(_npt_py_path "PYTHONPATH=${NWX_MODULE_DIRECTORY}") + set(_npt_py_path "${_npt_py_path}:${CMAKE_BINARY_DIR}") + foreach(_npt_submod ${_npt_SUBMODULES}) + set(_npt_dep_dir "${CMAKE_BINARY_DIR}/_deps/${_npt_submod}-build") + set(_npt_py_path "${_npt_py_path}:${_npt_dep_dir}") + endforeach() + if(NOT "${NWX_PYTHON_EXTERNALS}" STREQUAL "") + set(_npt_py_path "${_npt_py_path}:${NWX_PYTHON_EXTERNALS}") + endif() + + add_test( + NAME "${npt_name}" + COMMAND "${Python_EXECUTABLE}" "${npt_driver}" + ) + + set_tests_properties( + "${npt_name}" + PROPERTIES ENVIRONMENT "${_npt_py_path}" + ) + endif() +endfunction() + +# + + set(PYTHON_TEST_DIR "${CMAKE_CURRENT_LIST_DIR}/tests/python") + + message("calling nwx_pybind11_tests") + nwx_pybind11_tests( + pyStructureFinder_unit_tests + "${PYTHON_TEST_DIR}/unit_tests/test_structurefinder.py" + SUBMODULES nwchemex simde chemist pluginplay parallelzone + ) +endif() + +install( + DIRECTORY "${python_src_directory}/structurefinder" + DESTINATION "${NWX_MODULE_DIRECTORY}" +) diff --git a/src/python/structurefinder/__init__.py b/src/python/structurefinder/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/python/structurefinder/chemisttools.py b/src/python/structurefinder/chemisttools.py new file mode 100644 index 0000000..e69de29 diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/python/unit_tests/test_structurefinder.py b/tests/python/unit_tests/test_structurefinder.py new file mode 100644 index 0000000..9cce8f6 --- /dev/null +++ b/tests/python/unit_tests/test_structurefinder.py @@ -0,0 +1,37 @@ +# +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import parallelzone as pz +import sys +import unittest + + + +if __name__ == '__main__': + rv = pz.runtime.RuntimeView() + + my_dir = os.path.dirname(os.path.realpath(__file__)) + root_dir = os.path.dirname(os.path.dirname(os.path.dirname(my_dir))) + src_dir = os.path.join(root_dir, 'src', 'python') + sys.path.append(src_dir) + + loader = unittest.TestLoader() + tests = loader.discover(my_dir) + testrunner = unittest.runner.TextTestRunner() + ret = not testrunner.run(tests).wasSuccessful() + sys.exit(ret) + From 435ec6d6d0e491f4ef301452aa96613513e6ca67 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Wed, 29 Nov 2023 11:51:44 -0600 Subject: [PATCH 02/18] Added chemisttools, scipy optimizer and tests --- src/python/structurefinder/chemisttools.py | 209 ++++++++++++++++++ .../structurefinder/optimizer_modules.py | 32 +++ tests/python/unit_tests/test_chemisttools.py | 33 +++ 3 files changed, 274 insertions(+) create mode 100644 tests/python/unit_tests/test_chemisttools.py diff --git a/src/python/structurefinder/chemisttools.py b/src/python/structurefinder/chemisttools.py index e69de29..b482665 100644 --- a/src/python/structurefinder/chemisttools.py +++ b/src/python/structurefinder/chemisttools.py @@ -0,0 +1,209 @@ +import chemist +import itertools + +element_symbols = [ + 'X', 'H', 'He', + 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', + 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar' + 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', + 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe' +] + +atomic_masses = [ + 0.0, # Dummy + 1.0079, # Hydrogen + 4.0026, # Helium + 6.94, # Lithium + 9.0122, # Beryllium + 10.81, # Boron + 12.011, # Carbon + 14.007, # Nitrogen + 15.999, # Oxygen + 18.998, # Fluorine + 20.180, # Neon + 22.990, # Sodium + 24.305, # Magnesium + 26.982, # Aluminium + 28.085, # Silicon + 30.974, # Phosphorus + 32.06, # Sulfur + 35.45, # Chlorine + 39.948, # Argon + 39.098, # Potassium + 40.078, # Calcium + 44.956, # Scandium + 47.867, # Titanium + 50.942, # Vanadium + 51.996, # Chromium + 54.938, # Manganese + 55.845, # Iron + 58.933, # Cobalt + 58.693, # Nickel + 63.546, # Copper + 65.38, # Zinc + 69.723, # Gallium + 72.630, # Germanium + 74.922, # Arsenic + 78.971, # Selenium + 79.904, # Bromine + 83.798, # Krypton + 85.468, # Rubidium + 87.62, # Strontium + 88.906, # Yttrium + 91.224, # Zirconium + 92.906, # Niobium + 95.95, # Molybdenum + 97.907, # Technetium + 101.07, # Ruthenium + 102.91, # Rhodium + 106.42, # Palladium + 107.87, # Silver + 112.41, # Cadmium + 114.82, # Indium + 118.71, # Tin + 121.76, # Antimony + 127.60, # Tellurium + 126.90, # Iodine + 131.29 # Xenon +] + +def get_periodic_table(): + """Return the periodic table as a list. + Returns + ------- + element_symbols : list of str + + Notes + ----- + Up to elements with atomic number 54 (Xenon). + """ + return element_symbols + + +def get_symbol(atomic_number): + """Returns the element symbol for a given atomic number. + + Parameters + ---------- + atomic_number : int + Atomic number of the element + + Returns + ------- + symbol : str + Element symbol + + Notes + ----- + Returns 'X' for atomic_number=0 + >>> print(get_symbol(1)) + H + """ + return element_symbols[atomic_number] + + +def get_atomic_number(symbol): + """Return the atomic number for a given element symbol. + + Parameters + ---------- + symbol : str + Element symbol (case insensitive) + + Returns + ------- + atomic_number : int + Atomic number of the element + >>> print(get_atomic_number('H')) + 1 + """ + symbol = symbol.capitalize() + return element_symbols.index(symbol) + + +def get_coordinates(mol): + """Return the coordinates of a molecule as a list of lists. + + Parameters + ---------- + mol : chemist.Molecule + chemist.Molecule object + + Returns + ------- + coordinates : list of lists + List of lists containing the coordinates of the atoms in the molecule. + The inner lists contain the x, y, and z coordinates of each atom. + """ + return [[mol.at(i).x, mol.at(i).y, mol.at(i).z] for i in range(mol.size())] + +def get_symbols(mol): + """Return the symbols of a molecule as a list. + + Parameters + ---------- + mol : chemist.Molecule + chemist.Molecule object + + Returns + ------- + symbols : list of str + List of element symbols of the atoms in the molecule. + """ + natom = mol.size() + symbols = [] + for i in range(natom): + symbols.append(get_symbol(mol.at(i).Z)) + return symbols + +def get_atomic_mass(x): + """Return the atomic mass of an element or atom. + + Parameters + ---------- + x : str or int + Element symbol or atomic number + + Returns + ------- + mass : float + Atomic mass of the atom + """ + mass = 0.0 + if type(x) == str: + atomic_number = get_atomic_number(x) + mass = atomic_masses[atomic_number] + elif type(x) == int: + mass = atomic_masses[x] + else: + print("Error: Invalid input type") + return mass + +def get_molecule(symbols, coordinates): + """Return a chemist.Molecule object from a list of symbols and coordinates. + + Parameters + ---------- + symbols : list of str + List of element symbols + coordinates : list of lists of floats + List of lists containing the coordinates of the atoms in the molecule. + The inner lists contain the x, y, and z coordinates of each atom. + + Returns + ------- + mol : chemist.Molecule + chemist.Molecule object + """ + natom = len(symbols) + mol = chemist.Molecule() + if type(coordinates[0]) == list or type(coordinates[0]).startswith('np'): + coordinates = list(itertools.chain(*coordinates)) + for i in range(natom): + x, y, z = [float(x) for x in coordinates[3 * i:3 * i + 3]] + symbol = symbols[i] + atomic_number = get_atomic_number(symbol) + mass = get_atomic_mass(atomic_number) + atom = chemist.Atom(symbol, atomic_number, mass, x, y, z) + mol.push_back(atom) + return mol diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index e69de29..737918b 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -0,0 +1,32 @@ +import pluginplay as pp +import simde +import chemist +import .chemisttools as ct +import numpy as np +from scipy.optimize import minimize + +class scipy_optimizer(pp.ModuleBase): + """Optimization module based on scipy.optimize.minimize""" + ptype = simde.AOEnergy() + + def __init__(self): + pp.ModuleBase.__init__(self) + self.description(self.__doc__) + self.satisfies_property_type(self.ptype) + self.add_submodule(self.ptype, "AOEnergy") + + def run_(self, inputs, submods): + [aos, system_in] = self.ptype.unwrap_inputs(inputs) + mol = system_in.molecule + coords = ct.get_coordinates(mol) + symbols = ct.get_symbols(mol) + def _get_energy(coords): + m = ct.get_molecule(symbols, coords) + chem_sys = chemist.ChemicalSystem(m) + E = submods["AOEnergy"].run_as(self.ptype, aos, chem_sys) + return E + result = minimize(_get_energy, np.ravel(coords)) + E = result.fun + print('Energy: ', E) + r = self.results() + return self.ptype.wrap_results(r, E) \ No newline at end of file diff --git a/tests/python/unit_tests/test_chemisttools.py b/tests/python/unit_tests/test_chemisttools.py new file mode 100644 index 0000000..95134a3 --- /dev/null +++ b/tests/python/unit_tests/test_chemisttools.py @@ -0,0 +1,33 @@ +import structurefinder.chemisttools as ct +import unittest + +class Testpt2driver(unittest.TestCase): + + def test_get_coordinates(self): + mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + coords = ct.get_coordinates(mol) + self.assertEqual(coords, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + + def test_get_symbols(self): + mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + symbols = ct.get_symbols(mol) + self.assertEqual(symbols, ['H', 'H']) + + def test_get_molecule(self): + mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + self.assertEqual(mol.size(), 2) + self.assertEqual(mol.at(0).name, 'H') + self.assertEqual(mol.at(1).name, 'H') + self.assertEqual(mol.at(0).x, 0.0) + self.assertEqual(mol.at(0).y, 0.0) + self.assertEqual(mol.at(0).z, 0.0) + self.assertEqual(mol.at(1).x, 0.0) + self.assertEqual(mol.at(1).y, 0.0) + self.assertEqual(mol.at(1).z, 0.74) + + def test_get_symbol(self): + self.assertEqual(ct.get_symbol(1), 'H') + + def test_get_atomic_number(self): + self.assertEqual(ct.get_atomic_number('H'), 1) + From 36587e87e5e041b8f625513cb473626aa9f78f46 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Tue, 5 Dec 2023 01:13:03 -0600 Subject: [PATCH 03/18] Fixes for the format --- .../{chemisttools.py => chemist_tools.py} | 144 +++++++++--------- .../structurefinder/optimizer_modules.py | 9 +- tests/python/unit_tests/test_chemist_tools.py | 45 ++++++ tests/python/unit_tests/test_chemisttools.py | 33 ---- 4 files changed, 123 insertions(+), 108 deletions(-) rename src/python/structurefinder/{chemisttools.py => chemist_tools.py} (96%) create mode 100644 tests/python/unit_tests/test_chemist_tools.py delete mode 100644 tests/python/unit_tests/test_chemisttools.py diff --git a/src/python/structurefinder/chemisttools.py b/src/python/structurefinder/chemist_tools.py similarity index 96% rename from src/python/structurefinder/chemisttools.py rename to src/python/structurefinder/chemist_tools.py index b482665..f87ff05 100644 --- a/src/python/structurefinder/chemisttools.py +++ b/src/python/structurefinder/chemist_tools.py @@ -67,39 +67,28 @@ 131.29 # Xenon ] -def get_periodic_table(): - """Return the periodic table as a list. - Returns - ------- - element_symbols : list of str - - Notes - ----- - Up to elements with atomic number 54 (Xenon). - """ - return element_symbols - - -def get_symbol(atomic_number): - """Returns the element symbol for a given atomic number. +def get_atomic_mass(x): + """Return the atomic mass of an element or atom. Parameters ---------- - atomic_number : int - Atomic number of the element - + x : str or int + Element symbol or atomic number + Returns ------- - symbol : str - Element symbol - - Notes - ----- - Returns 'X' for atomic_number=0 - >>> print(get_symbol(1)) - H + mass : float + Atomic mass of the atom """ - return element_symbols[atomic_number] + mass = 0.0 + if type(x) == str: + atomic_number = get_atomic_number(x) + mass = atomic_masses[atomic_number] + elif type(x) == int: + mass = atomic_masses[x] + else: + print("Error: Invalid input type") + return mass def get_atomic_number(symbol): @@ -121,7 +110,37 @@ def get_atomic_number(symbol): return element_symbols.index(symbol) -def get_coordinates(mol): +def get_molecule(symbols, coordinates): + """Return a chemist.Molecule object from a list of symbols and coordinates. + + Parameters + ---------- + symbols : list of str + List of element symbols + coordinates : list of lists of floats + List of lists containing the coordinates of the atoms in the molecule. + The inner lists contain the x, y, and z coordinates of each atom. + + Returns + ------- + mol : chemist.Molecule + chemist.Molecule object + """ + natom = len(symbols) + mol = chemist.Molecule() + if type(coordinates[0]) == list or str(type(coordinates[0])).startswith('numpy'): + coordinates = list(itertools.chain(*coordinates)) + for i in range(natom): + x, y, z = [float(x) for x in coordinates[3 * i:3 * i + 3]] + symbol = symbols[i] + atomic_number = get_atomic_number(symbol) + mass = get_atomic_mass(atomic_number) + atom = chemist.Atom(symbol, atomic_number, mass, x, y, z) + mol.push_back(atom) + return mol + + +def get_molecule_coordinates(mol): """Return the coordinates of a molecule as a list of lists. Parameters @@ -137,7 +156,8 @@ def get_coordinates(mol): """ return [[mol.at(i).x, mol.at(i).y, mol.at(i).z] for i in range(mol.size())] -def get_symbols(mol): + +def get_molecule_symbols(mol): """Return the symbols of a molecule as a list. Parameters @@ -155,55 +175,39 @@ def get_symbols(mol): for i in range(natom): symbols.append(get_symbol(mol.at(i).Z)) return symbols - -def get_atomic_mass(x): - """Return the atomic mass of an element or atom. - Parameters - ---------- - x : str or int - Element symbol or atomic number +def get_periodic_table(): + """Return the periodic table as a list. Returns ------- - mass : float - Atomic mass of the atom - """ - mass = 0.0 - if type(x) == str: - atomic_number = get_atomic_number(x) - mass = atomic_masses[atomic_number] - elif type(x) == int: - mass = atomic_masses[x] - else: - print("Error: Invalid input type") - return mass + element_symbols : list of str -def get_molecule(symbols, coordinates): - """Return a chemist.Molecule object from a list of symbols and coordinates. + Notes + ----- + Up to elements with atomic number 54 (Xenon). + """ + return element_symbols + + +def get_symbol(atomic_number): + """Returns the element symbol for a given atomic number. Parameters ---------- - symbols : list of str - List of element symbols - coordinates : list of lists of floats - List of lists containing the coordinates of the atoms in the molecule. - The inner lists contain the x, y, and z coordinates of each atom. - + atomic_number : int + Atomic number of the element + Returns ------- - mol : chemist.Molecule - chemist.Molecule object + symbol : str + Element symbol + + Notes + ----- + Returns 'X' for atomic_number=0 + >>> print(get_symbol(1)) + H """ - natom = len(symbols) - mol = chemist.Molecule() - if type(coordinates[0]) == list or type(coordinates[0]).startswith('np'): - coordinates = list(itertools.chain(*coordinates)) - for i in range(natom): - x, y, z = [float(x) for x in coordinates[3 * i:3 * i + 3]] - symbol = symbols[i] - atomic_number = get_atomic_number(symbol) - mass = get_atomic_mass(atomic_number) - atom = chemist.Atom(symbol, atomic_number, mass, x, y, z) - mol.push_back(atom) - return mol + return element_symbols[atomic_number] + diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index 737918b..b92721c 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -1,7 +1,7 @@ import pluginplay as pp import simde import chemist -import .chemisttools as ct +from . import chemist_tools as ct import numpy as np from scipy.optimize import minimize @@ -13,13 +13,13 @@ def __init__(self): pp.ModuleBase.__init__(self) self.description(self.__doc__) self.satisfies_property_type(self.ptype) - self.add_submodule(self.ptype, "AOEnergy") + self.add_submodule(simde.AOEnergy(), "AOEnergy") def run_(self, inputs, submods): [aos, system_in] = self.ptype.unwrap_inputs(inputs) mol = system_in.molecule - coords = ct.get_coordinates(mol) - symbols = ct.get_symbols(mol) + coords = ct.get_molecule_coordinates(mol) + symbols = ct.get_molecule_symbols(mol) def _get_energy(coords): m = ct.get_molecule(symbols, coords) chem_sys = chemist.ChemicalSystem(m) @@ -27,6 +27,5 @@ def _get_energy(coords): return E result = minimize(_get_energy, np.ravel(coords)) E = result.fun - print('Energy: ', E) r = self.results() return self.ptype.wrap_results(r, E) \ No newline at end of file diff --git a/tests/python/unit_tests/test_chemist_tools.py b/tests/python/unit_tests/test_chemist_tools.py new file mode 100644 index 0000000..f77b5af --- /dev/null +++ b/tests/python/unit_tests/test_chemist_tools.py @@ -0,0 +1,45 @@ +import structurefinder.chemist_tools as ct +import unittest + +class Test_chemist_tools(unittest.TestCase): + def setUp(self): + self.mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + + def test_get_atomic_mass(self): + self.assertEqual(ct.get_atomic_mass(1), 1.0079) + self.assertEqual(ct.get_atomic_mass('H'), 1.0079) + self.assertEqual(ct.get_atomic_mass(6), 12.011) + self.assertEqual(ct.get_atomic_mass('C'), 12.011) + + def test_get_atomic_number(self): + self.assertEqual(ct.get_atomic_number('H'), 1) + self.assertEqual(ct.get_atomic_number('C'), 6) + + def test_get_molecule(self): + self.assertEqual(self.mol.size(), 2) + self.assertEqual(self.mol.at(0).name, 'H') + self.assertEqual(self.mol.at(1).name, 'H') + self.assertEqual(self.mol.at(0).x, 0.0) + self.assertEqual(self.mol.at(0).y, 0.0) + self.assertEqual(self.mol.at(0).z, 0.0) + self.assertEqual(self.mol.at(1).x, 0.0) + self.assertEqual(self.mol.at(1).y, 0.0) + self.assertEqual(self.mol.at(1).z, 0.74) + + def test_get_molecule_coordinates(self): + coords = ct.get_molecule_coordinates(self.mol) + self.assertEqual(coords, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + + def test_get_molecule_symbols(self): + symbols = ct.get_molecule_symbols(self.mol) + self.assertEqual(symbols, ['H', 'H']) + + def test_get_periodic_table(self): + pt = ct.get_periodic_table() + self.assertEqual(len(pt), 54) + self.assertEqual(pt[1], 'H') + self.assertEqual(pt[6], 'C') + + def test_get_symbol(self): + self.assertEqual(ct.get_symbol(1), 'H') + self.assertEqual(ct.get_symbol(6), 'C') \ No newline at end of file diff --git a/tests/python/unit_tests/test_chemisttools.py b/tests/python/unit_tests/test_chemisttools.py deleted file mode 100644 index 95134a3..0000000 --- a/tests/python/unit_tests/test_chemisttools.py +++ /dev/null @@ -1,33 +0,0 @@ -import structurefinder.chemisttools as ct -import unittest - -class Testpt2driver(unittest.TestCase): - - def test_get_coordinates(self): - mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) - coords = ct.get_coordinates(mol) - self.assertEqual(coords, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) - - def test_get_symbols(self): - mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) - symbols = ct.get_symbols(mol) - self.assertEqual(symbols, ['H', 'H']) - - def test_get_molecule(self): - mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) - self.assertEqual(mol.size(), 2) - self.assertEqual(mol.at(0).name, 'H') - self.assertEqual(mol.at(1).name, 'H') - self.assertEqual(mol.at(0).x, 0.0) - self.assertEqual(mol.at(0).y, 0.0) - self.assertEqual(mol.at(0).z, 0.0) - self.assertEqual(mol.at(1).x, 0.0) - self.assertEqual(mol.at(1).y, 0.0) - self.assertEqual(mol.at(1).z, 0.74) - - def test_get_symbol(self): - self.assertEqual(ct.get_symbol(1), 'H') - - def test_get_atomic_number(self): - self.assertEqual(ct.get_atomic_number('H'), 1) - From 38175f3f228ab2768aa113d6d95572aa8658cf94 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Tue, 5 Dec 2023 01:13:22 -0600 Subject: [PATCH 04/18] Add test for optimizer --- .../unit_tests/test_optimizer_modules.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/python/unit_tests/test_optimizer_modules.py diff --git a/tests/python/unit_tests/test_optimizer_modules.py b/tests/python/unit_tests/test_optimizer_modules.py new file mode 100644 index 0000000..75deffe --- /dev/null +++ b/tests/python/unit_tests/test_optimizer_modules.py @@ -0,0 +1,23 @@ +import structurefinder.chemist_tools as ct +from structurefinder.optimizer_modules import scipy_optimizer +import unittest +import nwchemex +import pluginplay as pp +import simde +import chemist + +class Test_scipy_optimizer(unittest.TestCase): + def setUp(self): + self.mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + self.mm = pp.ModuleManager() + nwchemex.load_modules(self.mm) + mod_key = 'scipy_optimizer' + self.mm.add_module(mod_key, scipy_optimizer()) + + def test_scf(self): + self.mm.change_submod('scipy_optimizer', 'AOEnergy', 'SCF Energy') + bs = self.mm.at("sto-3g").run_as(simde.MolecularBasisSet(), self.mol) + aos = chemist.AOSpaceD(bs) + cs1 = chemist.ChemicalSystem(self.mol) + energy = self.mm.at("scipy_optimizer").run_as(simde.AOEnergy(), aos, cs1) + self.assertAlmostEqual(energy, -1.0787343257869195, places=5) From 59a8fd522ff2ddda76432f1386962da2f3917a8e Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Tue, 5 Dec 2023 17:34:29 -0600 Subject: [PATCH 05/18] Update optimizer modules --- .../structurefinder/optimizer_modules.py | 55 +++++++++++++++---- .../unit_tests/test_optimizer_modules.py | 46 +++++++++++----- 2 files changed, 75 insertions(+), 26 deletions(-) diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index b92721c..afce07b 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -1,19 +1,20 @@ -import pluginplay as pp -import simde -import chemist +from pluginplay import ModuleBase +from simde import AOEnergy, Energy, MolecularBasisSet +from chemist import AOSpaceD, ChemicalSystem from . import chemist_tools as ct -import numpy as np +from numpy import ravel from scipy.optimize import minimize -class scipy_optimizer(pp.ModuleBase): - """Optimization module based on scipy.optimize.minimize""" - ptype = simde.AOEnergy() +class Scipy_optimizer_aoenergy(ModuleBase): + """Optimization module based on scipy.optimize.minimize. + Satisfies simde.AOEnergy property type.""" + ptype = AOEnergy() def __init__(self): - pp.ModuleBase.__init__(self) + ModuleBase.__init__(self) self.description(self.__doc__) self.satisfies_property_type(self.ptype) - self.add_submodule(simde.AOEnergy(), "AOEnergy") + self.add_submodule(AOEnergy(), "AOEnergy") def run_(self, inputs, submods): [aos, system_in] = self.ptype.unwrap_inputs(inputs) @@ -22,10 +23,42 @@ def run_(self, inputs, submods): symbols = ct.get_molecule_symbols(mol) def _get_energy(coords): m = ct.get_molecule(symbols, coords) - chem_sys = chemist.ChemicalSystem(m) + chem_sys = ChemicalSystem(m) E = submods["AOEnergy"].run_as(self.ptype, aos, chem_sys) return E - result = minimize(_get_energy, np.ravel(coords)) + result = minimize(_get_energy, ravel(coords)) + E = result.fun + r = self.results() + return self.ptype.wrap_results(r, E) + + +class Scipy_optimizer_energy(ModuleBase): + """Optimization module based on scipy.optimize.minimize. Satisfies + simde.Energy property type. Has two submodules that satisfy + simde.MolecularBasisSet and simde.AOEnergy property types. + """ + ptype = Energy() + + def __init__(self): + ModuleBase.__init__(self) + self.description(self.__doc__) + self.satisfies_property_type(self.ptype) + self.add_submodule(MolecularBasisSet(), "MolecularBasisSet") + self.add_submodule(AOEnergy(), "AOEnergy") + + def run_(self, inputs, submods): + system_in, = self.ptype.unwrap_inputs(inputs) + mol = system_in.molecule + coords = ct.get_molecule_coordinates(mol) + symbols = ct.get_molecule_symbols(mol) + aobasis = submods["MolecularBasisSet"].run_as(MolecularBasisSet(), mol) + aos = AOSpaceD(aobasis) + def _get_energy(coords): + m = ct.get_molecule(symbols, coords) + chem_sys = ChemicalSystem(m) + E = submods["AOEnergy"].run_as(AOEnergy(), aos, chem_sys) + return E + result = minimize(_get_energy, ravel(coords)) E = result.fun r = self.results() return self.ptype.wrap_results(r, E) \ No newline at end of file diff --git a/tests/python/unit_tests/test_optimizer_modules.py b/tests/python/unit_tests/test_optimizer_modules.py index 75deffe..6758ae0 100644 --- a/tests/python/unit_tests/test_optimizer_modules.py +++ b/tests/python/unit_tests/test_optimizer_modules.py @@ -1,23 +1,39 @@ import structurefinder.chemist_tools as ct -from structurefinder.optimizer_modules import scipy_optimizer +from structurefinder.optimizer_modules import Scipy_optimizer_aoenergy, Scipy_optimizer_energy import unittest -import nwchemex -import pluginplay as pp -import simde -import chemist +from nwchemex import load_modules +from pluginplay import ModuleManager +from simde import AOEnergy, Energy, MolecularBasisSet +from chemist import AOSpaceD, ChemicalSystem -class Test_scipy_optimizer(unittest.TestCase): +class Test_scipy_optimizer_aoenergy(unittest.TestCase): def setUp(self): self.mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) - self.mm = pp.ModuleManager() - nwchemex.load_modules(self.mm) - mod_key = 'scipy_optimizer' - self.mm.add_module(mod_key, scipy_optimizer()) + self.mm = ModuleManager() + load_modules(self.mm) + self.mod_key = 'scipy_optimizer_aoenergy' + self.mm.add_module(self.mod_key, Scipy_optimizer_aoenergy()) def test_scf(self): - self.mm.change_submod('scipy_optimizer', 'AOEnergy', 'SCF Energy') - bs = self.mm.at("sto-3g").run_as(simde.MolecularBasisSet(), self.mol) - aos = chemist.AOSpaceD(bs) - cs1 = chemist.ChemicalSystem(self.mol) - energy = self.mm.at("scipy_optimizer").run_as(simde.AOEnergy(), aos, cs1) + self.mm.change_submod(self.mod_key, 'AOEnergy', 'SCF Energy') + bs = self.mm.at("sto-3g").run_as(MolecularBasisSet(), self.mol) + aos = AOSpaceD(bs) + chem_sys = ChemicalSystem(self.mol) + energy = self.mm.at(self.mod_key).run_as(AOEnergy(), aos, chem_sys) + self.assertAlmostEqual(energy, -1.0787343257869195, places=5) + + +class Test_scipy_optimizer_energy(unittest.TestCase): + def setUp(self): + self.mol = ct.get_molecule(['H', 'H'], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.74]]) + self.mm = ModuleManager() + load_modules(self.mm) + self.mod_key = 'scipy_optimizer_energy' + self.mm.add_module(self.mod_key, Scipy_optimizer_energy()) + + def test_scf(self): + self.mm.change_submod(self.mod_key, 'AOEnergy', 'SCF Energy') + self.mm.change_submod(self.mod_key, 'MolecularBasisSet', 'sto-3g') + chem_sys = ChemicalSystem(self.mol) + energy = self.mm.at(self.mod_key).run_as(Energy(), chem_sys) self.assertAlmostEqual(energy, -1.0787343257869195, places=5) From df5075367ddb73da2ce4e4be649ecd87d589e04c Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Tue, 5 Dec 2023 17:35:39 -0600 Subject: [PATCH 06/18] Add CI workflows --- .github/workflows/merge.yaml | 29 +++++++++++++++++++++++++++ .github/workflows/pull_request.yaml | 31 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/merge.yaml create mode 100644 .github/workflows/pull_request.yaml diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml new file mode 100644 index 0000000..9b82bf9 --- /dev/null +++ b/.github/workflows/merge.yaml @@ -0,0 +1,29 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: .github Merge Workflow + +on: + push: + branches: + - master + +jobs: + Common-Merge: + uses: NWChemEx-Project/.github/.github/workflows/common_merge.yaml@master + with: + doc_target: 'Sphinx' + generate_module_docs: false + secrets: inherit diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..9e36852 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,31 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: .github Pull Request Workflow + +on: + pull_request: + branches: + - master + +jobs: + Common-Pull-Request: + uses: NWChemEx-Project/.github/.github/workflows/common_pull_request.yaml@master + with: + config_file: '.github/.licenserc.yaml' + source_dir: '' + compilers: '' + doc_target: 'Sphinx' + secrets: inherit From f55d94e564db1eb7e9ffb23988b3eac2e41a1490 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Tue, 5 Dec 2023 17:45:01 -0600 Subject: [PATCH 07/18] Add requirements.txt file for dependencies --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6bad103 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy +scipy From b1aad792f4bac41d4f797bc99bc61618474a8364 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Dec 2023 23:54:26 +0000 Subject: [PATCH 08/18] Committing clang-format changes --- .github/workflows/merge.yaml | 17 +++++++++++++++++ .github/workflows/pull_request.yaml | 17 +++++++++++++++++ src/python/structurefinder/__init__.py | 17 +++++++++++++++++ src/python/structurefinder/chemist_tools.py | 17 +++++++++++++++++ src/python/structurefinder/optimizer_modules.py | 17 +++++++++++++++++ tests/python/unit_tests/test_chemist_tools.py | 17 +++++++++++++++++ .../python/unit_tests/test_optimizer_modules.py | 17 +++++++++++++++++ tests/python/unit_tests/test_structurefinder.py | 17 +++++++++++++++++ 8 files changed, 136 insertions(+) diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 9b82bf9..2715f12 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # Copyright 2023 NWChemEx-Project # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 9e36852..3be9fca 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # Copyright 2023 NWChemEx-Project # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python/structurefinder/__init__.py b/src/python/structurefinder/__init__.py index e69de29..2456923 100644 --- a/src/python/structurefinder/__init__.py +++ b/src/python/structurefinder/__init__.py @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + diff --git a/src/python/structurefinder/chemist_tools.py b/src/python/structurefinder/chemist_tools.py index f87ff05..bc501cf 100644 --- a/src/python/structurefinder/chemist_tools.py +++ b/src/python/structurefinder/chemist_tools.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + import chemist import itertools diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index afce07b..26d3b2c 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + from pluginplay import ModuleBase from simde import AOEnergy, Energy, MolecularBasisSet from chemist import AOSpaceD, ChemicalSystem diff --git a/tests/python/unit_tests/test_chemist_tools.py b/tests/python/unit_tests/test_chemist_tools.py index f77b5af..60321ff 100644 --- a/tests/python/unit_tests/test_chemist_tools.py +++ b/tests/python/unit_tests/test_chemist_tools.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + import structurefinder.chemist_tools as ct import unittest diff --git a/tests/python/unit_tests/test_optimizer_modules.py b/tests/python/unit_tests/test_optimizer_modules.py index 6758ae0..d63779f 100644 --- a/tests/python/unit_tests/test_optimizer_modules.py +++ b/tests/python/unit_tests/test_optimizer_modules.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + import structurefinder.chemist_tools as ct from structurefinder.optimizer_modules import Scipy_optimizer_aoenergy, Scipy_optimizer_energy import unittest diff --git a/tests/python/unit_tests/test_structurefinder.py b/tests/python/unit_tests/test_structurefinder.py index 9cce8f6..71dfc19 100644 --- a/tests/python/unit_tests/test_structurefinder.py +++ b/tests/python/unit_tests/test_structurefinder.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + # # Copyright 2023 NWChemEx-Project # From 8e5de71e3e2627d80b28a4c656693d1f462cb19f Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Wed, 6 Dec 2023 12:04:40 -0600 Subject: [PATCH 09/18] Add license config file --- .github/.licenserc.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/.licenserc.yaml diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml new file mode 100644 index 0000000..ab17f9e --- /dev/null +++ b/.github/.licenserc.yaml @@ -0,0 +1,29 @@ +# Copyright 2021 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +header: + license: + spdx-id: Apache-2.0 + copyright-owner: NWChemEx-Project + + paths-ignore: + - .github/ + - docs/Makefile + - LICENSE + - docs/requirements.txt + - docs/source/bibliography/*.bib + - version.txt + - cmake/friends.py.in + + comment: never From ab1a5494b3a5d6d10ac7b2fa792519486000761b Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Wed, 6 Dec 2023 23:47:44 -0600 Subject: [PATCH 10/18] Remove license headers --- CMakeLists.txt | 14 -------- src/python/structurefinder/__init__.py | 17 +--------- src/python/structurefinder/chemist_tools.py | 17 ---------- .../structurefinder/optimizer_modules.py | 17 ---------- tests/python/unit_tests/test_chemist_tools.py | 17 ---------- .../unit_tests/test_optimizer_modules.py | 17 ---------- .../python/unit_tests/test_structurefinder.py | 33 ------------------- 7 files changed, 1 insertion(+), 131 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 093a2b3..2a0e089 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,3 @@ -# Copyright 2022 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - cmake_minimum_required(VERSION 3.14) set(VERSION 1.0.0) #TODO: get from git project(structurefinder VERSION "${VERSION}" LANGUAGES CXX) diff --git a/src/python/structurefinder/__init__.py b/src/python/structurefinder/__init__.py index 2456923..139597f 100644 --- a/src/python/structurefinder/__init__.py +++ b/src/python/structurefinder/__init__.py @@ -1,17 +1,2 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. + diff --git a/src/python/structurefinder/chemist_tools.py b/src/python/structurefinder/chemist_tools.py index bc501cf..f87ff05 100644 --- a/src/python/structurefinder/chemist_tools.py +++ b/src/python/structurefinder/chemist_tools.py @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - import chemist import itertools diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index 26d3b2c..afce07b 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - from pluginplay import ModuleBase from simde import AOEnergy, Energy, MolecularBasisSet from chemist import AOSpaceD, ChemicalSystem diff --git a/tests/python/unit_tests/test_chemist_tools.py b/tests/python/unit_tests/test_chemist_tools.py index 60321ff..f77b5af 100644 --- a/tests/python/unit_tests/test_chemist_tools.py +++ b/tests/python/unit_tests/test_chemist_tools.py @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - import structurefinder.chemist_tools as ct import unittest diff --git a/tests/python/unit_tests/test_optimizer_modules.py b/tests/python/unit_tests/test_optimizer_modules.py index d63779f..6758ae0 100644 --- a/tests/python/unit_tests/test_optimizer_modules.py +++ b/tests/python/unit_tests/test_optimizer_modules.py @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - import structurefinder.chemist_tools as ct from structurefinder.optimizer_modules import Scipy_optimizer_aoenergy, Scipy_optimizer_energy import unittest diff --git a/tests/python/unit_tests/test_structurefinder.py b/tests/python/unit_tests/test_structurefinder.py index 71dfc19..2046292 100644 --- a/tests/python/unit_tests/test_structurefinder.py +++ b/tests/python/unit_tests/test_structurefinder.py @@ -1,36 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - import os import parallelzone as pz import sys From 5e5c8a2a0b6426a0a658378cf18662d1d60808b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Dec 2023 05:48:59 +0000 Subject: [PATCH 11/18] Committing clang-format changes --- README.md | 16 ++++++++++++++++ src/python/structurefinder/__init__.py | 14 +++++++++++++- src/python/structurefinder/chemist_tools.py | 14 ++++++++++++++ src/python/structurefinder/optimizer_modules.py | 14 ++++++++++++++ tests/python/unit_tests/test_chemist_tools.py | 14 ++++++++++++++ .../python/unit_tests/test_optimizer_modules.py | 14 ++++++++++++++ tests/python/unit_tests/test_structurefinder.py | 14 ++++++++++++++ 7 files changed, 99 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f2c16b..f69af32 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ + + # StructureFinder Repo for geometry optimization, transition states, etc. Much of this repo will be Python based, providing interfaces to geomeTRIC, pyBerny, ASE NEB, etc. diff --git a/src/python/structurefinder/__init__.py b/src/python/structurefinder/__init__.py index 139597f..4851bf4 100644 --- a/src/python/structurefinder/__init__.py +++ b/src/python/structurefinder/__init__.py @@ -1,2 +1,14 @@ - +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/python/structurefinder/chemist_tools.py b/src/python/structurefinder/chemist_tools.py index f87ff05..c5423ae 100644 --- a/src/python/structurefinder/chemist_tools.py +++ b/src/python/structurefinder/chemist_tools.py @@ -1,3 +1,17 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import chemist import itertools diff --git a/src/python/structurefinder/optimizer_modules.py b/src/python/structurefinder/optimizer_modules.py index afce07b..af37cf4 100644 --- a/src/python/structurefinder/optimizer_modules.py +++ b/src/python/structurefinder/optimizer_modules.py @@ -1,3 +1,17 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from pluginplay import ModuleBase from simde import AOEnergy, Energy, MolecularBasisSet from chemist import AOSpaceD, ChemicalSystem diff --git a/tests/python/unit_tests/test_chemist_tools.py b/tests/python/unit_tests/test_chemist_tools.py index f77b5af..d5d3b83 100644 --- a/tests/python/unit_tests/test_chemist_tools.py +++ b/tests/python/unit_tests/test_chemist_tools.py @@ -1,3 +1,17 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import structurefinder.chemist_tools as ct import unittest diff --git a/tests/python/unit_tests/test_optimizer_modules.py b/tests/python/unit_tests/test_optimizer_modules.py index 6758ae0..3793d4b 100644 --- a/tests/python/unit_tests/test_optimizer_modules.py +++ b/tests/python/unit_tests/test_optimizer_modules.py @@ -1,3 +1,17 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import structurefinder.chemist_tools as ct from structurefinder.optimizer_modules import Scipy_optimizer_aoenergy, Scipy_optimizer_energy import unittest diff --git a/tests/python/unit_tests/test_structurefinder.py b/tests/python/unit_tests/test_structurefinder.py index 2046292..e4e554f 100644 --- a/tests/python/unit_tests/test_structurefinder.py +++ b/tests/python/unit_tests/test_structurefinder.py @@ -1,3 +1,17 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import parallelzone as pz import sys From c7dc2317810921bca8d8b846017bbadd6d17da1f Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 00:15:55 -0600 Subject: [PATCH 12/18] Remove old license headers --- .github/.licenserc.yaml | 14 ------------- .github/workflows/merge.yaml | 32 ----------------------------- .github/workflows/pull_request.yaml | 32 ----------------------------- 3 files changed, 78 deletions(-) diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml index ab17f9e..98318b9 100644 --- a/.github/.licenserc.yaml +++ b/.github/.licenserc.yaml @@ -1,17 +1,3 @@ -# Copyright 2021 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# header: license: spdx-id: Apache-2.0 diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 2715f12..883e863 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -1,35 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: .github Merge Workflow on: diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 3be9fca..b1213ad 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -1,35 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Copyright 2023 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: .github Pull Request Workflow on: From 9950d759a3d91cab99b7610a0a259d1f04bd5532 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 00:30:40 -0600 Subject: [PATCH 13/18] Add docs placeholder --- docs/Makefile | 20 +++++ docs/README.md | 2 + docs/requirements.txt | 4 + docs/source/conf.py | 174 ++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 3 + 5 files changed, 203 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/README.md create mode 100644 docs/requirements.txt create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..50f4f85 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = structurefinder +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..505ffa0 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,2 @@ +General instructions for building documentation found throughout the NWChemEx project are available at: +https://github.com/NWChemEx-Project/NWChemEx/blob/master/docs/README.md diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..414087a --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +sphinx +sphinx_rtd_theme==1.3.0 +sphinxcontrib-bibtex +sphinx_tabs diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..176f6ee --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,174 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +import os +import sys + +# -- Project information ----------------------------------------------------- + +project = u'structurefinder' +copyright = u'2023, NWChemEx Team' +author = u'NWChemEx Team' + +# Get the version from version.txt +version = '1.0.0' +# The full version, including alpha/beta/rc tags +release = version + +# -- General configuration --------------------------------------------------- + +# We use numref which is introduced in Sphinx 1.3 +needs_sphinx = '1.3' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx_tabs.tabs', + 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', + 'sphinx.ext.mathjax', 'sphinx.ext.githubpages', 'autoapi.extension' +] +dir_path = os.path.dirname(os.path.realpath(__file__)) +doc_path = os.path.dirname(dir_path) +root_path = os.path.dirname(doc_path) + +# Add any paths that contain templates here, relative to this directory. +#templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# Should figures be numbered? +numfig = True + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = project + 'doc' + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, project + '.tex', project + ' Documentation', author, + 'manual'), +] + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [(master_doc, project.lower(), project + ' Documentation', + [author], 1)] + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, project, project + ' Documentation', author, project, + 'One line description of project.', 'Miscellaneous'), +] + +# -- Extension configuration ------------------------------------------------- +autoapi_dirs = ['../../src', '../../tests'] +autoapi_add_toctree_entry = False + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} + +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..ee9a044 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,3 @@ +############### +StructureFinder +############### From b314c88d3579bea5b4074b8394e7503ac0c4dd0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Dec 2023 06:31:43 +0000 Subject: [PATCH 14/18] Committing clang-format changes --- docs/README.md | 16 ++++++++++++++++ docs/source/index.rst | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/docs/README.md b/docs/README.md index 505ffa0..d4af8f8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,2 +1,18 @@ + + General instructions for building documentation found throughout the NWChemEx project are available at: https://github.com/NWChemEx-Project/NWChemEx/blob/master/docs/README.md diff --git a/docs/source/index.rst b/docs/source/index.rst index ee9a044..72af3c0 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,3 +1,17 @@ +.. Copyright 2023 NWChemEx-Project +.. +.. Licensed under the Apache License, Version 2.0 (the "License"); +.. you may not use this file except in compliance with the License. +.. You may obtain a copy of the License at +.. +.. http://www.apache.org/licenses/LICENSE-2.0 +.. +.. Unless required by applicable law or agreed to in writing, software +.. distributed under the License is distributed on an "AS IS" BASIS, +.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +.. See the License for the specific language governing permissions and +.. limitations under the License. + ############### StructureFinder ############### From 2081ebf9335b1fa3938bffb4457c2fe79507ca2a Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 08:59:41 -0600 Subject: [PATCH 15/18] Remove obsolete options --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a0e089..4f928d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,15 +20,13 @@ include(nwx_versions) ### Options ### option(BUILD_TESTING "Should we build the tests?" OFF) -option(BUILD_PYBIND11_PYBINDINGS "Use Pybind11 to build Python bindings?" ON) -option(ENABLE_NWCHEM "Should we build supporf for friend: NWChem ?" ON) ## Build StructureFinder's dependencies ## cpp_find_or_build_dependency( nwchemex URL github.com/NWChemEx-Project/NWChemEx PRIVATE TRUE - VERSION ${NWX_SIMDE_VERSION} + VERSION master BUILD_TARGET nwchemex FIND_TARGET nwx::nwchemex CMAKE_ARGS BUILD_TESTING=OFF From 642da7e0c600e70fdf4cb4cc8859b5a5e8f23dd5 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 09:06:37 -0600 Subject: [PATCH 16/18] Remove NWX_MODULE_DIRECTORY check --- CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f928d3..2532ba1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,14 +32,6 @@ cpp_find_or_build_dependency( CMAKE_ARGS BUILD_TESTING=OFF ) -if("${NWX_MODULE_DIRECTORY}" STREQUAL "") - message( - FATAL_ERROR "NWX_MODULE_DIRECTORY must be set to the directory " - "where you would like the Python modules installed." - ) -endif() - - if("${BUILD_TESTING}") include(CTest) include(nwx_pybind11) From 8b235c6eae9c8209d5a931ebe24667c1b3fe57b5 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 09:20:27 -0600 Subject: [PATCH 17/18] Add sphinx-autoapi to requirements --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 414087a..caba9ec 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,4 @@ sphinx sphinx_rtd_theme==1.3.0 sphinxcontrib-bibtex sphinx_tabs +sphinx-autoapi From 5e0a3c5d733fb74a9fd94af23d4115155b502f64 Mon Sep 17 00:00:00 2001 From: Murat Keceli Date: Thu, 7 Dec 2023 09:35:12 -0600 Subject: [PATCH 18/18] Use sphinx-autoapi==3.0.0 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index caba9ec..c453480 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,4 +2,4 @@ sphinx sphinx_rtd_theme==1.3.0 sphinxcontrib-bibtex sphinx_tabs -sphinx-autoapi +sphinx-autoapi==3.0.0