-
Notifications
You must be signed in to change notification settings - Fork 0
/
spark_test.py
70 lines (56 loc) · 1.43 KB
/
spark_test.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
from pyspark import SparkContext
from pyspark import SparkConf
import os
import sys
# PROJECT_DIR = '/home/lkozinkin/ptv'
# py_files = [
# '/home/lkozinkin/ptv/PTV/particle_detection/pmc.py',
# '/home/lkozinkin/ptv/PTV/particle_detection/subpixel_peak.py',
# '/home/lkozinkin/ptv/PTV/tracking/relaxation.py'
# ]
# py_files = [
# 'hdfs:ptv/pmc.py',
# 'hdfs:ptv/subpixel_peak.py',
# 'hdfs:ptv/relaxation.py'
# ]
# for root, dirs, files in os.walk(PROJECT_DIR):
# for file in files:
# if file.endswith('.py'):
# py_files.append(os.path.join(root, file))
#
sc = SparkContext()
# sc.addPyFile('pmc.py')
# sc.addPyFile('relaxation.py')
# print(py_files)
# from pmc import PMC
# import numpy
# import scipy
# print(scipy)
import six
print(six)
# import skimage
# print(skimage)
# import matplotlib
# print(matplotlib)
print('Import successful')
# try:
# from PTV.particle_detection import PMC
#
# except ImportError as e:
# print("Error importing Spark Module", e)
#
# try:
# # conf = SparkConf()
# # conf.setMaster(SPARK_HOME)
# # conf.setAppName("First_Remote_Spark_Program")
# # sc = SparkContext(conf=conf)
# sc = SparkContext()
# # print("connection succeeded with Master", conf)
# data = [1, 2, 3, 4, 5]
# distData = sc.parallelize(data)
#
# except Exception:
# print("unable to connect to remote server")
# pmc_obj = PMC()
# print(pmc_obj)
print('Hello, World!')