Skip to content

Commit

Permalink
fixed logical error in set functions
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Omar <[email protected]>
  • Loading branch information
adityaomar3 committed Oct 21, 2023
1 parent e729f50 commit 3b81c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/avogadro/cjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def set_atoms_coordinates(self, filePath, coords_array):
'''
data = self.__from_cjson(filePath)
data["atoms"]["coords"]["3d"] = coords_array
return data
return self.__to_cjson(data)
def set_elements(self, filePath, elements_array):
'''
It sets all the elements present in the cjson file
where elements are set/recognized by their atomic numbers
'''
data = self.__from_cjson(filePath)
data["atoms"]["elements"]["number"] = elements_array
return data
return self.__to_cjson(data)
def set_coordinates(self, filePath, coords_array):
'''
It helps to set all coordinates of the
Expand All @@ -76,4 +76,4 @@ def set_coordinates(self, filePath, coords_array):
'''
data = self.__from_cjson(filePath)
data["atoms"]["coords"]["3d"] = coords_array
return data
return self.__to_cjson(data)

0 comments on commit 3b81c7e

Please sign in to comment.