diff --git a/hetpy/__init__.py b/hetpy/__init__.py index 7d4d7cb..1f54d24 100644 --- a/hetpy/__init__.py +++ b/hetpy/__init__.py @@ -20,7 +20,7 @@ -__version__ = '1.0.3' +__version__ = '1.0.3a' __author__ = 'Fabian Kneissl' __credits__ = 'Database Systems Research Group | Heidelberg University' diff --git a/hetpy/models/hetGraph.py b/hetpy/models/hetGraph.py index 804d598..a39324a 100644 --- a/hetpy/models/hetGraph.py +++ b/hetpy/models/hetGraph.py @@ -460,19 +460,19 @@ def export_to_json(self, filepath: str, layout_function='auto'): """ layout = self.graph.layout(layout=layout_function) edges_json = [] - for index, edge in enumerate(self.edges): + for edge in self.edges: edge_dict = {e: getattr(edge, e) for e in dir(edge) if not e.startswith('__') and e != "nodes"} edge_dict["source"] = edge.source.id edge_dict["target"] = edge.target.id - edge_dict["position"] = { - "x": layout.coords[index][0], - "y": layout.coords[index][0] - } edges_json.append(edge_dict) nodes_json = [] - for node in self.nodes: + for index, node in enumerate(self.nodes): node_dict = {n: getattr(node, n) for n in dir(node) if not n.startswith('__')} + node_dict["position"] = { + "x": layout.coords[index][0], + "y": layout.coords[index][0] + } nodes_json.append(node_dict) path_definitions = [] diff --git a/setup.py b/setup.py index 6503663..278dc14 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='hetpy', - version='1.0.3', + version='1.0.3a', description='A package to handle heterogeneous information networks', url='https://github.com/codingfabi/hetpy', author='Fabian Kneissl',