Skip to content

Commit

Permalink
remove timing collection code
Browse files Browse the repository at this point in the history
  • Loading branch information
ollmer committed May 6, 2024
1 parent e53dea8 commit 9556c4a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions sweagent/environment/swe_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ def add_hook(self, hook: EnvHook):
hook.on_init()
self.hooks.append(hook)

def update_timings(self, dt: float):
self._timings.append(dt)
cached = "_cached" if self.args.cache_task_images else ""
fname = f"env_timings_{self.args.data_path.replace('/', '_')}_{self.args.split}{cached}.yaml"
with open(fname, "w") as f:
yaml.dump(self._timings, f)
logger.debug(f"Total time spent in the environment preparation: {sum(self._timings):.1f} sec")

@property
def _repo_name(self) -> str:
"""Name of the local copy of the repository"""
Expand Down Expand Up @@ -221,7 +213,6 @@ def reset(self, index: Optional[int] = None, apply_test_patch: bool = False) ->
observation (`str`) - output from container
info (`dict`) - additional information (e.g. debugging information)
"""
dt = time.monotonic()
info = {}
info["commit_sha"] = self.commit_sha

Expand All @@ -246,7 +237,6 @@ def reset(self, index: Optional[int] = None, apply_test_patch: bool = False) ->
self.communicate("export $(xargs </.env)")
envs = self.communicate("env")
logger.debug(f"Environment variables after loading cached image:\n{envs}\n")
self.update_timings(time.monotonic() - dt)
if apply_test_patch:
self._apply_test_patch()
return None, info
Expand Down Expand Up @@ -318,8 +308,6 @@ def reset(self, index: Optional[int] = None, apply_test_patch: bool = False) ->
self.container_obj.commit(cached_image)
logger.info(f"Container with environment {self.container_obj.id} cached as image {cached_image}")

self.update_timings(time.monotonic() - dt)

if apply_test_patch:
self._apply_test_patch()
# Write any metadata to info if necessary
Expand Down

0 comments on commit 9556c4a

Please sign in to comment.