Skip to content

Commit

Permalink
Fix stdout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuon committed Aug 30, 2024
1 parent 55a79e8 commit f046a70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jimgw/single_event/runManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def plot_diagnostic(self, path: str = "diagnostic.jpeg", **kwargs):
def save_summary(self, path: str = "", **kwargs):
if path == "":
path = self.run.path + "run_manager_summary.txt"
orig_stdout = sys.stdout
sys.stdout = open(path, "wt")
self.jim.print_summary()
if self.run.injection:
Expand All @@ -472,3 +473,4 @@ def save_summary(self, path: str = "", **kwargs):
networkSNR = jnp.sum(jnp.array(self.SNRs) ** 2) ** (0.5)
print("network SNR is", networkSNR)
sys.stdout.close()
sys.stdout=orig_stdout

0 comments on commit f046a70

Please sign in to comment.