Closed arn-all closed 4 years ago
def save_pos_to_json(positions, filename, comment=""):
"""Saves a np.ndarray (positions) to the specified location in write mode.
"""
pos_dict = {
"comment":comment,
"pd_pos": positions.tolist()
}
with open(filename, 'w') as f:
json.dump(pos_dict, f)
Write some function that transforms np.ndarray to KMC-readable json file.