Skip to content

Commit

Permalink
Adapt codebase to new name Orion (#61)
Browse files Browse the repository at this point in the history
Commands ran were the following:

```bash
git mv src/metaopt src/orion
git mv tests/functional/demo/moptconfig.yaml tests/functional/demo/orion_config.yaml
git mv tests/functional/demo/moptconfig_random.yaml tests/functional/demo/orion_config_random.yaml

find -path ./.git -prune -o -type f -exec sed -i 's/metaopt/orion/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/MetaOptimizer/Orion/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/MetaOpt/Orion/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/Mopt/Orion/g' {} +

find -path ./.git -prune -o -type f -exec sed -i 's/moptconfig/orion_config/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/moptgroup/orion_group/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/moptfile/orion_file/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/moptdb/orion_db/g' {} +
find -path ./.git -prune -o -type f -exec sed -i 's/mopt/orion/g' {} +

git checkout README.rst
git checkout RESEARCH.md
```

Plus a few manual fixes for flake8 and sphinx.

Note: I left README.rst and RESEARCH.md as is since they are totally outdated.
  • Loading branch information
bouthilx authored and lamblin committed Apr 20, 2018
1 parent dff43f1 commit 59caa57
Show file tree
Hide file tree
Showing 58 changed files with 424 additions and 424 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
src/metaopt/core/_version.py export-subst
src/orion/core/_version.py export-subst
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extension-pkg-whitelist=

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS,.git,.eggs,.tox,src/metaopt.egg-info
ignore=CVS,.git,.eggs,.tox,src/orion.egg-info

# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install:
- pip install tox
before_script:
- sleep 15
- mongo metaopt_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
- mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
script:
- tox
after_success:
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Software License Agreement (BSD License)

Copyright (c) 2017-2018, MetaOptimizer Team - MILA/Université de Montréal.
Copyright (c) 2017-2018, Orion Team - MILA/Université de Montréal.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -13,7 +13,7 @@ Software License Agreement (BSD License)
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of metaopt nor the names of its
* Neither the name of orion nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include *.rst
exclude RESEARCH.md

# Control and setup helpers
include src/metaopt/core/_version.py
include src/orion/core/_version.py
include versioneer.py

# Exclude development helpers
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ coverage:
target: auto
threshold: null
branches: null
paths: src/metaopt
paths: src/orion

patch:
default:
Expand Down
24 changes: 12 additions & 12 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MetaOpt documentation build configuration file.
Orion documentation build configuration file.
This file is execfile()d with the current directory set to its
containing dir.
Expand Down Expand Up @@ -35,7 +35,7 @@
src_path = os.path.abspath(os.path.join(docs_src_path, '..', '..', 'src'))
sys.path.insert(0, src_path)

import metaopt.core as metaopt # noqa
import orion.core as orion # noqa

# -- General configuration ------------------------------------------------

Expand All @@ -58,10 +58,10 @@
]

# General information about the project.
project = u'metaopt'
_full_version = metaopt.__version__
author = u'MetaOptimizer Team - MILA, Université de Montréal'
copyright = u'2017, MetaOptimizer Team - MILA, Université de Montréal'
project = u'orion'
_full_version = orion.__version__
author = u'Orion Team - MILA, Université de Montréal'
copyright = u'2017, Orion Team - MILA, Université de Montréal'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -140,7 +140,7 @@
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'MetaOptdoc'
htmlhelp_basename = 'Oriondoc'


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -167,8 +167,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'metaopt.tex', 'MetaOpt Documentation',
u'MetaOptimizer Team - MILA, Université de Montréal', 'manual'),
(master_doc, 'orion.tex', 'Orion Documentation',
u'Orion Team - MILA, Université de Montréal', 'manual'),
]


Expand All @@ -177,7 +177,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'metaopt', 'MetaOpt Documentation',
(master_doc, 'orion', 'Orion Documentation',
[author], 1)
]

