-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.py
More file actions
106 lines (93 loc) · 4.34 KB
/
header.py
File metadata and controls
106 lines (93 loc) · 4.34 KB
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
from Common import *
import getpass
from os.path import expanduser
class Header(HasTraits):
view = View(Item(name='clusteropt',label='Cluster' ,padding=5),
Item(name='currentdir' ,label='CWD',style='readonly',padding=5),
Item(name='username' ,label='Username',padding=5),
Item(name='masterpath',label='Home',padding=5),
Item(name='gadgetpath',label='Gadget',padding=5),
Item(name='musicpath',label='Music',padding=5),
Item(name='parentsimpath',label='Parent Sim.',padding=5),
Item(name='datamasterpath',label='Project Data',padding=5))
clusteropt = Enum(['antares','barrine','odyssey','macbook','spacebase','bigbang','macbook'])
username = Str
masterpath = Directory
homepath = Directory
gadgetpath = Directory
musicpath = Directory
datamasterpath = Directory
parentsimpath = Directory
currentdir = Directory
def _username_changed(self):
self.masterpath = self.homepath + self.username
self.gadgetpath = self.masterpath + '/lib/P-Gadget3/'
self.parentsimpath = self.masterpath + '/AnnaGroup/caterpillar/parent/512Parent/'
self.datamasterpath = self.masterpath + '/projects/caterpillar/data/'
self.musicpath = self.homepath + self.username + '/lib/music/'
def _clusteropt_changed(self):
self.homepath = expanduser("~")
# if self.clusteropt == 'Macbook':
# self.homepath = '/home/'
#
# if self.clusteropt == 'antares':
# self.homepath = '/home/'
#
# if self.clusteropt == 'barrine':
# self.homepath = '/home/'
#
# if self.clusteropt == 'odyssey':
# self.homepath = '/n/home01/'
#
# if self.clusteropt == 'spacebase':
# self.homepath = '/spacebase/data/'
#
self.masterpath = self.homepath + self.username
def __init__(self, main, **kwargs):
self.username = getpass.getuser()
self.homepath = expanduser("~")
if platform.node() == "csr-dyn-150.mit.edu":
self.clusteropt = 'macbook'
self.homepath = '/Users/griffen/Desktop/cme/'
self.masterpath = self.homepath + self.username
self.gadgetpath = self.masterpath + '/lib/P-Gadget3'
self.musicpath = self.masterpath+ '/lib/music'
self.datamasterpath = self.homepath + 'AnnaGroup/caterpillar/'
self.parentsimpath = self.homepath + 'AnnaGroup/caterpillar/parent/'
#self.homepath = '/Users/'
#
if platform.node() == "Brendans-MacBook-Pro.local":
self.homepath = '/Users/'
#
if platform.node() == 'antares':
self.clusteropt = 'antares'
if platform.node() == 'barrine':
self.username = 'uqbgriff'
if platform.node() == 'rclogin13.rc.fas.harvard.edu':
self.clustopt = 'odyssey'
self.homepath = '/n/home01/bgriffen/data/'
self.masterpath = self.homepath + self.username
self.gadgetpath = self.masterpath + '/lib/P-Gadget3'
self.musicpath = self.masterpath + '/lib/music'
self.datamasterpath = self.homepath + 'caterpillar/'
self.parentsimpath = self.homepath + 'caterpillar/parent/'
if platform.node() == 'spacebase':
self.clusteropt = 'spacebase'
self.homepath = '/spacebase/data/'
self.masterpath = self.homepath + self.username
self.gadgetpath = self.masterpath + '/lib/P-Gadget3'
self.musicpath = self.masterpath+ '/lib/music'
self.datamasterpath = self.homepath + 'AnnaGroup/caterpillar/'
self.parentsimpath = self.homepath + 'AnnaGroup/caterpillar/parent/'
if platform.node() == 'bigbang.mit.edu':
self.clusteropt = 'bigbang'
self.homepath = '/bigbang/data/'
self.masterpath = self.homepath + self.username
self.gadgetpath = self.masterpath + '/lib/P-Gadget3'
self.musicpath = self.masterpath + '/lib/music'
self.datamasterpath = self.homepath + 'AnnaGroup/caterpillar/'
self.parentsimpath = self.homepath + 'AnnaGroup/caterpillar/parent/'
self.currentdir = os.getcwd()
self.masterpath = self.homepath + self.username
HasTraits.__init__(self)
self.main = main