-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix minor issues and include input writer in doc
- Loading branch information
Showing
8 changed files
with
126 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
SPHINX_APIDOC_OPTIONS=members,undoc-members,show-inheritance,inherited-members sphinx-apidoc -o pyapi/ ../iodata/ ../iodata/test/test_*.py ../iodata/test/cached --separate | ||
SPHINX_APIDOC_OPTIONS=members,undoc-members,show-inheritance,inherited-members sphinx-apidoc \ | ||
-a -o pyapi/ ../iodata/ --separate | ||
|
||
./gen_formats.py > formats.rst | ||
./gen_inputs.py > inputs.rst | ||
./gen_formats_tab.py > formats_tab.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/env python3 | ||
# IODATA is an input and output module for quantum chemistry. | ||
# Copyright (C) 2011-2019 The IODATA Development Team | ||
# | ||
# This file is part of IODATA. | ||
# | ||
# IODATA is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 3 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# IODATA is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, see <https://www.gnu.org/licenses/> | ||
# -- | ||
# pylint: disable=unused-argument,redefined-builtin | ||
"""Generate formats.rst.""" | ||
|
||
from gen_formats import _format_words, _print_section | ||
from iodata.api import INPUT_MODULES | ||
|
||
|
||
__all__ = [] | ||
|
||
|
||
HEADER = """ | ||
.. _input_formats: | ||
Supported Input Formats | ||
####################### | ||
""" | ||
|
||
|
||
def main(): | ||
"""Write inputs.rst to stdout.""" | ||
print(HEADER) | ||
for modname, module in sorted(INPUT_MODULES.items()): | ||
if not hasattr(module, "write_input"): | ||
continue | ||
lines = module.__doc__.split('\n') | ||
# add labels for cross-referencing format (e.g. in formats table) | ||
print(f".. _input_{modname}:") | ||
print() | ||
_print_section('{} (``{}``)'.format(lines[0][:-1], modname), "=") | ||
print() | ||
for line in lines[2:]: | ||
print(line) | ||
|
||
_print_section(":py:func:`iodata.formats.{}.write_input`".format(modname), "-") | ||
fn = getattr(module, "write_input", None) | ||
print("- Requires", _format_words(fn.required)) | ||
if fn.optional: | ||
print("- May use", _format_words(fn.optional)) | ||
if fn.kwdocs: | ||
print("- Keyword arguments", _format_words(fn.kwdocs)) | ||
if fn.notes: | ||
print() | ||
print(fn.notes) | ||
print() | ||
print() | ||
print() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ User Documentation | |
install | ||
getting_started | ||
formats | ||
inputs | ||
basis | ||
changelog | ||
acknowledgments | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters