MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / comm_to_json

Function comm_to_json

python/dolfinx/graph.py:203–218  ·  view source on GitHub ↗

Build and JSON string from a communication graph. The JSON string can be used to construct a `NetworkX `_ graph. This is helpful for cases where a simulation is executed and the graph data is written to file as a JSON string for later analysis. Args:

(graph: AdjacencyList)

Source from the content-addressed store, hash-verified

201
202
203def comm_to_json(graph: AdjacencyList) -> str:
204 """Build and JSON string from a communication graph.
205
206 The JSON string can be used to construct a `NetworkX
207 <https://networkx.org/>`_ graph. This is helpful for cases where a
208 simulation is executed and the graph data is written to file as a
209 JSON string for later analysis.
210
211 Args:
212 graph: The communication graph to convert. Normally created by
213 calling :meth:`comm_graph`.
214
215 Returns:
216 A JSON string representing the communication graph.
217 """
218 return _cpp.graph.comm_to_json(graph._cpp_object)

Callers 2

graphFunction · 0.85
test_comm_graphsFunction · 0.85

Calls 1

comm_to_jsonMethod · 0.80

Tested by 1

test_comm_graphsFunction · 0.68