Skip to content

Commit

Permalink
try for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
jkiesele committed Jan 20, 2022
1 parent bcc95cc commit a112aff
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions training/DeepJet_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@
#helper

def publish(file_to_publish, publish_to_path):
cpstring = 'cp -f '
if "@" in publish_to_path:
cpstring = 'scp '
spl = publish_to_path.split(':')
path = spl[1]
user = spl[0].split('@')[0]
server = spl[0].split('@')[1]
os.system('ssh -o ConnectTimeout=20 '+user+'@'+server+' "mkdir -p '+path+'"')
basefilename = os.path.basename(file_to_publish)
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'/'+basefilename+ ' 2>&1 > /dev/null')
try:
cpstring = 'cp -f '
if "@" in publish_to_path:
cpstring = 'scp -o ConnectTimeout=20 '
spl = publish_to_path.split(':')
path = spl[1]
user = spl[0].split('@')[0]
server = spl[0].split('@')[1]
os.system('ssh -o ConnectTimeout=20 '+user+'@'+server+' "mkdir -p '+path+'"')
basefilename = os.path.basename(file_to_publish)
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'/'+basefilename+ ' 2>&1 > /dev/null')
except Exception as e:
print('exception in publish', e, 'when trying to publish to',publish_to_path ,'. Training will ignore this exception and move on.')

def hampel(vals_orig, k=7, t0=3):
'''
Expand Down

0 comments on commit a112aff

Please sign in to comment.