Skip to content

Commit da04b6c

Browse files
committed
reduce clutter by making directory
1 parent 36e979a commit da04b6c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

training/DeepJet_callbacks.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@
2727
matplotlib.use('Agg')
2828

2929
#helper
30+
3031
def publish(file_to_publish, publish_to_path):
3132
cpstring = 'cp -f '
3233
if "@" in publish_to_path:
3334
cpstring = 'scp '
35+
spl = publish_to_path.split(':')
36+
path = spl[1]
37+
user = spl[0].split('@')[0]
38+
server = spl[0].split('@')[1]
39+
os.system('ssh -o ConnectTimeout=20 '+user+'@'+server+' "mkdir -p '+path+'"')
3440
basefilename = os.path.basename(file_to_publish)
35-
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'_'+basefilename+ ' 2>&1 > /dev/null')
41+
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'/'+basefilename+ ' 2>&1 > /dev/null')
3642

3743
def hampel(vals_orig, k=7, t0=3):
3844
'''
@@ -102,7 +108,7 @@ def __init__(self,
102108
103109
publish: uses scp or cp to copy the output file to another location (e.g. from a cluster to a website server).
104110
if the path contains and "@", it will use scp. This only works with configured key pairs or tokens.
105-
The path needs to also contain the output file name
111+
The path does not contain the output file name
106112
107113
dtype: data type for data to be stored to keep memory consuption within reason (be careful)
108114
@@ -722,5 +728,4 @@ def on_batch_end(self, batch, logs=None):
722728

723729

724730

725-
726-
731+

0 commit comments

Comments
 (0)