uf3.util.json_io.dump_interaction_map

dump_interaction_map(interaction_map, indent=4, filename=None, write=False)[source]
Utility function for writing ragged arrays to json file.

e.g. {(“A”, “B”): [[1, 2, 3], [4, 5], [6, 7, 8, 9]]}

Parameters
  • interaction_map (dict) – map of interaction to ragged array containing np.ndarry vectors.

  • indent (int) – number of spaces to indent.

  • filename (str) – name of file to write.

  • write (bool) – whether to write to file.