Commit 7d215bee authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Update file docstrings for C++ header files and standardize path names

parent 63884b07
......@@ -11,7 +11,7 @@
// 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 "mpi_interface/MPI_ops.hpp"
#include "mpi_interface/MPI_Ops.hpp"
// MPI_Op top_feats;
std::function<bool(const double*, const int, const double, const std::vector<node_sc_pair>&, const double)> mpi_reduce_op::IS_VALID;
......
......@@ -11,14 +11,16 @@
// 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.
/** @file mpi_interface/MPI_Ops.hpp
* @brief Define MPI reduce all operator to facilitate a distributed sorting algorithm
*
* This is based off of a project from Meisam Farzalipour Tabriz at the MPCDF (mpi_topk)
* @brief Define MPI reduce all operator to facilitate a distributed sorting algorithm
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*
* This is based off of a project from Meisam Farzalipour Tabriz at the MPCDF (mpi_topk)
*/
#ifndef SISSO_MPI_OPS
#define SISSO_MPI_OPS
......
......@@ -11,12 +11,14 @@
// 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.
/** @file feature_creation/parameterization/NLOptWrapper.hpp
* @brief Wrapper and functions to use libnlopt to find parameterizations for features
* @brief Defines a wrapper for NLopt library functions and functions for using the library
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef NL_OPT_WRAPPER
#define NL_OPT_WRAPPER
......
......@@ -21,7 +21,7 @@ void sisso::register_all()
sisso::descriptor_identifier::registerModelRegressor();
sisso::descriptor_identifier::registerModelLogRegressor();
sisso::descriptor_identifier::registerModelClassifier();
sisso::descriptor_identifier::registerSISSO_DI();
sisso::descriptor_identifier::registerSISSOSolver();
sisso::descriptor_identifier::registerSISSORegressor();
sisso::descriptor_identifier::registerSISSOLogRegressor();
sisso::descriptor_identifier::registerSISSOClassifier();
......@@ -1331,24 +1331,24 @@ void sisso::descriptor_identifier::registerModelClassifier()
;
}
void sisso::descriptor_identifier::registerSISSO_DI()
void sisso::descriptor_identifier::registerSISSOSolver()
{
class_<sisso::descriptor_identifier::SISSO_DI_Wrap, boost::noncopyable>("SISSO_DI", no_init)
.add_property("prop", &SISSO_DI::prop_py, "@DocString_sisso_di_prop_py@")
.add_property("prop_test", &SISSO_DI::prop_test_py, "@DocString_sisso_di_prop_test_py@")
.add_property("n_samp", &SISSO_DI::n_samp, "@DocString_sisso_di_n_samp@")
.add_property("n_dim", &SISSO_DI::n_dim, "@DocString_sisso_di_n_dim@")
.add_property("n_residual", &SISSO_DI::n_residual, "@DocString_sisso_di_n_residual@")
.add_property("n_models_store", &SISSO_DI::n_models_store, "@DocString_sisso_di_n_models_store@")
.add_property("feat_space", &SISSO_DI::feat_space, "@DocString_sisso_di_feat_space@")
.add_property("task_sizes_train", &SISSO_DI::task_sizes_train, "@DocString_sisso_di_task_sizes_train@")
.add_property("task_sizes_test", &SISSO_DI::task_sizes_test, "@DocString_sisso_di_task_sizes_test@")
class_<sisso::descriptor_identifier::SISSOSolver_Wrap, boost::noncopyable>("SISSOSolver", no_init)
.add_property("prop", &SISSOSolver::prop_py, "@DocString_sisso_di_prop_py@")
.add_property("prop_test", &SISSOSolver::prop_test_py, "@DocString_sisso_di_prop_test_py@")
.add_property("n_samp", &SISSOSolver::n_samp, "@DocString_sisso_di_n_samp@")
.add_property("n_dim", &SISSOSolver::n_dim, "@DocString_sisso_di_n_dim@")
.add_property("n_residual", &SISSOSolver::n_residual, "@DocString_sisso_di_n_residual@")
.add_property("n_models_store", &SISSOSolver::n_models_store, "@DocString_sisso_di_n_models_store@")
.add_property("feat_space", &SISSOSolver::feat_space, "@DocString_sisso_di_feat_space@")
.add_property("task_sizes_train", &SISSOSolver::task_sizes_train, "@DocString_sisso_di_task_sizes_train@")
.add_property("task_sizes_test", &SISSOSolver::task_sizes_test, "@DocString_sisso_di_task_sizes_test@")
;
}
void sisso::descriptor_identifier::registerSISSORegressor()
{
class_<SISSORegressor, bases<SISSO_DI>>(
class_<SISSORegressor, bases<SISSOSolver>>(
"SISSORegressor",
init<std::shared_ptr<FeatureSpace>, std::string, Unit, np::ndarray, np::ndarray, py::list, py::list, py::list, int, int, int, optional<bool>>(
(arg("self"), arg("feat_space"), arg("prop_label"), arg("prop_unit"), arg("prop"), arg("prop_test"), arg("task_sizes_train"), arg("task_sizes_test"), arg("leave_out_inds"), arg("n_dim"), arg("n_residual"), arg("n_models_store"), arg("fix_intercept")),
......@@ -1387,7 +1387,7 @@ void sisso::descriptor_identifier::registerSISSOLogRegressor()
void sisso::descriptor_identifier::registerSISSOClassifier()
{
class_<SISSOClassifier, bases<SISSO_DI>>(
class_<SISSOClassifier, bases<SISSOSolver>>(
"SISSOClassifier",
init<std::shared_ptr<FeatureSpace>, std::string, Unit, np::ndarray, np::ndarray, py::list, py::list, py::list, int, int, int>(
(arg("self"), arg("feat_space"), arg("prop_label"), arg("prop_unit"), arg("prop"), arg("prop_test"), arg("task_sizes_train"), arg("task_sizes_test"), arg("leave_out_inds"), arg("n_dim"), arg("n_residual"), arg("n_models_store")),
......
......@@ -11,17 +11,19 @@
// 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.
/** @file python/bindings.hpp
* @brief Definitions to convert C++ classes into python classes
* @brief Definitions to convert C++ classes into python classes
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef PYTHON_BINDING
#define PYTHON_BINDINGS
#include "descriptor_identifier/SISSO_DI/SISSOLogRegressor.hpp"
#include "descriptor_identifier/SISSO_DI/SISSOClassifier.hpp"
#include "descriptor_identifier/solver/SISSOLogRegressor.hpp"
#include "descriptor_identifier/solver/SISSOClassifier.hpp"
#include "python/py_binding_cpp_def/feature_creation/node_utils.hpp"
#ifdef PARAMETERIZE
#include "nl_opt/NLOptWrapper.hpp"
......@@ -534,7 +536,7 @@ namespace sisso
namespace descriptor_identifier
{
struct SISSO_DI_Wrap : SISSO_DI, py::wrapper<SISSO_DI>
struct SISSOSolver_Wrap : SISSOSolver, py::wrapper<SISSOSolver>
{
inline void l0_regularization(){this->get_override("l0_regularization")();}
inline void fit(){this->get_override("fit")();}
......@@ -568,7 +570,7 @@ namespace sisso
/**
* @brief Register the SISSORegressor object for conversion to a python object
*/
static void registerSISSO_DI();
static void registerSISSOSolver();
/**
* @brief Register the SISSORegressor object for conversion to a python object
......
......@@ -11,12 +11,14 @@
// 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.
/** @file python/py_binding_cpp_def/conversion_utils.hpp
* @brief A set of functions to convert std::vectors to and from python objects
* @brief Define a set of functions to convert std::vectors to and from python objects
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef UTILS_CONVERSION
#define UTILS_CONVERSION
......
......@@ -11,7 +11,7 @@
// 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 "descriptor_identifier/Model/Model.hpp"
#include "descriptor_identifier/model/Model.hpp"
np::ndarray Model::eval_many_py(np::ndarray x_in) const
{
......
......@@ -11,7 +11,7 @@
// 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 "descriptor_identifier/Model/ModelClassifier.hpp"
#include "descriptor_identifier/model/ModelClassifier.hpp"
ModelClassifier::ModelClassifier(const ModelClassifier& o, py::list new_coefs, np::ndarray prop_train_est, np::ndarray prop_test_est) :
Model(o),
......
......@@ -11,7 +11,7 @@
// 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 "descriptor_identifier/SISSO_DI/SISSOClassifier.hpp"
#include "descriptor_identifier/solver/SISSOClassifier.hpp"
SISSOClassifier::SISSOClassifier(
std::shared_ptr<FeatureSpace> feat_space,
......@@ -26,7 +26,7 @@ SISSOClassifier::SISSOClassifier(
int n_residual,
int n_models_store
) :
SISSO_DI(
SISSOSolver(
"classification",
feat_space,
prop_label,
......@@ -61,7 +61,7 @@ SISSOClassifier::SISSOClassifier(
int n_residual,
int n_models_store
) :
SISSO_DI(
SISSOSolver(
"classification",
feat_space,
prop_label,
......
......@@ -11,7 +11,7 @@
// 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 "descriptor_identifier/SISSO_DI/SISSOLogRegressor.hpp"
#include "descriptor_identifier/solver/SISSOLogRegressor.hpp"
SISSOLogRegressor::SISSOLogRegressor(
std::shared_ptr<FeatureSpace> feat_space,
......
......@@ -11,7 +11,7 @@
// 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 "descriptor_identifier/SISSO_DI/SISSORegressor.hpp"
#include "descriptor_identifier/solver/SISSORegressor.hpp"
SISSORegressor::SISSORegressor(
std::shared_ptr<FeatureSpace> feat_space,
......@@ -27,7 +27,7 @@ SISSORegressor::SISSORegressor(
int n_models_store,
bool fix_intercept
) :
SISSO_DI(
SISSOSolver(
"regression",
feat_space,
prop_label,
......@@ -58,7 +58,7 @@ SISSORegressor::SISSORegressor(
int n_models_store,
bool fix_intercept
) :
SISSO_DI(
SISSOSolver(
"regression",
feat_space,
prop_label,
......
......@@ -11,9 +11,9 @@
// 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 "descriptor_identifier/SISSO_DI/SISSO_DI.hpp"
#include "descriptor_identifier/solver/SISSOSolver.hpp"
SISSO_DI::SISSO_DI(
SISSOSolver::SISSOSolver(
std::string loss_type,
std::shared_ptr<FeatureSpace> feat_space,
std::string prop_label,
......@@ -54,7 +54,7 @@ SISSO_DI::SISSO_DI(
);
}
SISSO_DI::SISSO_DI(
SISSOSolver::SISSOSolver(
std::string loss_type,
std::shared_ptr<FeatureSpace> feat_space,
std::string prop_label,
......
......@@ -11,12 +11,14 @@
// 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.
/** @file python/feature_creation/node_utils.hpp
* @brief python binding functions for node utilities
* @brief Defines a function to convert a file containing a list of postfix expressions of features into a list of Nodes
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef NODE_UTILS_PY
#define NODE_UTILS_PY
......
......@@ -13,19 +13,19 @@
# limitations under the License.
"""Provide a python interface to the SISSO++ Code
Create the relevant SISSO FeatureSpace and SISSO_DI classes from standard python objects.
Create the relevant SISSO FeatureSpace and SISSOSolver classes from standard python objects.
Modules:
estimate_feat_space_size: Provide functions to estimate the final feature space size given the input parameters used to generate the FeatureSpace object.
get_solver: Functions to get the FeatureSpace and SISSO_DI objects needed to run the code.
get_solver: Functions to get the FeatureSpace and SISSOSolver objects needed to run the code.
import_dataframe: Functions used to convert a data.csv file into a primary feature space
Functions:
read_csv: Create initial feature set from a csv file
get_fs: Generate a FeatureSpace for the calculation
get_fs_solver: Generate a FeatureSpace and SISSO_DI for the calculation
get_fs_solver: Generate a FeatureSpace and SISSOSolver for the calculation
"""
from sissopp.py_interface.import_dataframe import read_csv
from sissopp.py_interface.get_solver import get_fs, get_fs_solver
......@@ -11,12 +11,12 @@
# 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.
"""Functions to get the FeatureSpace and SISSO_DI objects needed to run the code.
"""Functions to get the FeatureSpace and SISSOSolver objects needed to run the code.
Functions:
get_fs: Generate a FeatureSpace for the calculation
get_fs_solver: Generate a FeatureSpace and SISSO_DI for the calculation
get_fs_solver: Generate a FeatureSpace and SISSOSolver for the calculation
"""
import numpy as np
import pandas as pd
......@@ -119,7 +119,7 @@ def get_fs_solver(
leave_out_frac=0.0,
leave_out_inds=None,
):
"""Generate a FeatureSpace and SISSO_DI for the calculation
"""Generate a FeatureSpace and SISSOSolver for the calculation
Args:
df (str): The csv file containing all of the data for the calculation
......
......@@ -11,12 +11,14 @@
// 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.
/** @file utils/compare_features.hpp
* @brief A set of functions to project features onto a second vector
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef UTILS_FEAT_COMP
#define UTILS_FEAT_COMP
......
......@@ -11,12 +11,14 @@
// 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.
/** @file utils/enum.hpp
* @brief Define node type enum
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef ENUMS
#define ENUMS
/**
......
......@@ -11,12 +11,14 @@
// 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.
/** @file utils/math_funcs.hpp
* @brief A set of functions to get standardized mathematical operations on
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef MATH_FXN
#define MATH_FXN
......
......@@ -11,6 +11,7 @@
// 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.
/** @file utils/mkl_interface.hpp
* @brief wrapper functions to a mkl blas functionality
*
......
......@@ -11,12 +11,14 @@
// 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.
/** @file utils/project.hpp
* @brief A set of functions to project features onto a second vector
*
* @author Thomas A. R. Purcell (tpurcell)
* @author Thomas A. R. Purcell (tpurcell90)
* @bug No known bugs.
*/
#ifndef UTILS_PROJECT
#define UTILS_PROJECT
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment