Skip to content

Commit

Permalink
Add docstring for functions in export_psio
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodr committed Feb 12, 2018
1 parent 795cf62 commit 2e73573
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 36 deletions.
4 changes: 1 addition & 3 deletions .scripts/travis_print_failing.py
@@ -1,8 +1,6 @@
#!/usr/bin/env python
import re
import sys
import time
import subprocess


badtests = []
Expand All @@ -24,7 +22,7 @@
sys.stdout.write("""\n\n%s failed. Here is the output:\n""" % (bad))

badoutfile = bad
for oddity in ['pcmsolver', 'cfour', 'libefp', 'chemps2', 'dftd3', 'mrcc', 'psi4numpy',
for oddity in ['pcmsolver', 'cfour', 'libefp', 'chemps2', 'dftd3', 'mrcc', 'psi4numpy', 'python',
'cookbook', 'dkh', 'erd', 'gcp', 'gdma', 'simint', 'snsmp2', 'v2rdm_casscf']:
if bad.startswith(oddity):
badoutfile = oddity + '/' + bad
Expand Down
52 changes: 25 additions & 27 deletions psi4/src/export_psio.cc
Expand Up @@ -34,34 +34,32 @@ using namespace psi;

void export_psio(py::module &m) {
py::class_<PSIO, std::shared_ptr<PSIO> >(m, "IO", "docstring")
.def("state", &PSIO::state, "docstring")
.def("open", &PSIO::open, "docstring")
.def("close", &PSIO::close, "docstring")
.def("rehash", &PSIO::rehash, "docstring")
.def("open_check", &PSIO::open_check, "docstring")
.def("tocclean", &PSIO::tocclean,
"Delete all TOC entries after the given key. If a blank key is given, the entire TOC will be wiped")
.def("state", &PSIO::state, "Return 1 if PSIO library is activated")
.def("open", &PSIO::open, "Open unit. Status can be PSIO_OPEN_OLD (if existing file is to be opened) or PSIO_OPEN_NEW if new file should be open", py::arg("unit"), py::arg("status"))
.def("close", &PSIO::close, "Close unit. If keep == 0, will remove the file, else keep it", py::arg("unit"), py::arg("keep"))
.def("rehash", &PSIO::rehash, "Sync up the object to the file on disk by closing and opening the file, if necessary", py::arg("unit"))
.def("open_check", &PSIO::open_check, "Return 1 if unit is open", py::arg("unit"))
.def("tocclean", &PSIO::tocclean, "Delete all TOC entries after the given key. If a blank key is given, the entire TOC will be wiped", py::arg("unit"), py::arg("key"))
.def("tocprint", &PSIO::tocprint, "Print the table of contents for the given unit")
.def("tocentry_exists", &PSIO::tocentry_exists,
"Checks the TOC to see if a particular keyword exists there or not")
.def("tocentry_exists", &PSIO::tocentry_exists, "Checks the TOC to see if a particular keyword exists there or not")
.def("tocwrite", &PSIO::tocwrite, "Write the table of contents for passed file number")
.def("set_pid", &PSIO::set_pid, "docstring")
.def_static("shared_object", &PSIO::shared_object, "docstring")
.def_static("get_default_namespace", &PSIO::get_default_namespace, "docstring")
.def_static("set_default_namespace", &PSIO::set_default_namespace, py::arg("ns"), "docstring")
.def_static("change_file_namespace", &PSIO::change_file_namespace, py::arg("fileno"), py::arg("ns1"),
py::arg("ns2"), "docstring");
.def("getpid", &PSIO::getpid, "Lookup process id")
.def("set_pid", &PSIO::set_pid, "Set process id", py::arg("pid"))
.def_static("shared_object", &PSIO::shared_object, "Return the global shared object")
.def_static("get_default_namespace", &PSIO::get_default_namespace, "Get the default namespace (for PREFIX.NAMESPACE.UNIT file numbering)")
.def_static("set_default_namespace", &PSIO::set_default_namespace, "Set the current namespace (for PREFIX.NAMESPACE.UNIT file numbering)", py::arg("ns"))
.def_static("change_file_namespace", &PSIO::change_file_namespace, "Change file number from ns1 to ns2", py::arg("fileno"), py::arg("ns1"), py::arg("ns2"));

py::class_<PSIOManager, std::shared_ptr<PSIOManager> >(m, "IOManager", "docstring")
.def_static("shared_object", &PSIOManager::shared_object, "docstring")
.def("print_out", &PSIOManager::print_out, "docstring")
.def("psiclean", &PSIOManager::psiclean, "docstring")
.def("crashclean", &PSIOManager::crashclean, "docstring")
.def("mark_file_for_retention", &PSIOManager::mark_file_for_retention, "docstring")
.def("write_scratch_file", &PSIOManager::write_scratch_file, "docstring")
.def("set_default_path", &PSIOManager::set_default_path, "docstring")
.def("set_specific_path", &PSIOManager::set_specific_path, "docstring")
.def("get_file_path", &PSIOManager::get_file_path, "docstring")
.def("set_specific_retention", &PSIOManager::set_specific_retention, "docstring")
.def("get_default_path", &PSIOManager::get_default_path, "docstring");
py::class_<PSIOManager, std::shared_ptr<PSIOManager> >(m, "IOManager", "PSIOManager is a class designed to be used as a static object to track all PSIO operations in a given PSI4 computation")
.def_static("shared_object", &PSIOManager::shared_object, "The one and (should be) only instance of PSIOManager for a PSI4 instance")
.def("print_out", &PSIOManager::print_out, "Print the current status of PSI4 files")
.def("psiclean", &PSIOManager::psiclean, "Execute the psiclean protocol, deleting all recorded files, except those currently marked for retention")
.def("crashclean", &PSIOManager::crashclean, "Clean from disk-mirrored image after crash. NOT to be called during regular computation.")
.def("mark_file_for_retention", &PSIOManager::mark_file_for_retention, "Mark a file to be retained after a psiclean operation, ie for use in a later computation", py::arg("full_path"), py::arg("retain"))
.def("write_scratch_file", &PSIOManager::write_scratch_file, "Write a string to a temporary file. The scratch file is opened and closed by this function.", py::arg("full_path"), py::arg("text"))
.def("set_default_path", &PSIOManager::set_default_path, "Set the default path for files to be stored", py::arg("path"))
.def("set_specific_path", &PSIOManager::set_specific_path, "Set the path for specific file numbers", py::arg("fileno"), py::arg("path"))
.def("get_file_path", &PSIOManager::get_file_path, "Get the path for a specific file number", py::arg("fileno"))
.def("set_specific_retention", &PSIOManager::set_specific_retention, "Set the specific file number to be retained", py::arg("fileno"), py::arg("retain"))
.def("get_default_path", &PSIOManager::get_default_path, "Return the default path");
}
2 changes: 1 addition & 1 deletion psi4/src/psi4/libpsio/psio.hpp
Expand Up @@ -93,7 +93,7 @@ class PSIOManager {
*/
void set_specific_path(int fileno, const std::string& path);
/**
* Set the the specific file number to be retained
* Set the specific file number to be retained
* \param fileno PSI4 file number
* \param retain keep or not? (Allows override)
*/
Expand Down
3 changes: 1 addition & 2 deletions tests/CMakeLists.txt
Expand Up @@ -57,8 +57,7 @@ foreach(test_name adc1 adc2 casscf-fzc-sp casscf-semi casscf-sa-sp ao-casscf-sp
dft-freq dft-grad1 dft-grad2 dft-psivar dft-b3lyp dft1 dft-vv10
dft1-alt dft2 dft3 dft-omega docs-bases docs-dft extern1 extern2
fsapt1 fsapt2 fsapt-terms fsapt-allterms isapt1 isapt2
fci-dipole fci-h2o fci-h2o-2 fci-h2o-fzcv fci-tdm fci-tdm-2
fci-coverage fcidump
fci-dipole fci-h2o fci-h2o-2 fci-h2o-fzcv fci-tdm fci-tdm-2 fci-coverage
fd-freq-energy fd-freq-energy-large fd-freq-gradient
fd-freq-gradient-large fd-gradient freq-isotope fnocc1 fnocc2
fnocc3 fnocc4 frac frac-ip-fitting frac-traverse ghosts gibbs matrix1
Expand Down
3 changes: 0 additions & 3 deletions tests/fcidump/CMakeLists.txt

This file was deleted.

1 change: 1 addition & 0 deletions tests/python/CMakeLists.txt
Expand Up @@ -6,3 +6,4 @@ add_subdirectory(mints2)
add_subdirectory(cc54)
add_subdirectory(3-index-transforms)
add_subdirectory(JK_builds)
add_subdirectory(fcidump)
3 changes: 3 additions & 0 deletions tests/python/fcidump/CMakeLists.txt
@@ -0,0 +1,3 @@
include(TestingMacros)

add_regression_test(python-fcidump "psi;quicktests;smoketests;fcidump;python")
File renamed without changes.
File renamed without changes.

0 comments on commit 2e73573

Please sign in to comment.