MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _write_to_file

Method _write_to_file

monai/transforms/io/array.py:563–571  ·  view source on GitHub ↗
(self, log_data)

Source from the content-addressed store, hash-verified

561 return img
562
563 def _write_to_file(self, log_data):
564 try:
565 with self.mapping_file_path.open("r") as f:
566 existing_log_data = json.load(f)
567 except (FileNotFoundError, json.JSONDecodeError):
568 existing_log_data = []
569 existing_log_data.append(log_data)
570 with self.mapping_file_path.open("w") as f:
571 json.dump(existing_log_data, f, indent=4)

Callers 1

__call__Method · 0.95

Calls 2

loadMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected