diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml new file mode 100644 index 0000000..15b42a8 --- /dev/null +++ b/.github/.licenserc.yaml @@ -0,0 +1,28 @@ +# 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 + - docs/requirements.txt + - src/scf/common/ + - src/scf/scf/ + - LICENSE + + comment: never diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml new file mode 100644 index 0000000..76427cc --- /dev/null +++ b/.github/workflows/merge.yaml @@ -0,0 +1,29 @@ +# Copyright 2024 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/.github/.github/workflows/common_merge.yaml@master + with: + doc_target: 'nux_cxx_api' + generate_module_docs: true + secrets: inherit diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..e2c72a4 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,32 @@ +# Copyright 2024 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: + default_build: + uses: NWChemEx/.github/.github/workflows/common_pull_request.yaml@master + with: + config_file: '.github/.licenserc.yaml' + source_dir: '' + compilers: '["gcc-11"]' + doc_target: 'nux_cxx_api' + build_fail_on_warning: false + secrets: inherit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1513a8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,52 @@ +# Copyright 2024 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. + +# These are extensions commonly used to denote temporary files +*.tmp +*.autosave +*.bak + +# These are directories used by IDEs for storing settings +.idea/ +.vscode/ + +# These are common Python virtual enviornment directory names +venv/ +docs/venv/ + +# This is where Jupyter/IPython store backup files +.ipynb_checkpoints/ + +# Byte-compiled Python +__pycache__/ + +# These are common build directory names +build*/ +docs/build +docs/source/_build +docs/doxyoutput +docs/source/api +*-build-*/ +_build/ +Debug/ +Release/ + +# Users commonly store their specific CMake settings in a toolchain file +toolchain.cmake + +# These are the default names for the components of the cache +cache.db +uuid.db + +install/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1058e4d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,88 @@ +# Copyright 2024 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) + +# Downloads common CMake modules used throughout NWChemEx + +#Sets the version to whatever git thinks it is +#include(get_version_from_git) +#get_version_from_git(scf_version "${CMAKE_CURRENT_LIST_DIR}") +project(nux VERSION "1.0.0" LANGUAGES CXX) +include(cmake/get_nwx_cmake.cmake) +include(nwx_versions) +include(get_cmaize) +include(nwx_cxx_api_docs) + +set(NUX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") +set(NUX_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") +set(NUX_TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests") + +nwx_cxx_api_docs("${NUX_SOURCE_DIR}" "${NUX_INCLUDE_DIR}") + +### Options ### +cmaize_option_list( + BUILD_TESTING OFF "Should we build the tests?" + BUILD_PYBIND11_PYBINDINGS ON "Build Python bindings with pybind11?" + INTEGRATION_TESTING OFF "Should we build the integration tests?" +) + +set(DEPENDENCIES simde) + +foreach(dependency_i ${DEPENDENCIES}) + include(get_${dependency_i}) +endforeach() + +cmaize_add_library( + ${PROJECT_NAME} + SOURCE_DIR "${NUX_SOURCE_DIR}/cxx/nux" + INCLUDE_DIRS "${NUX_INCLUDE_DIR}/nux" + DEPENDS "${DEPENDENCIES}" +) + +include(nwx_pybind11) +nwx_add_pybind11_module( + ${PROJECT_NAME} + SOURCE_DIR "${NUX_SOURCE_DIR}/python" + DEPENDS "${PROJECT_NAME}" +) + +if("${BUILD_TESTING}") + include(CTest) + set(PYTHON_TEST_DIR "${NUX_TESTS_DIR}/python") + set(CXX_TEST_DIR "${NUX_TESTS_DIR}/cxx") + + include(get_catch2) + cmaize_add_tests( + unit_test_${PROJECT_NAME} + SOURCE_DIR "${CXX_TEST_DIR}/unit_tests" + INCLUDE_DIRS "${NUX_SOURCE_DIR}/cxx/nux" + DEPENDS Catch2 ${PROJECT_NAME} + ) + nwx_pybind11_tests( + py_unit_test_${PROJECT_NAME} + "${PYTHON_TEST_DIR}/unit_tests/run_unit_tests.py" + SUBMODULES nux simde chemist pluginplay parallelzone + ) + + if("${INTEGRATION_TESTING}") + include(get_nwchemex) + nwx_pybind11_tests( + py_integration_test_${PROJECT_NAME} + "${PYTHON_TEST_DIR}/integration_tests/run_integration_tests.py" + SUBMODULES nwchemex nux chemcache simde chemist pluginplay + parallelzone scf friendzone + ) + endif() +endif() diff --git a/README.md b/README.md index 382fabf..db0e24b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ -# NUX -NWChemEx User Experience (NUX): Tools, functions, etc. to facilitate user workflows + + +# NUX (NWChemEx User Experience) +Modules, tools, functions, etc. to facilitate a smoother user experience. diff --git a/cmake/get_nwx_cmake.cmake b/cmake/get_nwx_cmake.cmake new file mode 100644 index 0000000..2aec0e7 --- /dev/null +++ b/cmake/get_nwx_cmake.cmake @@ -0,0 +1,31 @@ +# Copyright 2024 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. + +include_guard() + +macro(get_nwx_cmake) + include(FetchContent) + FetchContent_Declare( + nwx_cmake + GIT_REPOSITORY https://github.com/NWChemEx/NWXCMake + ) + FetchContent_MakeAvailable(nwx_cmake) + set( + CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${nwx_cmake_SOURCE_DIR}/cmake" + CACHE STRING "" + FORCE + ) +endmacro() + +get_nwx_cmake() \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +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..1404108 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,18 @@ + + +General instructions for building documentation found throughout the NWChemEx project are available at: +https://github.com/NWChemEx/NWChemEx/blob/master/docs/README.md diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..2d6af23 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,49 @@ +rem Copyright 2024 NWChemEx-Project +rem +rem Licensed under the Apache License, Version 2.0 (the "License"); +rem you may not use this file except in compliance with the License. +rem You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..f283341 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +GitPython +sphinx +sphinx_rtd_theme +sphinx_tabs diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..08e84e1 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- +# 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. + +# +# 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 git + +# -- Project information ----------------------------------------------------- + +project = u'SCF' +copyright = u'2024, NWChemEx Team' +author = u'NWChemEx Team' + +############################################################################## +# Shouldn't need to change anything below this point # +############################################################################## + +# -- Project Paths ----------------------------------------------------------- + +dir_path = os.path.dirname(os.path.realpath(__file__)) +doc_path = os.path.dirname(dir_path) +root_path = os.path.dirname(doc_path) + +# -- Package Version --------------------------------------------------------- + +# Read the git tags, from ../../.git and find the most recent one +repo = git.Repo(root_path) +tags = sorted(repo.tags, key=lambda t: t.commit.committed_datetime) + +if len(tags): + last_tag = tags[-1] +else: + last_tag = "1.0.0" + +# This is the strictly numeric version (e.g., no "beta" qualifier) +version = str(last_tag) + +# This is the full version (includes qualifiers like "beta" or +# "release candidate") +release = version + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +needs_sphinx = '7.2.6' + +# 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.mathjax', + 'sphinx.ext.githubpages', + 'sphinx.ext.autosummary', + 'sphinx_rtd_theme', + # 'sphinxcontrib.bibtex', + 'sphinx_tabs.tabs', + 'sphinx.ext.intersphinx', +] + +# 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' + +numfig = True +numfig_secnum_depth = 0 + +# -- 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' + +# html_logo = "assets/logo.png" + +# 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 = {'logo_only': True} + +# 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 ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..344faad --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,24 @@ +.. 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. + +############################## +NUX (NWChemEx User Experience) +############################## + +.. toctree:: + :maxdepth: 2 + :caption: APIs: + + module_api/index + C++ API diff --git a/docs/source/module_api/index.rst b/docs/source/module_api/index.rst new file mode 100644 index 0000000..3f03cdb --- /dev/null +++ b/docs/source/module_api/index.rst @@ -0,0 +1,21 @@ +.. Copyright 2024 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. + +********** +Module API +********** + +.. toctree:: + :maxdepth: 1 + :caption: Packages \ No newline at end of file diff --git a/include/nux/nux.hpp b/include/nux/nux.hpp new file mode 100644 index 0000000..7fb9803 --- /dev/null +++ b/include/nux/nux.hpp @@ -0,0 +1,26 @@ +/* + * Copyright 2024 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. + */ + +#pragma once +#include + +namespace nux { +/** @brief Loads the modules contained in the NUX module collection into the + * provided ModuleManager instance. + */ +void load_modules(pluginplay::ModuleManager &mm); + +} // namespace nux diff --git a/src/cxx/nux/nux.cpp b/src/cxx/nux/nux.cpp new file mode 100644 index 0000000..5cead9b --- /dev/null +++ b/src/cxx/nux/nux.cpp @@ -0,0 +1,23 @@ +/* + * Copyright 2024 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. + */ + +#include + +namespace nux { + +void load_modules(pluginplay::ModuleManager &mm) {} + +} // namespace nux \ No newline at end of file diff --git a/src/python/nux/export_nux.cpp b/src/python/nux/export_nux.cpp new file mode 100644 index 0000000..b4930c3 --- /dev/null +++ b/src/python/nux/export_nux.cpp @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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. + */ + +#include +#include +#include + +namespace nux { + +EXPORT_PLUGIN(nux, m) {} + +} // namespace nux \ No newline at end of file diff --git a/tests/cxx/test_nux.hpp b/tests/cxx/test_nux.hpp new file mode 100644 index 0000000..0c9b662 --- /dev/null +++ b/tests/cxx/test_nux.hpp @@ -0,0 +1,21 @@ +/* + * Copyright 2024 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. + */ +#pragma once +#include +#include +#include + +namespace test_nux {} \ No newline at end of file diff --git a/tests/cxx/unit_tests/main.cpp b/tests/cxx/unit_tests/main.cpp new file mode 100644 index 0000000..20182f5 --- /dev/null +++ b/tests/cxx/unit_tests/main.cpp @@ -0,0 +1,27 @@ +/* + * Copyright 2024 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. + */ + +#define CATCH_CONFIG_RUNNER +#include +#include + +int main(int argc, char *argv[]) { + auto rt = parallelzone::runtime::RuntimeView(); + + int res = Catch::Session().run(argc, argv); + + return res; +} \ No newline at end of file diff --git a/tests/cxx/unit_tests/nux.cpp b/tests/cxx/unit_tests/nux.cpp new file mode 100644 index 0000000..faa865e --- /dev/null +++ b/tests/cxx/unit_tests/nux.cpp @@ -0,0 +1,22 @@ +/* + * Copyright 2024 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. + */ + +#include "../test_nux.hpp" +#include +TEST_CASE("load_plugin") { + pluginplay::ModuleManager mm; + nux::load_modules(mm); +} \ No newline at end of file diff --git a/tests/python/integration_tests/run_integration_tests.py b/tests/python/integration_tests/run_integration_tests.py new file mode 100644 index 0000000..869bae2 --- /dev/null +++ b/tests/python/integration_tests/run_integration_tests.py @@ -0,0 +1,30 @@ +# Copyright 2024 NWChemEx +# +# 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 nux +import parallelzone as pz +import sys +import os +import unittest + +if __name__ == '__main__': + rv = pz.runtime.RuntimeView() + + my_dir = os.path.dirname(os.path.realpath(__file__)) + + loader = unittest.TestLoader() + tests = loader.discover(my_dir) + testrunner = unittest.runner.TextTestRunner() + ret = not testrunner.run(tests).wasSuccessful() + + sys.exit(ret) diff --git a/tests/python/integration_tests/test_nux/__init__.py b/tests/python/integration_tests/test_nux/__init__.py new file mode 100644 index 0000000..15622f7 --- /dev/null +++ b/tests/python/integration_tests/test_nux/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 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/tests/python/integration_tests/test_nux/test_plugin.py b/tests/python/integration_tests/test_nux/test_plugin.py new file mode 100644 index 0000000..1828946 --- /dev/null +++ b/tests/python/integration_tests/test_nux/test_plugin.py @@ -0,0 +1,24 @@ +# Copyright 2024 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 ModuleManager +import nux +import unittest + + +class TestLoadModules(unittest.TestCase): + + def setUp(self): + self.mm = ModuleManager() + nux.load_modules(self.mm) diff --git a/tests/python/unit_tests/run_unit_tests.py b/tests/python/unit_tests/run_unit_tests.py new file mode 100644 index 0000000..869bae2 --- /dev/null +++ b/tests/python/unit_tests/run_unit_tests.py @@ -0,0 +1,30 @@ +# Copyright 2024 NWChemEx +# +# 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 nux +import parallelzone as pz +import sys +import os +import unittest + +if __name__ == '__main__': + rv = pz.runtime.RuntimeView() + + my_dir = os.path.dirname(os.path.realpath(__file__)) + + loader = unittest.TestLoader() + tests = loader.discover(my_dir) + testrunner = unittest.runner.TextTestRunner() + ret = not testrunner.run(tests).wasSuccessful() + + sys.exit(ret) diff --git a/tests/python/unit_tests/test_nux/__init__.py b/tests/python/unit_tests/test_nux/__init__.py new file mode 100644 index 0000000..15622f7 --- /dev/null +++ b/tests/python/unit_tests/test_nux/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 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/tests/python/unit_tests/test_nux/test_plugin.py b/tests/python/unit_tests/test_nux/test_plugin.py new file mode 100644 index 0000000..1828946 --- /dev/null +++ b/tests/python/unit_tests/test_nux/test_plugin.py @@ -0,0 +1,24 @@ +# Copyright 2024 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 ModuleManager +import nux +import unittest + + +class TestLoadModules(unittest.TestCase): + + def setUp(self): + self.mm = ModuleManager() + nux.load_modules(self.mm)