Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build_nwx_buildenv_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ jobs:
docker tag nwx_buildenv:latest ghcr.io/nwchemex/nwx_buildenv:latest
docker push ghcr.io/nwchemex/nwx_buildenv:latest
shell: bash

6 changes: 3 additions & 3 deletions .github/workflows/check_formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install yapf
run: pip install yapf
- name: Install black
run: pip install black
shell: bash
- name: Check Python Formatting
run: yapf -r -q .
run: black --check .
shell: bash
6 changes: 3 additions & 3 deletions .github/workflows/deploy_nwx_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
jobs:
deploy_docs:
runs-on: ubuntu-latest
container:
container:
image: ghcr.io/nwchemex/nwx_buildenv:latest
steps:
- name: Fail if Target is Blank
Expand All @@ -44,7 +44,7 @@ jobs:
# These next two steps will configure CMake if required
- name: Configure Only Docs
if: |
inputs.generate_module_docs == false &&
inputs.generate_module_docs == false &&
inputs.doc_target != 'Sphinx'
run: |
cmake -Bbuild -H. -GNinja -DBUILD_DOCS=ON -DONLY_BUILD_DOCS=ON
Expand Down Expand Up @@ -90,4 +90,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
publish_dir: ./docs/build/html
publish_dir: ./docs/build/html
7 changes: 3 additions & 4 deletions .github/workflows/test_nwx_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ on:
type: boolean
required: false
default: true



jobs:
test_build_docs:
runs-on: ubuntu-latest
container:
container:
image: ghcr.io/nwchemex/nwx_buildenv:latest
steps:
- name: Fail if Target is Blank
Expand Down Expand Up @@ -73,4 +73,3 @@ jobs:
fi
make html SPHINXOPTS="${SPHINX_OPTS}"
shell: bash

2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docutils<=0.16
sphinx
sphinx_rtd_theme
sphinxcontrib.bibtex
sphinx_tabs
sphinxcontrib.bibtex
56 changes: 29 additions & 27 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

# -- Project information -----------------------------------------------------

project = u'Developer Documentation'
copyright = u'2020, NWChemEx Team'
author = u'NWChemEx Team'
project = "Developer Documentation"
copyright = "2020, NWChemEx Team"
author = "NWChemEx Team"

# TODO: get version from git
version = '1.0.0'
version = "1.0.0"

# The full version, including alpha/beta/rc tags
release = version
Expand All @@ -48,40 +48,45 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax',
'sphinxcontrib.bibtex', 'sphinx_tabs.tabs'
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinxcontrib.bibtex",
"sphinx_tabs.tabs",
]
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']
# 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'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
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'
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'
pygments_style = "sphinx"

numfig = True

Expand All @@ -90,18 +95,18 @@
# 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_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 = {'vcs_pageview_mode': 'edit'}
html_theme_options = {"vcs_pageview_mode": "edit"}

# 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']
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -115,32 +120,29 @@

# Allows the edit on GitHub button to make editing the docs easier.
html_context = {
'display_github': True,
'github_user': 'NWChemEx',
'github_repo': '.github',
'github_version': 'master/docs/source/',
"display_github": True,
"github_user": "NWChemEx",
"github_repo": ".github",
"github_version": "master/docs/source/",
}

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
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',
Expand All @@ -160,8 +162,8 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# -- Options for bibtex --------------------------------------------------------
# -- Options for bibtex ------------------------------------------------------

bibtex_bibfiles = ['bibliography/software.bib']
bibtex_reference_style = 'super'
bibtex_default_style = 'plain'
bibtex_bibfiles = ["bibliography/software.bib"]
bibtex_reference_style = "super"
bibtex_default_style = "plain"
4 changes: 2 additions & 2 deletions docs/source/conventions/file_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ File Naming Conventions
files should be "lower_snake_case", i.e., all lowercase letters, underscores
for separating words.
- It is strongly recommended you stick to letters, numbers, and underscores
only. Notably avoid symbols like ``*``, ``?``, ``(``, ``)``, ``'``,
only. Notably avoid symbols like ``*``, ``?``, ``(``, ``)``, ``'``,
and ``"``.

Extensions
Expand All @@ -61,7 +61,7 @@ Extensions
- C++ source files end with ``*.cpp``, e.g., ``file_name.cpp``.
- C++ inline implementation files end with ``*.ipp``, e.g., ``file_name.ipp``.
- CMake modules end with ``*.cmake``, e.g., ``file_name.cmake``.
- (GitHub-flavored) Markdown end with ``*.md``, e.g., ``file_name.md``.
- (GitHub-flavored) Markdown end with ``*.md``, e.g., ``file_name.md``.
- Python source files end with ``.py``, e.g., ``file_name.py``.
- ReStructured Text files end with ``.rst``, e.g., ``file_name.py``.