Expand All @@ -188,8 +188,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'MetaOpt', 'MetaOpt Documentation',
author, 'MetaOpt', 'One line description of project.',
(master_doc, 'Orion', 'Orion Documentation',
author, 'Orion', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. MetaOpt documentation master file, created by
.. Orion documentation master file, created by
sphinx-quickstart on Mon Nov 13 19:08:05 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to MetaOpt's documentation!
Welcome to Orion's documentation!
===================================

.. toctree::
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versioneer]
VCS=git
style=pep440-post
versionfile_source=src/metaopt/core/_version.py
versionfile_build=metaopt/core/_version.py
versionfile_source=src/orion/core/_version.py
versionfile_build=orion/core/_version.py
tag_prefix=
parentdir_prefix=metaopt-
parentdir_prefix=orion-

[aliases]
test=pytest
Expand Down
34 changes: 17 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Installation script for MetaOpt."""
"""Installation script for Orion."""
from glob import iglob
import os
import sys
Expand All @@ -16,20 +16,20 @@
mpath = pjoin(repo_root, 'src')
sys.path.insert(0, mpath)

import metaopt.core as metaopt # noqa
import orion.core as orion # noqa

print(sys.version)


def find_data_files():
"""Find MetaOpt's configuration and metadata files."""
install_config_path = pjoin(metaopt.DIRS.site_data_dir, 'config')
"""Find Orion's configuration and metadata files."""
install_config_path = pjoin(orion.DIRS.site_data_dir, 'config')
config_path = pjoin('config', '*')
configs = [cfg for cfg in iglob(config_path) if isfile(cfg)]

data_files = [
(install_config_path, configs),
(metaopt.DIRS.site_data_dir, ['LICENSE', 'README.rst']),
(orion.DIRS.site_data_dir, ['LICENSE', 'README.rst']),
]

return data_files
Expand All @@ -41,31 +41,31 @@ def find_data_files():


packages = [
'metaopt.core',
'metaopt.client',
'metaopt.algo',
'orion.core',
'orion.client',
'orion.algo',
]

