write_json#

module wntr.msx.io

write_json(msx, path_or_buf, as_library=False, indent=4, **kw_json)[source]#

Write the MSX model to a JSON file

Parameters:
  • msx (MsxModel) – The model to output.

  • path_or_buf (str or IO stream) – Name of the file or file pointer.

  • as_library (bool, optional) – Strip out network-specific elements if True, by default False.

  • kw_json (keyword arguments) – Arguments to pass directly to json.dump().