From 12dba00975b9964e73cfef047290771cb5ad1ade Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Tue, 22 Oct 2024 09:14:23 +0000 Subject: [PATCH 1/7] remove package --- constraints/3.10.txt | 234 +------------------------------------------ constraints/3.11.txt | 231 +----------------------------------------- requirements.txt | 24 +---- 3 files changed, 5 insertions(+), 484 deletions(-) diff --git a/constraints/3.10.txt b/constraints/3.10.txt index 0fb187770..76bd8bca1 100644 --- a/constraints/3.10.txt +++ b/constraints/3.10.txt @@ -1,236 +1,6 @@ -aiohttp==3.9.1 -aiosignal==1.3.1 -alabaster==0.7.13 -annotated-types==0.6.0 -anyio==4.2.0 -appdirs==1.4.4 -argon2-cffi==23.1.0 -argon2-cffi-bindings==21.2.0 -arrow==1.3.0 -asttokens==2.4.1 -async-lru==2.0.4 -async-timeout==4.0.3 -attrs==23.2.0 -autodoc-pydantic==2.0.1 -azure-ai-formrecognizer==3.3.2 -azure-common==1.1.28 -azure-core==1.29.6 -azure-identity==1.17.1 -Babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 -bleach==6.1.0 -blosc2==2.7.1 -build==1.0.3 -certifi==2023.11.17 -cffi==1.16.0 -charset-normalizer==3.3.2 -click==8.1.7 -colorama==0.4.6 -comm==0.2.2 -contourpy==1.2.1 -coverage==7.4.0 -cryptography==41.0.7 -cycler==0.12.1 -Cython==3.0.7 -dataclasses-json==0.6.3 -debugpy==1.8.2 -decorator==5.1.1 -defusedxml==0.7.1 dill==0.3.8 -distro==1.9.0 -docker==7.1.0 -docutils==0.20.1 -exceptiongroup==1.2.0 -executing==2.0.1 -fastjsonschema==2.20.0 -feedparser==6.0.11 -filelock==3.13.1 -fire==0.5.0 -fonttools==4.53.1 -fqdn==1.5.1 -frozenlist==1.4.1 -fsspec==2023.12.2 -furo==2023.9.10 -fuzzywuzzy==0.18.0 -git-changelog==2.4.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.2 -httpx==0.26.0 -idna==3.6 -imagesize==1.4.1 -importlib-metadata==7.0.1 -iniconfig==2.0.0 -ipykernel==6.29.5 -ipython==8.26.0 -ipywidgets==8.1.3 -isodate==0.6.1 -isoduration==20.11.0 -isort==5.13.2 -jaraco.classes==3.3.0 -jedi==0.19.1 -jeepney==0.8.0 -joblib==1.4.2 -json5==0.9.25 -jsonpatch==1.33 -jsonpointer==2.4 -jsonschema==4.23.0 -jsonschema-specifications==2023.12.1 -jupyter==1.0.0 -jupyter-console==6.6.3 -jupyter-events==0.10.0 -jupyter-lsp==2.2.5 -jupyter_client==8.6.2 -jupyter_core==5.7.2 -jupyter_server==2.14.2 -jupyter_server_terminals==0.5.3 -jupyterlab==4.2.4 -jupyterlab_pygments==0.3.0 -jupyterlab_server==2.27.3 -jupyterlab_widgets==3.0.11 -keyring==24.3.0 -kiwisolver==1.4.5 -langchain==0.0.353 -langchain-community==0.0.7 -langchain-core==0.1.4 -langsmith==0.0.75 -Levenshtein==0.25.1 -livereload==2.6.3 -loguru==0.7.2 -loguru-mypy==0.0.4 -lxml==5.0.0 -markdown-it-py==3.0.0 -marshmallow==3.20.1 -matplotlib==3.9.1 -matplotlib-inline==0.1.7 -mdit-py-plugins==0.4.0 -mdurl==0.1.2 -mistune==3.0.2 -more-itertools==10.1.0 -msal==1.30.0 -msal-extensions==1.2.0 -msgpack==1.0.8 -msrest==0.7.1 -multidict==6.0.4 -mypy==1.10.0 -mypy-extensions==1.0.0 -myst-parser==2.0.0 -nbclient==0.10.0 -nbconvert==7.16.4 -nbformat==5.10.4 -ndindex==1.8 -nest-asyncio==1.6.0 -nh3==0.2.15 -notebook==7.2.1 -notebook_shim==0.2.4 -numexpr==2.10.1 -numpy==1.26.2 -oauthlib==3.2.2 -openai==1.6.1 -overrides==7.7.0 -pandarallel==1.6.5 -pandas==2.1.4 -pandocfilters==1.5.1 -parso==0.8.4 -pathspec==0.12.1 -pexpect==4.9.0 -pkginfo==1.9.6 -platformdirs==4.1.0 -pluggy==1.3.0 -portalocker==2.10.1 -prometheus_client==0.20.0 -prompt_toolkit==3.0.47 +pillow==10.4.0 psutil==6.0.0 -ptyprocess==0.7.0 -pure_eval==0.2.3 -py-cpuinfo==9.0.0 -pycparser==2.21 -pydantic==2.5.3 -pydantic-settings==2.1.0 -pydantic_core==2.14.6 -Pygments==2.17.2 -PyJWT==2.8.0 -PyMuPDF==1.24.9 -PyMuPDFb==1.24.9 -pyparsing==3.1.2 -pypdf==3.17.4 -pyproject_hooks==1.0.0 -pytest==7.4.4 -python-dotenv==1.0.0 -python-json-logger==2.0.7 -python-Levenshtein==0.25.1 -PyYAML==6.0.1 -pyzmq==26.0.3 -qtconsole==5.5.2 -QtPy==2.4.1 -rapidfuzz==3.9.5 -readme-renderer==42.0 -referencing==0.35.1 -regex==2024.7.24 -requests==2.31.0 -requests-oauthlib==1.3.1 -requests-toolbelt==1.0.0 -rfc3339-validator==0.1.4 -rfc3986==2.0.0 -rfc3986-validator==0.1.1 rich==13.7.0 -rpds-py==0.19.1 -ruamel.yaml==0.18.5 -ruamel.yaml.clib==0.2.8 -ruff==0.4.5 -scikit-learn==1.5.1 -SecretStorage==3.3.3 -semver==3.0.2 -Send2Trash==1.8.3 -setuptools-scm==8.0.4 -sgmllib3k==1.0.0 -shellingham==1.5.4 -sniffio==1.3.0 -snowballstemmer==2.2.0 -soupsieve==2.5 -Sphinx==7.2.6 -sphinx-autobuild==2021.3.14 -sphinx-basic-ng==1.0.0b2 -sphinx-click==5.1.0 -sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 -SQLAlchemy==2.0.24 -stack-data==0.6.3 -tables==3.9.2 -tabulate==0.9.0 -tenacity==8.2.3 -termcolor==2.4.0 -terminado==0.18.1 -threadpoolctl==3.5.0 -tiktoken==0.7.0 -tinycss2==1.3.0 -toml-sort==0.23.1 -tomli==2.0.1 -tomlkit==0.12.3 -tornado==6.4 +scipy==1.11.4 tqdm==4.66.1 -traitlets==5.14.3 -tree-sitter==0.22.3 -tree-sitter-python==0.21.0 -twine==4.0.2 -typer==0.9.0 -types-psutil==6.0.0.20240621 -types-python-dateutil==2.9.0.20240316 -types-PyYAML==6.0.12.20240724 -types-tqdm==4.66.0.20240417 -typing-inspect==0.9.0 -uri-template==1.3.0 -urllib3==2.1.0 -wcwidth==0.2.13 -webcolors==24.6.0 -webencodings==0.5.1 -websocket-client==1.8.0 -widgetsnbextension==4.0.11 -yarl==1.9.4 -zipp==3.17.0 diff --git a/constraints/3.11.txt b/constraints/3.11.txt index cd1c2992a..76bd8bca1 100644 --- a/constraints/3.11.txt +++ b/constraints/3.11.txt @@ -1,233 +1,6 @@ -aiohttp==3.9.1 -aiosignal==1.3.1 -alabaster==0.7.13 -annotated-types==0.6.0 -anyio==4.2.0 -appdirs==1.4.4 -argon2-cffi==23.1.0 -argon2-cffi-bindings==21.2.0 -arrow==1.3.0 -asttokens==2.4.1 -async-lru==2.0.4 -attrs==23.2.0 -autodoc-pydantic==2.0.1 -azure-ai-formrecognizer==3.3.2 -azure-common==1.1.28 -azure-core==1.29.6 -azure-identity==1.17.1 -Babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 -bleach==6.1.0 -blosc2==2.7.1 -build==1.0.3 -certifi==2023.11.17 -cffi==1.16.0 -charset-normalizer==3.3.2 -click==8.1.7 -colorama==0.4.6 -comm==0.2.2 -contourpy==1.2.1 -coverage==7.4.0 -cryptography==41.0.7 -cycler==0.12.1 -Cython==3.0.7 -dataclasses-json==0.6.3 -debugpy==1.8.2 -decorator==5.1.1 -defusedxml==0.7.1 dill==0.3.8 -distro==1.9.0 -docker==7.1.0 -docutils==0.20.1 -executing==2.0.1 -fastjsonschema==2.20.0 -feedparser==6.0.11 -filelock==3.13.1 -fire==0.5.0 -fonttools==4.53.1 -fqdn==1.5.1 -frozenlist==1.4.1 -fsspec==2023.12.2 -furo==2023.9.10 -fuzzywuzzy==0.18.0 -git-changelog==2.4.0 -greenlet==3.0.3 -h11==0.14.0 -httpcore==1.0.2 -httpx==0.26.0 -idna==3.6 -imagesize==1.4.1 -importlib-metadata==7.0.1 -iniconfig==2.0.0 -ipykernel==6.29.5 -ipython==8.26.0 -ipywidgets==8.1.3 -isodate==0.6.1 -isoduration==20.11.0 -isort==5.13.2 -jaraco.classes==3.3.0 -jedi==0.19.1 -jeepney==0.8.0 -joblib==1.4.2 -json5==0.9.25 -jsonpatch==1.33 -jsonpointer==2.4 -jsonschema==4.23.0 -jsonschema-specifications==2023.12.1 -jupyter==1.0.0 -jupyter-console==6.6.3 -jupyter-events==0.10.0 -jupyter-lsp==2.2.5 -jupyter_client==8.6.2 -jupyter_core==5.7.2 -jupyter_server==2.14.2 -jupyter_server_terminals==0.5.3 -jupyterlab==4.2.4 -jupyterlab_pygments==0.3.0 -jupyterlab_server==2.27.3 -jupyterlab_widgets==3.0.11 -keyring==24.3.0 -kiwisolver==1.4.5 -langchain==0.0.353 -langchain-community==0.0.7 -langchain-core==0.1.4 -langsmith==0.0.75 -Levenshtein==0.25.1 -livereload==2.6.3 -loguru==0.7.2 -loguru-mypy==0.0.4 -lxml==5.0.0 -markdown-it-py==3.0.0 -marshmallow==3.20.1 -matplotlib==3.9.1 -matplotlib-inline==0.1.7 -mdit-py-plugins==0.4.0 -mdurl==0.1.2 -mistune==3.0.2 -more-itertools==10.1.0 -msal==1.30.0 -msal-extensions==1.2.0 -msgpack==1.0.8 -msrest==0.7.1 -multidict==6.0.4 -mypy==1.10.0 -mypy-extensions==1.0.0 -myst-parser==2.0.0 -nbclient==0.10.0 -nbconvert==7.16.4 -nbformat==5.10.4 -ndindex==1.8 -nest-asyncio==1.6.0 -nh3==0.2.15 -notebook==7.2.1 -notebook_shim==0.2.4 -numexpr==2.10.1 -numpy==1.26.2 -oauthlib==3.2.2 -openai==1.6.1 -overrides==7.7.0 -pandarallel==1.6.5 -pandas==2.1.4 -pandocfilters==1.5.1 -parso==0.8.4 -pathspec==0.12.1 -pexpect==4.9.0 -pkginfo==1.9.6 -platformdirs==4.1.0 -pluggy==1.3.0 -portalocker==2.10.1 -prometheus_client==0.20.0 -prompt_toolkit==3.0.47 +pillow==10.4.0 psutil==6.0.0 -ptyprocess==0.7.0 -pure_eval==0.2.3 -py-cpuinfo==9.0.0 -pycparser==2.21 -pydantic==2.5.3 -pydantic-settings==2.1.0 -pydantic_core==2.14.6 -Pygments==2.17.2 -PyJWT==2.9.0 -PyMuPDF==1.24.9 -PyMuPDFb==1.24.9 -pyparsing==3.1.2 -pypdf==3.17.4 -pyproject_hooks==1.0.0 -pytest==7.4.4 -python-dotenv==1.0.0 -python-json-logger==2.0.7 -python-Levenshtein==0.25.1 -PyYAML==6.0.1 -pyzmq==26.0.3 -qtconsole==5.5.2 -QtPy==2.4.1 -rapidfuzz==3.9.5 -readme-renderer==42.0 -referencing==0.35.1 -regex==2024.7.24 -requests==2.31.0 -requests-oauthlib==1.3.1 -requests-toolbelt==1.0.0 -rfc3339-validator==0.1.4 -rfc3986==2.0.0 -rfc3986-validator==0.1.1 rich==13.7.0 -rpds-py==0.19.1 -ruamel.yaml==0.18.5 -ruamel.yaml.clib==0.2.8 -ruff==0.4.5 -scikit-learn==1.5.1 -SecretStorage==3.3.3 -semver==3.0.2 -Send2Trash==1.8.3 -setuptools-scm==8.0.4 -sgmllib3k==1.0.0 -shellingham==1.5.4 -sniffio==1.3.0 -snowballstemmer==2.2.0 -soupsieve==2.5 -Sphinx==7.2.6 -sphinx-autobuild==2021.3.14 -sphinx-basic-ng==1.0.0b2 -sphinx-click==5.1.0 -sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 -SQLAlchemy==2.0.24 -stack-data==0.6.3 -tables==3.9.2 -tabulate==0.9.0 -tenacity==8.2.3 -termcolor==2.4.0 -terminado==0.18.1 -threadpoolctl==3.5.0 -tiktoken==0.7.0 -tinycss2==1.3.0 -toml-sort==0.23.1 -tomlkit==0.12.3 -tornado==6.4 +scipy==1.11.4 tqdm==4.66.1 -traitlets==5.14.3 -tree-sitter==0.22.3 -tree-sitter-python==0.21.0 -twine==4.0.2 -typer==0.9.0 -types-psutil==6.0.0.20240621 -types-python-dateutil==2.9.0.20240316 -types-PyYAML==6.0.12.20240724 -types-tqdm==4.66.0.20240417 -typing-inspect==0.9.0 -uri-template==1.3.0 -urllib3==2.1.0 -wcwidth==0.2.13 -webcolors==24.6.0 -webencodings==0.5.1 -websocket-client==1.8.0 -widgetsnbextension==4.0.11 -yarl==1.9.4 -zipp==3.17.0 diff --git a/requirements.txt b/requirements.txt index eebfc6c5d..9df4af662 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,47 +1,29 @@ # Requirements for runtime. -pydantic-settings -typer[all] +autodoc-pydantic -cython python-Levenshtein scikit-learn filelock -loguru-mypy loguru fire fuzzywuzzy openai -ruamel-yaml -tabulate # Convert pandas dataframe to markdown table to make it more readable to LLM numpy # we use numpy as default data format. So we have to install numpy pandas # we use pandas as default data format. So we have to install pandas pandarallel # parallelize pandas -feedparser -matplotlib langchain langchain-community tiktoken pymupdf # Extract shotsreens from pdf -# azure identity related -azure-identity - # PDF related pypdf -azure-core azure-ai-formrecognizer # factor implementations tables -# CI Fix Tool -tree-sitter-python -tree-sitter - -# Jupyter related -jupyter - python-dotenv # infrastructure related. @@ -49,14 +31,10 @@ docker # demo related streamlit -plotly -st-theme # kaggle crawler selenium -kaggle nbformat # tool -seaborn setuptools-scm From 6da4e7650e20a66a0d883b3c0b3f42a894642be2 Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Tue, 22 Oct 2024 09:43:06 +0000 Subject: [PATCH 2/7] reformat with black --- rdagent/app/cli.py | 1 + .../CoSTEER/knowledge_management.py | 26 +++++++++---------- .../CoSTEER/knowledge_management.py | 26 +++++++++---------- rdagent/components/coder/model_coder/model.py | 4 ++- .../components/proposal/factor_proposal.py | 12 +++------ rdagent/components/proposal/model_proposal.py | 12 +++------ rdagent/core/evolving_agent.py | 6 ++--- rdagent/core/evolving_framework.py | 3 +-- rdagent/utils/agent/ret.py | 1 + rdagent/utils/env.py | 6 ++--- 10 files changed, 43 insertions(+), 54 deletions(-) diff --git a/rdagent/app/cli.py b/rdagent/app/cli.py index 0038599da..dca1492a6 100644 --- a/rdagent/app/cli.py +++ b/rdagent/app/cli.py @@ -5,6 +5,7 @@ - make rdagent a nice entry and - autoamtically load dotenv """ + from dotenv import load_dotenv load_dotenv(".env") diff --git a/rdagent/components/coder/factor_coder/CoSTEER/knowledge_management.py b/rdagent/components/coder/factor_coder/CoSTEER/knowledge_management.py index 80d311d35..577d897cd 100644 --- a/rdagent/components/coder/factor_coder/CoSTEER/knowledge_management.py +++ b/rdagent/components/coder/factor_coder/CoSTEER/knowledge_management.py @@ -150,9 +150,9 @@ def query( for target_factor_task in evo.sub_tasks: target_factor_task_information = target_factor_task.get_task_information() if target_factor_task_information in self.knowledgebase.success_task_info_set: - queried_knowledge.success_task_to_knowledge_dict[ - target_factor_task_information - ] = self.knowledgebase.implementation_trace[target_factor_task_information][-1] + queried_knowledge.success_task_to_knowledge_dict[target_factor_task_information] = ( + self.knowledgebase.implementation_trace[target_factor_task_information][-1] + ) elif ( len( self.knowledgebase.implementation_trace.setdefault( @@ -164,14 +164,12 @@ def query( ): queried_knowledge.failed_task_info_set.add(target_factor_task_information) else: - queried_knowledge.working_task_to_former_failed_knowledge_dict[ - target_factor_task_information - ] = self.knowledgebase.implementation_trace.setdefault( - target_factor_task_information, - [], - )[ - -v1_query_former_trace_limit: - ] + queried_knowledge.working_task_to_former_failed_knowledge_dict[target_factor_task_information] = ( + self.knowledgebase.implementation_trace.setdefault( + target_factor_task_information, + [], + )[-v1_query_former_trace_limit:] + ) knowledge_base_success_task_list = list( self.knowledgebase.success_task_info_set, @@ -192,9 +190,9 @@ def query( )[-1] for index in similar_indexes ] - queried_knowledge.working_task_to_similar_successful_knowledge_dict[ - target_factor_task_information - ] = similar_successful_knowledge + queried_knowledge.working_task_to_similar_successful_knowledge_dict[target_factor_task_information] = ( + similar_successful_knowledge + ) return queried_knowledge diff --git a/rdagent/components/coder/model_coder/CoSTEER/knowledge_management.py b/rdagent/components/coder/model_coder/CoSTEER/knowledge_management.py index c9a266fbd..a2647b581 100644 --- a/rdagent/components/coder/model_coder/CoSTEER/knowledge_management.py +++ b/rdagent/components/coder/model_coder/CoSTEER/knowledge_management.py @@ -125,9 +125,9 @@ def query( for target_model_task in evo.sub_tasks: target_model_task_information = target_model_task.get_task_information() if target_model_task_information in self.knowledgebase.success_task_info_set: - queried_knowledge.success_task_to_knowledge_dict[ - target_model_task_information - ] = self.knowledgebase.implementation_trace[target_model_task_information][-1] + queried_knowledge.success_task_to_knowledge_dict[target_model_task_information] = ( + self.knowledgebase.implementation_trace[target_model_task_information][-1] + ) elif ( len( self.knowledgebase.implementation_trace.setdefault( @@ -139,14 +139,12 @@ def query( ): queried_knowledge.failed_task_info_set.add(target_model_task_information) else: - queried_knowledge.working_task_to_former_failed_knowledge_dict[ - target_model_task_information - ] = self.knowledgebase.implementation_trace.setdefault( - target_model_task_information, - [], - )[ - -query_former_trace_limit: - ] + queried_knowledge.working_task_to_former_failed_knowledge_dict[target_model_task_information] = ( + self.knowledgebase.implementation_trace.setdefault( + target_model_task_information, + [], + )[-query_former_trace_limit:] + ) knowledge_base_success_task_list = list( self.knowledgebase.success_task_info_set, @@ -167,7 +165,7 @@ def query( )[-1] for index in similar_indexes ] - queried_knowledge.working_task_to_similar_successful_knowledge_dict[ - target_model_task_information - ] = similar_successful_knowledge + queried_knowledge.working_task_to_similar_successful_knowledge_dict[target_model_task_information] = ( + similar_successful_knowledge + ) return queried_knowledge diff --git a/rdagent/components/coder/model_coder/model.py b/rdagent/components/coder/model_coder/model.py index 66b4a972a..75071c6c8 100644 --- a/rdagent/components/coder/model_coder/model.py +++ b/rdagent/components/coder/model_coder/model.py @@ -29,7 +29,9 @@ def __init__( self.architecture: str = architecture self.variables: str = variables self.hyperparameters: str = hyperparameters - self.model_type: str = model_type # Tabular for tabular model, TimesSeries for time series model, Graph for graph model, XGBoost for XGBoost model + self.model_type: str = ( + model_type # Tabular for tabular model, TimesSeries for time series model, Graph for graph model, XGBoost for XGBoost model + ) super().__init__(name=name, *args, **kwargs) def get_task_information(self): diff --git a/rdagent/components/proposal/factor_proposal.py b/rdagent/components/proposal/factor_proposal.py index df61b0068..48148bb76 100644 --- a/rdagent/components/proposal/factor_proposal.py +++ b/rdagent/components/proposal/factor_proposal.py @@ -27,12 +27,10 @@ def __init__(self, scen: Scenario): # The following methods are scenario related so they should be implemented in the subclass @abstractmethod - def prepare_context(self, trace: Trace) -> Tuple[dict, bool]: - ... + def prepare_context(self, trace: Trace) -> Tuple[dict, bool]: ... @abstractmethod - def convert_response(self, response: str) -> FactorHypothesis: - ... + def convert_response(self, response: str) -> FactorHypothesis: ... def gen(self, trace: Trace) -> FactorHypothesis: context_dict, json_flag = self.prepare_context(trace) @@ -66,12 +64,10 @@ def gen(self, trace: Trace) -> FactorHypothesis: class FactorHypothesis2Experiment(Hypothesis2Experiment[FactorExperiment]): @abstractmethod - def prepare_context(self, hypothesis: Hypothesis, trace: Trace) -> Tuple[dict, bool]: - ... + def prepare_context(self, hypothesis: Hypothesis, trace: Trace) -> Tuple[dict, bool]: ... @abstractmethod - def convert_response(self, response: str, trace: Trace) -> FactorExperiment: - ... + def convert_response(self, response: str, trace: Trace) -> FactorExperiment: ... def convert(self, hypothesis: Hypothesis, trace: Trace) -> FactorExperiment: context, json_flag = self.prepare_context(hypothesis, trace) diff --git a/rdagent/components/proposal/model_proposal.py b/rdagent/components/proposal/model_proposal.py index 1ba45a8fa..4dc50025b 100644 --- a/rdagent/components/proposal/model_proposal.py +++ b/rdagent/components/proposal/model_proposal.py @@ -25,12 +25,10 @@ class ModelHypothesisGen(HypothesisGen): # The following methods are scenario related so they should be implemented in the subclass @abstractmethod - def prepare_context(self, trace: Trace) -> Tuple[dict, bool]: - ... + def prepare_context(self, trace: Trace) -> Tuple[dict, bool]: ... @abstractmethod - def convert_response(self, response: str) -> ModelHypothesis: - ... + def convert_response(self, response: str) -> ModelHypothesis: ... def gen(self, trace: Trace) -> ModelHypothesis: context_dict, json_flag = self.prepare_context(trace) @@ -68,12 +66,10 @@ def __init__(self) -> None: super().__init__() @abstractmethod - def prepare_context(self, hypothesis: Hypothesis, trace: Trace) -> Tuple[dict, bool]: - ... + def prepare_context(self, hypothesis: Hypothesis, trace: Trace) -> Tuple[dict, bool]: ... @abstractmethod - def convert_response(self, response: str, trace: Trace) -> ModelExperiment: - ... + def convert_response(self, response: str, trace: Trace) -> ModelExperiment: ... def convert(self, hypothesis: Hypothesis, trace: Trace) -> ModelExperiment: context, json_flag = self.prepare_context(hypothesis, trace) diff --git a/rdagent/core/evolving_agent.py b/rdagent/core/evolving_agent.py index ca88640d5..e196d0c0a 100644 --- a/rdagent/core/evolving_agent.py +++ b/rdagent/core/evolving_agent.py @@ -25,16 +25,14 @@ def multistep_evolve( evo: EvolvableSubjects, eva: Evaluator | Feedback, filter_final_evo: bool = False, - ) -> EvolvableSubjects: - ... + ) -> EvolvableSubjects: ... @abstractmethod def filter_evolvable_subjects_by_feedback( self, evo: EvolvableSubjects, feedback: Feedback | None, - ) -> EvolvableSubjects: - ... + ) -> EvolvableSubjects: ... class RAGEvoAgent(EvoAgent): diff --git a/rdagent/core/evolving_framework.py b/rdagent/core/evolving_framework.py index 016abad01..46c378e96 100644 --- a/rdagent/core/evolving_framework.py +++ b/rdagent/core/evolving_framework.py @@ -35,8 +35,7 @@ def clone(self) -> EvolvableSubjects: return copy.deepcopy(self) -class QlibEvolvableSubjects(EvolvableSubjects): - ... +class QlibEvolvableSubjects(EvolvableSubjects): ... @dataclass diff --git a/rdagent/utils/agent/ret.py b/rdagent/utils/agent/ret.py index 6aad34334..3c68354ab 100644 --- a/rdagent/utils/agent/ret.py +++ b/rdagent/utils/agent/ret.py @@ -3,6 +3,7 @@ We think this part can be shared. """ + import re from abc import abstractclassmethod from typing import Any diff --git a/rdagent/utils/env.py b/rdagent/utils/env.py index f025676a1..64f16b528 100644 --- a/rdagent/utils/env.py +++ b/rdagent/utils/env.py @@ -122,9 +122,9 @@ def run(self, entry: str | None = None, local_path: Optional[str] = None, env: d class DockerConf(BaseSettings): build_from_dockerfile: bool = False - dockerfile_folder_path: Optional[ - Path - ] = None # the path to the dockerfile optional path provided when build_from_dockerfile is False + dockerfile_folder_path: Optional[Path] = ( + None # the path to the dockerfile optional path provided when build_from_dockerfile is False + ) image: str # the image you want to build mount_path: str # the path in the docker image to mount the folder default_entry: str # the entry point of the image From 195e19ad9a65f1f1aa091378ff9a964542ee6fa0 Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Tue, 22 Oct 2024 09:56:50 +0000 Subject: [PATCH 3/7] fix pytest error --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 9df4af662..62e53e1ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,6 +31,7 @@ docker # demo related streamlit +plotly # kaggle crawler selenium From 6d6cf1e7f62e784afc268360040c891aa9c6522f Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Tue, 22 Oct 2024 09:59:47 +0000 Subject: [PATCH 4/7] fix pytest error --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 62e53e1ba..9dcec652e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ openai numpy # we use numpy as default data format. So we have to install numpy pandas # we use pandas as default data format. So we have to install pandas pandarallel # parallelize pandas +matplotlib langchain langchain-community tiktoken From 696487ce306d8d4aa465b3e32fd7a5d176308617 Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Tue, 22 Oct 2024 10:02:31 +0000 Subject: [PATCH 5/7] fix pytest error --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 9dcec652e..52348c44f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,4 +39,5 @@ selenium nbformat # tool +seaborn setuptools-scm From d3c4db1f198d5a50fcac6658578b0b9fa850b396 Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Thu, 24 Oct 2024 08:32:03 +0000 Subject: [PATCH 6/7] add packages --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 52348c44f..3a31654fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,9 +33,11 @@ docker # demo related streamlit plotly +st-theme # kaggle crawler selenium +kaggle nbformat # tool From f71756d792032e6c99e36f86d4d73aa8e23f52c0 Mon Sep 17 00:00:00 2001 From: SunsetWolf Date: Thu, 24 Oct 2024 09:55:07 +0000 Subject: [PATCH 7/7] change code --- requirements.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3a31654fe..0858575c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Requirements for runtime. -autodoc-pydantic +pydantic-settings python-Levenshtein scikit-learn @@ -25,6 +25,10 @@ azure-ai-formrecognizer # factor implementations tables +# CI Fix Tool +tree-sitter-python +tree-sitter + python-dotenv # infrastructure related.