Skip to content

Commit

Permalink
Merge pull request #14 from IOHprofiler/cleaning
Browse files Browse the repository at this point in the history
added expected values for tests
  • Loading branch information
jacobdenobel authored Jan 13, 2021
2 parents a47b041 + 3c537d4 commit 54f105c
Show file tree
Hide file tree
Showing 22 changed files with 2,214 additions and 1,347 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with coverage
run: |
Expand Down
31 changes: 31 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
strictness: high

ignore-paths:
- docs
- venv
- x.py

pep257:
run: true
disable:
- D203
- D213

pyflakes:
disable:
- F821
- F722

pep8:
disable:
- E721

pylint:
disable:
- too-many-locals
- too-many-arguments
- stop-iteration-return
- unidiomatic-typecheck
- invalid-name
- attribute-defined-outside-init
- too-many-instance-attributes
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sphinx==3.3.0
sphinx-automodapi==0.13
sphinx-rtd-theme==0.5.0
35 changes: 35 additions & 0 deletions modcma/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Entrypoint of Modular CMA-ES package."""

from .asktellcmaes import AskTellCMAES
from .modularcmaes import ModularCMAES, evaluate_bbob, fmin
from .parameters import Parameters, BIPOPParameters
from .population import Population
from .sampling import (
gaussian_sampling,
sobol_sampling,
halton_sampling,
mirrored_sampling,
orthogonal_sampling,
Halton,
Sobol,
)
from .utils import timeit, ert

__all__ = (
"AskTellCMAES",
"ModularCMAES",
"evaluate_bbob",
"fmin",
"Parameters",
"BIPOPParameters",
"Population",
"gaussian_sampling",
"sobol_sampling",
"halton_sampling",
"mirrored_sampling",
"orthogonal_sampling",
"Halton",
"Sobol",
"timeit",
"ert",
)
44 changes: 18 additions & 26 deletions modcma/__main__.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
"""Allows the user to call the library as a cli-module."""

from argparse import ArgumentParser

from .modularcmaes import ModularCMAES, evaluate_bbob
from .modularcmaes import evaluate_bbob


parser = ArgumentParser(
description='Run single function CMAES')
parser = ArgumentParser(description="Run single function CMAES")
parser.add_argument(
'-f', "--fid", type=int,
help="bbob function id", required=False, default=5
"-f", "--fid", type=int, help="bbob function id", required=False, default=5
)
parser.add_argument(
'-d', "--dim", type=int,
help="dimension", required=False, default=5
"-d", "--dim", type=int, help="dimension", required=False, default=5
)
parser.add_argument(
'-i', "--iterations", type=int,
"-i",
"--iterations",
type=int,
help="number of iterations per agent",
required=False, default=50
)
parser.add_argument(
'-l', '--logging', required=False,
action='store_true', default=False
)
parser.add_argument(
'-L', '--label', type=str, required=False,
default=""
)
parser.add_argument(
"-s", "--seed", type=int, required=False,
default=42
)
parser.add_argument(
"-p", "--data_folder", type=str, required=False
required=False,
default=50,
)
parser.add_argument(
"-a", "--arguments", nargs='+', required=False
"-l", "--logging", required=False, action="store_true", default=False
)
parser.add_argument("-L", "--label", type=str, required=False, default="")
parser.add_argument("-s", "--seed", type=int, required=False, default=42)
parser.add_argument("-p", "--data_folder", type=str, required=False)
parser.add_argument("-a", "--arguments", nargs="+", required=False)

args = vars(parser.parse_args())
for arg in (args.pop("arguments") or []):
for arg in args.pop("arguments") or []:
# pylint: disable=exec-used
exec(arg, None, args)

evaluate_bbob(**args)
Loading

0 comments on commit 54f105c

Please sign in to comment.