forked from GlobalFishingWatch/vessel-scoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
56 lines (49 loc) · 1.51 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
#!/usr/bin/env python
import os.path
import distutils.core
import distutils.command.build
from distutils.command.build import build
import os.path
import sys
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...",
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=["numpy", "scikit-learn", "scipy", "rolling_measures"],
extras_require={
'dev': ['matplotlib', 'ipython', 'coveralls']},
version='1.0',
author='Egil Moeller, Timothy Hochberg',
author_email='egil@skytruth.org, tim@skytruth.org',
url='',
license='Apache',
cmdclass=cmdclass
)