Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Python bindings API documentation #114

Closed
beniz opened this issue Feb 11, 2015 · 3 comments
Closed

Improve Python bindings API documentation #114

beniz opened this issue Feb 11, 2015 · 3 comments

Comments

@beniz
Copy link
Collaborator

beniz commented Feb 11, 2015

No description provided.

@beniz
Copy link
Collaborator Author

beniz commented Feb 11, 2015

As a starter, currently, help can be obtained as follows:

python
Python 2.7.8 (default, Oct 20 2014, 15:05:19) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lcmaes
>>> help(lcmaes)

will yield a page with classes and methods. However, informative docstrings are missing and they will be added as to fulfill this ticket.

@beniz
Copy link
Collaborator Author

beniz commented Feb 11, 2015

Bindings has now full documentation in code, and available from Python, such as:

python
Python 2.7.8 (default, Oct 20 2014, 15:05:19) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lcmaes
>>> help(lcmaes.CMAParametersNB)

yields:

Help on class CMAParametersNB in module lcmaes:

class CMAParametersNB(Boost.Python.instance)
 |  CMAParameters object for problems with unbounded function parameters
 |  
 |  Method resolution order:
 |      CMAParametersNB
 |      Boost.Python.instance
 |      __builtin__.object
 |  
 |  Methods defined here:
 |  
 |  __init__(...)
 |      __init__( (object)arg1) -> None
 |  
 |  __reduce__ = <unnamed Boost.Python function>(...)
 |  
 |  dim(...)
 |      dim( (CMAParametersNB)arg1) -> int :
 |          return the problem dimension
 |  
 |  get_algo(...)
 |      get_algo( (CMAParametersNB)arg1) -> int :
 |          return the optimization algorithm code (0 to 14)
 |  
 |  get_edm(...)
 |...

or:

help(lcmaes.pcmaes)

that yields:

Help on built-in function pcmaes in module lcmaes:

pcmaes(...)
    pcmaes( (fitfunc_pbf)fitfunc, (CMAParametersNB)parameters) -> CMASolutions :
        optimizes a function with unbounded parameters

@beniz beniz closed this as completed Feb 11, 2015
@beniz
Copy link
Collaborator Author

beniz commented Feb 11, 2015

Added how to use Python help to relevant page in documentation: https://github.com/beniz/libcmaes/wiki/Python-bindings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant