Skip to content

Commit

Permalink
add emoji (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyueyang37 authored Aug 31, 2021
1 parent 8856b20 commit 04378c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nmrgnn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
import pickle


import tensorflow as tf
import kerastuner as kt
import nmrdata
Expand Down Expand Up @@ -224,12 +223,12 @@ def eval_struct(struct_files, output_csv, model_file, neighbor_number, stride):

# add useful info
gpus = tf.config.list_physical_devices('GPU')
gpu_msg = 'GPUs: None'
gpu_msg = 'GPUs\U0001F916: None'
if len(gpus) > 0:
gpu_msg = f'GPUs: {len(gpus)}'
gpu_msg = f'GPUs\U0001F916: {len(gpus)}'

inf_msg = f'Model Inference ({gpu_msg})'
timing = {'MDAnalysis': 0, inf_msg: 0, 'Parsing': 0}
inf_msg = f'Model Inference\U0001F47B ({gpu_msg})'
timing = {'MDAnalysis\U0001F47E': 0, inf_msg: 0, 'Parsing\U0001F4A8': 0}

pbar = None
if N > 1:
Expand All @@ -241,7 +240,7 @@ def eval_struct(struct_files, output_csv, model_file, neighbor_number, stride):
u, neighbor_number, embeddings, warn=i == 0)
inv_degree = tf.squeeze(tf.math.divide_no_nan(1.,
tf.reduce_sum(tf.cast(nlist > 0, tf.float32), axis=1)))
timing['MDAnalysis'] += time.time_ns() - t
timing['MDAnalysis\U0001F47E'] += time.time_ns() - t
t = time.time_ns()
peaks = model((atoms, nlist, edges, inv_degree))
confident = check_peaks(atoms, peaks)
Expand All @@ -264,14 +263,15 @@ def eval_struct(struct_files, output_csv, model_file, neighbor_number, stride):
else:
out = pd.concat((out, data))

timing['Parsing'] += time.time_ns() - t
timing['Parsing\U0001F4A8'] += time.time_ns() - t
t = time.time_ns()
if pbar:
pbar.set_description(
'|'.join([f'{k}:{v/10**9:5.2f}s' for k, v in timing.items()]))
pbar.update(stride)
out.to_csv(f'{output_csv}', index=False)
print('|'.join([f'{k}:{v/10**9:5.2f}s' for k, v in timing.items()]))
print('Hooray!\U0001F600\U0001F604\U0001F606\U0001F609You can now find your result in 'f'{output_csv}')


@main.command()
Expand Down

0 comments on commit 04378c5

Please sign in to comment.