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

Script for automatic template of external algorithm repo. #46

Closed
bouthilx opened this issue Feb 28, 2018 · 4 comments
Closed

Script for automatic template of external algorithm repo. #46

bouthilx opened this issue Feb 28, 2018 · 4 comments
Labels
enhancement Improves a feature or non-functional aspects (e.g., optimization, prettify, technical debt)

Comments

@bouthilx
Copy link
Member

When building a new external repo for algorithm plugins to metaopt, most of the content is boiler-plate. It should be easy to make an automatic script to generate new repos.

Lines subject to changes

Example based on metaopt-skopt-bayes

package name

    name='metaopt.algo.skopt.bayes',

author name

    author='Xavier Bouthillier',

author email

    author_email='xavier.bouthillier@umontreal.ca',

packages

    packages=['metaopt.algo.skopt'],

entry point

            'skopt_bayes = metaopt.algo.skopt.bayes:BayesianOptimizer'

additional requirements

    install_requires=['metaopt.core', 'scikit-optimize>=0.5.1'],

Script's requests

The script would prompt the following requests to build the lines I described above.

package name: 
author name: 
author email:
packages (separated with commas) [default='metaopt.algo']:
install requirements (separated with commas) [default='metaopt.core']:
algorithm class name: 
algorithm's module path [default='src/metaopt/algo/']:

To create a template like the repository example, one would provide this to the script:

package name: metaopt.algo.skopt.bayes
author name: Xavier Bouthillier 
author email: xavier.bouthillier@umontreal.ca
packages (separated with commas) [default='metaopt.algo']: metaopt.algo.skopt
install requirements (separated with commas) [default='metaopt.core']: metaopt.core, scikit-optimize>=0.5.1
algorithm class name: BayesianOptimizer
algorithm's module: metaopt.algo.skopt.bayes

This would create a functional repo including LICENSE , MANIFEST.in, setup.cfg, setup.py and a file src/metaopt/algo/skopt/bayes.py, containing a skeleton algorithm class definition named BayesianOptimizer. Note that for simplicity The entry point would be bayesianoptimizer = metaopt.algo.skopt.bayes:BayesianOptimizer, based on algorithm's class name.

The user would then obviously be free to edit those files as desired.

@bouthilx bouthilx added the enhancement Improves a feature or non-functional aspects (e.g., optimization, prettify, technical debt) label Feb 28, 2018
@bouthilx
Copy link
Member Author

bouthilx commented Sep 8, 2018

Should take a look at cookiecutter to do this.

@bouthilx
Copy link
Member Author

2 similar comments
@bouthilx
Copy link
Member Author

@bouthilx
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves a feature or non-functional aspects (e.g., optimization, prettify, technical debt)
Projects
None yet
Development

No branches or pull requests

1 participant