Expand Down
21 changes: 10 additions & 11 deletions docs/source/testing/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Writing Integration Tests for NWChemEx
######################################

NWChemEx is a modular ecosystem designed with separation of concerns as a key
design point. An example of this separation can be found with the
SCF, integrals, ChemCache libraries. These components of NWX are linked by
SimDE and are intended to be used together, but are not explicitly required for
the development of the other (see :numref:`fig_deps_chart`). The unit tests for
these libraries are intended to ensure basic functionality and correctness,
which can usually be accomplished with simple test data that allow the unit
tests to run quickly.
design point. An example of this separation can be found with the
SCF, integrals, ChemCache libraries. These components of NWX are linked by
SimDE and are intended to be used together, but are not explicitly required for
the development of the other (see :numref:`fig_deps_chart`). The unit tests for
these libraries are intended to ensure basic functionality and correctness,
which can usually be accomplished with simple test data that allow the unit
tests to run quickly.

.. _fig_deps_chart:

Expand All @@ -38,8 +38,8 @@ tests to run quickly.
within NWChemEx. Arrows point from a dependency to the dependent library.


With that said, the initial development and testing of the SCF becomes very
awkward when one is unable to easily acquire real integrals for real molecular
With that said, the initial development and testing of the SCF becomes very
awkward when one is unable to easily acquire real integrals for real molecular
systems. Additionally, changes to the integrals code could have deleterious
effects on the SCF code, which we would like to detect before merging. For these
(and other) reasons, it can be useful to implement integration tests to ensure
Expand All @@ -56,7 +56,7 @@ don't break interoperability with the others.
:scale: 50 %

A diagram illustrating the relationship between the integration tests, the
library they test, and the top-level NWChemEx library. Arrows point from a
library they test, and the top-level NWChemEx library. Arrows point from a
dependency to the dependent library.


Expand Down Expand Up @@ -149,4 +149,3 @@ needed by a module in our project.
def setUp(self):
self.mm = ModuleManager()
nwchemex.load_modules(mm) # Also loads out SCF modules

24 changes: 12 additions & 12 deletions docs/source/testing/unit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
Writing Unit Tests for NWChemEx
###############################

Within the first party NWChemEx libraries, we aim for extensive unit testing to
Within the first party NWChemEx libraries, we aim for extensive unit testing to
ensure functionality and correctness. All classes, functions, and modules added
to any of the first party libraries will be expected to have corresponding unit
tests. Testing of functions (as well as Plugin modules) should minimally ensure
that all return routes and errors are checked. Tests for classes should do the
same for all member functions, while additionally testing that the state of all
tests. Testing of functions (as well as Plugin modules) should minimally ensure
that all return routes and errors are checked. Tests for classes should do the
same for all member functions, while additionally testing that the state of all
instances is consistent at construction and after modifications. Generally, the
unit tests should be able to run quickly, and use simplified data with the
unit tests should be able to run quickly, and use simplified data with the
minimum level of complexity need to ensure completeness in the testing.

The C++ unit tests use the `Catch2 framework <https://github.com/catchorg/Catch2>`_,
while python tests use the `unittest framework <https://docs.python.org/3/library/unittest.html>`_.
Assume the following class and related comparison function are intended to be
Assume the following class and related comparison function are intended to be
added to one of the first party libraries:

.. tabs::
Expand All @@ -51,12 +51,12 @@ added to one of the first party libraries:
ToBeTested(value_type a_value = 0) : my_value_(a_value) {}

value_type check_my_value() { return my_value_; }

void change_my_value(value_type new_value) {
if(new_value == 13) throw std::runtime_error("Unlucky Number");
my_value_ = new_value;
}

bool operator==(const ToBeTested& rhs) const noexcept {
return my_value_ == rhs.my_value_;
}
Expand All @@ -74,14 +74,14 @@ added to one of the first party libraries:

class ToBeTested():

def __init__(self, a_value = 0):
def __init__(self, a_value = 0):
self.__my_value = a_value

def check_my_value(self):
return self.__my_value

def change_my_value(self, new_value):
if new_value == 13:
if new_value == 13:
raise RuntimeError("Unlucky Number")
self.__my_value = new_value

Expand Down Expand Up @@ -112,8 +112,8 @@ An example unit test for the above looks like:
REQUIRE(with_value == ToBeTested(3));
REQUIRE_FALSE(defaulted == with_value);
}
SECTION("operator!=") {
REQUIRE(defaulted != with_value);
SECTION("operator!=") {
REQUIRE(defaulted != with_value);
}
}

Expand Down
5 changes: 3 additions & 2 deletions nwx_build_environment/scripts/generate_module_dox.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import glob
import sys
import importlib
import os
import sys

"""This script will generate the module api documentation for a plugin library.

Usage
Expand Down