-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
119 lines (99 loc) · 3.43 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
from setuptools import setup
import distutils.command.check
from macop import __version__
class TestCommand(distutils.command.check.check):
"""Custom test command."""
def run(self):
# run tests using doctest
import doctest
# set specific seed for pseudo-random process
import random
import numpy as np
# discrete and continuous solutions module
from macop.solutions import discrete
from macop.solutions import continuous
# operators module
from macop.operators.discrete import mutators as discrete_mutators
from macop.operators.discrete import crossovers as discrete_crossovers
from macop.operators.continuous import mutators as continuous_mutators
from macop.operators.continuous import crossovers as continuous_crossovers
# policies module
from macop.policies import classicals
from macop.policies import reinforcement
# evaluators module
from macop.evaluators.discrete import mono as discrete_mono
from macop.evaluators.discrete import multi as discrete_multi
# algorithms
from macop.algorithms import mono as algo_mono
from macop.algorithms import multi as algo_multi
# run all doctest
print("==============================")
print("Runs test command...")
random.seed(42)
np.random.seed(42)
# discrete solutions module
doctest.testmod(discrete)
doctest.testmod(continuous)
random.seed(42)
np.random.seed(42)
# operators module
doctest.testmod(discrete_mutators)
doctest.testmod(discrete_crossovers)
random.seed(42)
np.random.seed(42)
# operators module
doctest.testmod(continuous_mutators)
doctest.testmod(continuous_crossovers)
random.seed(42)
np.random.seed(42)
# policies module
doctest.testmod(classicals)
doctest.testmod(reinforcement)
random.seed(42)
np.random.seed(42)
# policies module
doctest.testmod(discrete_mono)
doctest.testmod(discrete_multi)
random.seed(42)
np.random.seed(42)
# policies module
doctest.testmod(algo_mono)
doctest.testmod(algo_multi)
# pass test using doctest
distutils.command.check.check.run(self)
setup(
name='macop',
version=__version__,
description='Minimalist And Customisable Optimisation Package',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering',
'Topic :: Utilities'
],
url='https://github.com/prise-3d/macop',
author='Jérôme BUISINE',
author_email='[email protected]',
license='MIT',
packages=['macop',
'macop.algorithms',
'macop.callbacks',
'macop.evaluators',
'macop.evaluators.discrete',
'macop.evaluators.continuous',
'macop.operators',
'macop.operators.discrete',
'macop.operators.continuous',
'macop.policies',
'macop.solutions',
'macop.utils'],
install_requires=[
'numpy',
],
cmdclass={
'test': TestCommand,
},
zip_safe=False)