Skip to content

Commit

Permalink
small typo
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 committed Jul 8, 2024
1 parent 2a838cb commit 3dd9923
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions manage/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def manage_standardize(dbgym_cfg):
help="The mode to clean the workspace (default=\"safe\"). \"aggressive\" means \"only keep run_*/ folders referenced by a file in symlinks/\". \"safe\" means \"in addition to that, recursively keep any run_*/ folders referenced by any symlinks in run_*/ folders we are keeping.\""
)
def manage_clean(dbgym_cfg: DBGymConfig, mode: str):
clean_workspace(dbgym_cfg, mode)
clean_workspace(dbgym_cfg, mode=mode, verbose=True)


@click.command("count")
Expand Down Expand Up @@ -128,7 +128,7 @@ def _count_files_in_workspace(dbgym_cfg: DBGymConfig) -> int:
return total_count


def clean_workspace(dbgym_cfg: DBGymConfig, mode: str="safe") -> None:
def clean_workspace(dbgym_cfg: DBGymConfig, mode: str="safe", verbose=False) -> None:
"""
Clean all [workspace]/task_runs/run_*/ directories that are not referenced by any "active symlinks".
If mode is "aggressive", "active symlinks" means *only* the symlinks directly in [workspace]/symlinks/.
Expand Down Expand Up @@ -205,8 +205,10 @@ def clean_workspace(dbgym_cfg: DBGymConfig, mode: str="safe") -> None:
else:
os.remove(child_fordpath)
ending_num_files = _count_files_in_workspace(dbgym_cfg)
print(f"Removed {starting_num_files - ending_num_files} out of {starting_num_files} files")
print(f"Workspace went from {starting_num_files - ending_num_files} to {starting_num_files}")

if verbose:
print(f"Removed {starting_num_files - ending_num_files} out of {starting_num_files} files")
print(f"Workspace went from {starting_num_files - ending_num_files} to {starting_num_files}")


manage_group.add_command(manage_show)
Expand Down
2 changes: 0 additions & 2 deletions manage/tests/test_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,6 @@ def test_outside_task_runs_doesnt_get_deleted(self):
clean_workspace(MockDBGymConfig(self.scratchspace_path), mode="safe")
self.assertTrue(CleanTests.verify_structure(self.scratchspace_path, ending_structure))

# test symlinks that point to strings which aren't absolute paths


if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion tune/protox/env/util/pg_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def start_with_changes(
# still have the previous checkpoint available to us
f"{self.checkpoint_dbdata_snapshot_fpath}.tmp",
"-C",
parent_dir(self.dbdata_dpath),
parent_dpath_of_path(self.dbdata_dpath),
self.dbdata_dpath,
].run()

Expand Down

0 comments on commit 3dd9923

Please sign in to comment.