SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import json
  2. from pprint import pprint
  3. from aflowml.client import AFLOWmlAPI
  4.  
  5. with open('entries_data.json', 'r') as json_file:
  6.     entries_data = json.load(json_file)
  7.     predictions = []
  8.     ml = AFLOWmlAPI()
  9.     count = 1
  10.     print("Fetching predictions:")
  11.     for entry in entries_data:
  12.         print('%s of %s               %s' % (
  13.             count,
  14.             len(entries_data),
  15.             entry['auid']
  16.         ))
  17.         count += 1
  18.         prediction = ml.get_prediction(entry['poscar'], 'plmf')
  19.         # merge entry and prediction dict
  20.         predictions.append(prediction)
  21.     print('Output')
  22.     pprint(predictions)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top