From de0728b82840ea903b48a48b89659f2e9b48179d Mon Sep 17 00:00:00 2001 From: aditya Date: Thu, 5 Oct 2023 02:08:01 +0530 Subject: [PATCH] changed dict name as it is a keyword --- python/avogadro/cjson.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/avogadro/cjson.py b/python/avogadro/cjson.py index 19659c4a38..6880f5f768 100644 --- a/python/avogadro/cjson.py +++ b/python/avogadro/cjson.py @@ -7,15 +7,13 @@ def __open_file(self, filePath): py_dict_data = json.load(cjsonFile) return py_dict_data def __to_cjson(self, element_coords): - dict = {"element-coordinates" :element_coords} - cjsonData = json.dumps(dict, indent=4) + cjson_dict = {"element-coordinates" :element_coords} + cjsonData = json.dumps(cjson_dict, indent=4) print(cjsonData) def get_atoms_coords(self,filePath): data = self.__open_file(filePath) coords = data["atoms"]["coords"]["3d"] elements = data["atoms"]["elements"]["number"] - # element_coords = {} element_coords = [(*coords[i*3:(i+1)*3], elements[i]) for i in range(0, int(len(coords) / 3))] print(type(element_coords)) - self.__to_cjson(element_coords) - + self.__to_cjson(element_coords) \ No newline at end of file