-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add package query in draft.py (not yet enabled) #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f84999a
cc7e607
8ff5ba1
ccadb49
64b00af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,15 +164,27 @@ def get_scenario_all_desc(self, eda_output=None) -> str: | |
| debug_time_limit=f"{DS_RD_SETTING.debug_timeout / 60 / 60 : .2f} hours", | ||
| ) | ||
|
|
||
| def get_runtime_environment(self) -> str: | ||
| def get_runtime_environment(self, pkgs: list[str] | None = None) -> str: | ||
|
||
| # TODO: add it into base class. Environment should(i.e. `DSDockerConf`) should be part of the scenario class. | ||
| """Return runtime environment information. | ||
|
|
||
| If *pkgs* is provided, only versions for those packages will be queried; otherwise | ||
| it falls back to cached *self.required_packages* (if set in Draft stage) or the | ||
| default list defined inside ``runtime_info.py`` for backward-compatibility. | ||
| """ | ||
| # Reuse package list cached during Draft stage when available. | ||
| if pkgs is None and hasattr(self, "required_packages"): | ||
| pkgs = getattr(self, "required_packages") # type: ignore[arg-type] | ||
|
|
||
| env = get_ds_env() | ||
| implementation = FBWorkspace() | ||
| fname = "runtime_info.py" | ||
| implementation.inject_files( | ||
| **{fname: (Path(__file__).absolute().resolve().parent / "runtime_info.py").read_text()} | ||
| ) | ||
| stdout = implementation.execute(env=env, entry=f"python {fname}") | ||
|
|
||
| pkg_args = " ".join(pkgs) if pkgs else "" | ||
| stdout = implementation.execute(env=env, entry=f"python {fname} {pkg_args}") | ||
| return stdout | ||
|
|
||
| def _get_data_folder_description(self) -> str: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this function to rdagent/scenarios/data_science/proposal/exp_gen/utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now moved the functionality of this function to rdagent/scenarios/data_science/proposal/exp_gen/proposal.py, achieving it through one interaction with the Backend API. Therefore, I deem it unnecessary to implement it separately.