-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
65 lines (57 loc) · 1.62 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
#!/usr/bin/env python
from __future__ import print_function
import os.path
import distutils.core
import distutils.command.build
from distutils.command.build import build
import os.path
import sys
DEPENDENCIES = [
"numpy",
"scikit-learn==0.20",
"scipy",
"rolling_measures",
"six>=1.14"
]
class BuildModelsCommand(distutils.core.Command):
description = "Train models and save the model parameters to file"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if os.path.exists(os.path.join(os.path.dirname(__file__), 'vessel_scoring', 'models')):
return
print("Training models...", end='')
sys.stdout.flush()
import vessel_scoring.models
vessel_scoring.models.train_models()
print("done.")
sys.stdout.flush()
class build(distutils.command.build.build):
def run(self):
self.run_command("build_models")
distutils.command.build.build.run(self)
cmdclass = {}
cmdclass['build_models'] = BuildModelsCommand
cmdclass['build'] = build
distutils.core.setup(
name='vessel-scoring',
description="Tools to score fishing behviour of vessels",
long_description='',
packages=[
'vessel_scoring',
],
package_data={
'vessel_scoring': ['models/*']},
install_requires=DEPENDENCIES,
extras_require={
'dev': ['matplotlib', 'ipython', 'coveralls']},
version='2.0.0',
author='Egil Moeller, Timothy Hochberg',
author_email='egil@skytruth.org, tim@skytruth.org',
url='',
license='Apache',
cmdclass=cmdclass
)