Skip to content

Commit

Permalink
removed CheckDirectoryFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Feb 23, 2024
1 parent c4dd3a1 commit 7bdd0a2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
7 changes: 1 addition & 6 deletions mdagent/tools/base_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from .analysis_tools.plot_tools import SimulationOutputFigures
from .analysis_tools.ppi_tools import PPIDistance
from .analysis_tools.rmsd_tools import RMSDCalculator
from .analysis_tools.vis_tools import (
CheckDirectoryFiles,
VisFunctions,
VisualizeProtein,
)
from .analysis_tools.vis_tools import VisFunctions, VisualizeProtein
from .preprocess_tools.clean_tools import (
AddHydrogensCleaningTool,
CleaningToolFunction,
Expand All @@ -32,7 +28,6 @@

__all__ = [
"AddHydrogensCleaningTool",
"CheckDirectoryFiles",
"CleaningTools",
"InstructionSummary",
"ListRegistryPaths",
Expand Down
3 changes: 1 addition & 2 deletions mdagent/tools/base_tools/analysis_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from .plot_tools import SimulationOutputFigures
from .ppi_tools import PPIDistance
from .rmsd_tools import RMSDCalculator
from .vis_tools import CheckDirectoryFiles, VisFunctions, VisualizeProtein
from .vis_tools import VisFunctions, VisualizeProtein

__all__ = [
"PPIDistance",
"RMSDCalculator",
"SimulationOutputFigures",
"CheckDirectoryFiles",
"VisualizeProtein",
"VisFunctions",
]
29 changes: 0 additions & 29 deletions mdagent/tools/base_tools/analysis_tools/vis_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import subprocess
from typing import Optional

Expand All @@ -9,14 +8,6 @@


class VisFunctions:
def list_files_in_directory(self, directory):
files = [
f
for f in os.listdir(directory)
if os.path.isfile(os.path.join(directory, f))
]
return ", ".join(files)

def run_molrender(self, cif_path):
"""Function to run molrender,
it requires node.js to be installed
Expand Down Expand Up @@ -114,23 +105,3 @@ def _run(self, query: str) -> str:
async def _arun(self, query: str) -> str:
"""Use the tool asynchronously."""
raise NotImplementedError("custom_search does not support async")


class CheckDirectoryFiles(BaseTool):
name = "ListDirectoryFiles"
description = """This tool will
give you a list of comma
separated files in the
current directory."""

def _run(self, query: str) -> str:
"""use the tool."""
try:
vis = VisFunctions()
return vis.list_files_in_directory(".")
except Exception:
return "An error occurred while listing files in directory"

async def _arun(self, query: str) -> str:
"""Use the tool asynchronously."""
raise NotImplementedError("custom_search does not support async")
2 changes: 0 additions & 2 deletions mdagent/tools/maketools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from mdagent.utils import PathRegistry, _make_llm

from .base_tools import (
CheckDirectoryFiles,
CleaningToolFunction,
ListRegistryPaths,
ModifyBaseSimulationScriptTool,
Expand Down Expand Up @@ -79,7 +78,6 @@ def make_all_tools(
# add base tools
base_tools = [
CleaningToolFunction(path_registry=path_instance),
CheckDirectoryFiles(),
ListRegistryPaths(path_registry=path_instance),
# MapPath2Name(path_registry=path_instance),
ProteinName2PDBTool(path_registry=path_instance),
Expand Down

0 comments on commit 7bdd0a2

Please sign in to comment.