setup_args = dict(
name='metaopt.core',
name='orion.core',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description=metaopt.__descr__,
long_description=textwrap.dedent(metaopt.__doc__),
license=metaopt.__license__,
author=metaopt.__author__,
author_email=metaopt.__author_email__,
url=metaopt.__url__,
description=orion.__descr__,
long_description=textwrap.dedent(orion.__doc__),
license=orion.__license__,
author=orion.__author__,
author_email=orion.__author_email__,
url=orion.__url__,
packages=packages,
package_dir={'': 'src'},
include_package_data=True,
data_files=find_data_files(),
entry_points={
'console_scripts': [
'mopt = metaopt.core.cli:main',
'orion = orion.core.cli:main',
],
'OptimizationAlgorithm': [
'random = metaopt.algo.random:Random',
'random = orion.algo.random:Random',
],
},
install_requires=['PyYAML', 'pymongo>=3', 'numpy', 'scipy'],
Expand Down
18 changes: 9 additions & 9 deletions src/metaopt/algo/base.py → src/orion/algo/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
:mod:`metaopt.algo.base` -- What is a search algorithm, optimizer of a process
:mod:`orion.algo.base` -- What is a search algorithm, optimizer of a process
==============================================================================
.. module:: base
Expand All @@ -12,7 +12,7 @@
from abc import (ABCMeta, abstractmethod)
import logging

from metaopt.core.utils import Factory
from orion.core.utils import Factory

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -47,8 +47,8 @@ class BaseAlgorithm(object, metaclass=ABCMeta):
:linenos:
:emphasize-lines: 7
from metaopt.algo.base import BaseAlgorithm
from metaopt.algo.space import (Integer, Space)
from orion.algo.base import BaseAlgorithm
from orion.algo.space import (Integer, Space)
class MySimpleAlgo(BaseAlgorithm):
Expand Down Expand Up @@ -86,7 +86,7 @@ def __init__(self, space, **kwargs):
Parameters
----------
space : `metaopt.algo.space.Space`
space : `orion.algo.space.Space`
Definition of a problem's parameter space.
kwargs : dict
Tunable elements of a particular algorithm, a dictionary from
Expand Down Expand Up @@ -120,7 +120,7 @@ def suggest(self, num=1):
:param num: how many sets to be suggested.
.. note:: New parameters must be compliant with the problem's domain
`metaopt.algo.space.Space`.
`orion.algo.space.Space`.
"""
pass

Expand All @@ -132,7 +132,7 @@ def observe(self, points, results):
Parameters
----------
points : list of tuples of array-likes
Points from a `metaopt.algo.space.Space`.
Points from a `orion.algo.space.Space`.
Evaluated problem parameters by a consumer.
results : list of dicts
Contains the result of an evaluation; partial information about the
Expand Down Expand Up @@ -176,7 +176,7 @@ def judge(self, point, measurements): # pylint:disable=no-self-use,unused-argum
used to execute user's script with.
This method is to be used as a callback in a client-server communication
between user's script and a metaopt's worker using a `BaseAlgorithm`.
between user's script and a orion's worker using a `BaseAlgorithm`.
Data returned from this method must be serializable and will be used as
a response to the running environment. Default response is None.
Expand Down Expand Up @@ -235,7 +235,7 @@ def space(self, space_):
class OptimizationAlgorithm(BaseAlgorithm, metaclass=Factory):
"""Class used to inject dependency on an algorithm implementation.
.. seealso:: `metaopt.core.utils.Factory` metaclass and `BaseAlgorithm` interface.
.. seealso:: `orion.core.utils.Factory` metaclass and `BaseAlgorithm` interface.
"""

pass
6 changes: 3 additions & 3 deletions src/metaopt/algo/random.py → src/orion/algo/random.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
:mod:`metaopt.algo.random` -- Random sampler as optimization algorithm
:mod:`orion.algo.random` -- Random sampler as optimization algorithm
======================================================================
.. module:: random
Expand All @@ -9,7 +9,7 @@
"""

from metaopt.algo.base import BaseAlgorithm
from orion.algo.base import BaseAlgorithm


class Random(BaseAlgorithm):
Expand All @@ -28,7 +28,7 @@ def suggest(self, num=1):
:param num: how many sets to be suggested.
.. note:: New parameters must be compliant with the problem's domain
`metaopt.algo.space.Space`.
`orion.algo.space.Space`.
"""
return self.space.sample(num)

Expand Down
16 changes: 8 additions & 8 deletions src/metaopt/algo/space.py → src/orion/algo/space.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
:mod:`metaopt.algo.space` -- Objects describing a problem's domain
:mod:`orion.algo.space` -- Objects describing a problem's domain
==================================================================
.. module:: space
Expand All @@ -15,14 +15,14 @@
* `Integer`
* `Categorical`
These are instantiated to declare a problem's parameter space. Metaopt registers
These are instantiated to declare a problem's parameter space. Orion registers
them in a ordered dictionary, `Space`, which describes how the parameters should
be in order for `metaopt.algo.base.AbstractAlgorithm` implementations to
communicate with `metaopt.core`.
be in order for `orion.algo.base.AbstractAlgorithm` implementations to
communicate with `orion.core`.
Parameter values recorded in `metaopt.core.worker.trial.Trial` objects must be
and are in concordance with `metaopt.algo.space` objects. These objects will be
defined by `metaopt.core` using the user script's configuration file.
Parameter values recorded in `orion.core.worker.trial.Trial` objects must be
and are in concordance with `orion.algo.space` objects. These objects will be
defined by `orion.core` using the user script's configuration file.
Prior distributions, contained in `Dimension` classes, are based on
`scipy.stats.distributions` and should be configured as noted in the
Expand Down Expand Up @@ -284,7 +284,7 @@ def sample(self, n_samples=1, seed=None):
Discretizes with `numpy.floor` the results from `Dimension.sample`.
.. seealso:: `Dimension.sample`
.. seealso:: Discussion in https://github.com/mila-udem/metaopt/issues/56
.. seealso:: Discussion in https://github.com/mila-udem/orion/issues/56
if you want to understand better how this `Integer` diamond inheritance
works.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
"""
:mod:`metaopt.client` -- Helper function for returning results from script
:mod:`orion.client` -- Helper function for returning results from script
==========================================================================
.. module:: client
:platform: Unix
:synopsis: Provides functions for communicating with `metaopt.core`.
:synopsis: Provides functions for communicating with `orion.core`.
"""
import os
Expand All @@ -31,7 +31,7 @@ def report_results(data):
.. note:: To be called only once in order to report a final evaluation
of a particular trial.
.. note:: In case that user's script is not running in a metaopt's context,
.. note:: In case that user's script is not running in a orion's context,
this function will act as a Python `print` function.
.. note:: For your own good, this can be called **only once**.
Expand Down
Loading

0 comments on commit 59caa57

Please sign in to comment.