Skip to content

Commit

Permalink
in radius of gyration average: adding a check to first see if the rgy…
Browse files Browse the repository at this point in the history
… of the simulation has been calculated and saved to avoid repetition
  • Loading branch information
Jgmedina95 committed Aug 8, 2024
1 parent 2d1cc68 commit bb650a1
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions mdagent/tools/base_tools/analysis_tools/rgy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ def rgy_per_frame(self) -> str:
self.rgy_file = (
f"{self.path_registry.ckpt_figures}/radii_of_gyration_{self.traj_file}.csv"
)
np.savetxt(
self.rgy_file, rg_per_frame, delimiter=",", header="Radius of Gyration (nm)"
)
self.path_registry.map_path(
f"rgy_{self.traj_file}",
self.rgy_file,
description=f"Radii of gyration per frame for {self.traj_file}",
)
rgy_id = f"rgy_{self.traj_file}"
if rgy_id not in self.path_registry.list_path_names():
np.savetxt(
self.rgy_file,
rg_per_frame,
delimiter=",",
header="Radius of Gyration (nm)"
)
self.path_registry.map_path(
f"rgy_{self.traj_file}",
self.rgy_file,
description=f"Radii of gyration per frame for {self.traj_file}",
)
return f"Radii of gyration saved to {self.rgy_file}"

def rgy_average(self) -> str:
Expand Down

0 comments on commit bb650a1

Please sign in to comment.