mlpack
Namespaces | Functions
print_doc_functions_impl.hpp File Reference
#include <mlpack/core/util/hyphenate_string.hpp>
Include dependency graph for print_doc_functions_impl.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mlpack
 Linear algebra utility functions, generally performed on matrices or vectors.
 

Functions

std::string mlpack::bindings::python::GetBindingName (const std::string &bindingName)
 Given the name of a binding, print its Python name.
 
std::string mlpack::bindings::python::PrintImport (const std::string &bindingName)
 Print any import information for the Python binding.
 
std::string mlpack::bindings::python::PrintInputOptionInfo ()
 Print any special information about input options.
 
std::string mlpack::bindings::python::PrintOutputOptionInfo ()
 Print any special information about output options.
 
template<typename T >
std::string mlpack::bindings::python::PrintValue (const T &value, bool quotes)
 Given a parameter type, print the corresponding value.
 
template<typename T >
std::string mlpack::bindings::python::PrintValue (const std::vector< T > &value, bool quotes)
 Given a vector parameter type, print the corresponding value.
 
template<>
std::string mlpack::bindings::python::PrintValue (const bool &value, bool quotes)
 
std::string mlpack::bindings::python::PrintDefault (const std::string &paramName)
 Given a parameter name, print its corresponding default value.
 
std::string mlpack::bindings::python::PrintInputOptions ()
 
template<typename T , typename... Args>
std::string mlpack::bindings::python::PrintInputOptions (const std::string &paramName, const T &value, Args... args)
 Print an input option. More...
 
std::string mlpack::bindings::python::PrintOutputOptions ()
 
template<typename T , typename... Args>
std::string mlpack::bindings::python::PrintOutputOptions (const std::string &paramName, const T &value, Args... args)
 
template<typename... Args>
std::string mlpack::bindings::python::ProgramCall (const std::string &programName, Args... args)
 Given a name of a binding and a variable number of arguments (and their contents), print the corresponding function call. More...
 
std::string mlpack::bindings::python::ProgramCall (const std::string &programName)
 Given the name of a binding, print a program call assuming that all options are specified. More...
 
std::string mlpack::bindings::python::PrintModel (const std::string &modelName)
 Given the name of a model, print it. More...
 
std::string mlpack::bindings::python::PrintDataset (const std::string &datasetName)
 Given the name of a matrix, print it. More...
 
std::string mlpack::bindings::python::ProgramCallClose ()
 Print any closing call to a program. More...
 
std::string mlpack::bindings::python::ParamString (const std::string &paramName)
 Given the parameter name, determine what it would actually be when passed to the command line.
 
template<typename T >
std::string mlpack::bindings::python::ParamString (const std::string &paramName, const T &value)
 Given the parameter name and an argument, return what should be written as documentation when referencing that argument.
 
bool mlpack::bindings::python::IgnoreCheck (const std::string &paramName)
 Print whether or not we should ignore a check on the given parameter. More...
 
bool mlpack::bindings::python::IgnoreCheck (const std::vector< std::string > &constraints)
 Print whether or not we should ignore a check on the given set of constraints. More...
 
bool mlpack::bindings::python::IgnoreCheck (const std::vector< std::pair< std::string, bool >> &constraints, const std::string &paramName)
 Print whether or not we should ignore a check on the given set of constraints. More...
 

Detailed Description

Author
Ryan Curtin

This file contains functions useful for printing documentation strings related to Python bindings.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ IgnoreCheck() [1/3]

bool mlpack::bindings::python::IgnoreCheck ( const std::string &  paramName)
inline

Print whether or not we should ignore a check on the given parameter.

For Python bindings, we ignore any checks on output parameters, so if paramName is an output parameter, this returns true.

◆ IgnoreCheck() [2/3]

bool mlpack::bindings::python::IgnoreCheck ( const std::vector< std::string > &  constraints)
inline

Print whether or not we should ignore a check on the given set of constraints.

For Python bindings, we ignore any checks on output parameters, so if any parameter is an output parameter, this returns true.

◆ IgnoreCheck() [3/3]

bool mlpack::bindings::python::IgnoreCheck ( const std::vector< std::pair< std::string, bool >> &  constraints,
const std::string &  paramName 
)
inline

Print whether or not we should ignore a check on the given set of constraints.

For Python bindings, we ignore any checks on output parameters, so if any constraint parameter or the main parameter are output parameters, this returns true.

◆ PrintDataset()

std::string mlpack::bindings::python::PrintDataset ( const std::string &  datasetName)
inline

Given the name of a matrix, print it.

Here we do not need to modify anything.

◆ PrintInputOptions()

template<typename T , typename... Args>
std::string mlpack::bindings::python::PrintInputOptions ( const std::string &  paramName,
const T &  value,
Args...  args 
)

Print an input option.

This will throw an exception if the parameter does not exist in IO. For a parameter 'x' with value '5', this will print something like x=5.

◆ PrintModel()

std::string mlpack::bindings::python::PrintModel ( const std::string &  modelName)
inline

Given the name of a model, print it.

Here we do not need to modify anything.

◆ ProgramCall() [1/2]

template<typename... Args>
std::string mlpack::bindings::python::ProgramCall ( const std::string &  programName,
Args...  args 
)

Given a name of a binding and a variable number of arguments (and their contents), print the corresponding function call.

The given programName should not be the output of GetBindingName().

◆ ProgramCall() [2/2]

std::string mlpack::bindings::python::ProgramCall ( const std::string &  programName)
inline

Given the name of a binding, print a program call assuming that all options are specified.

The programName should not be the output of GetBindingName().

◆ ProgramCallClose()

std::string mlpack::bindings::python::ProgramCallClose ( )
inline

Print any closing call to a program.

For a Python binding this is a closing brace.