Skip to content

Commit

Permalink
Added a explore_timeout_s parameter to wait for between experiments. …
Browse files Browse the repository at this point in the history
…0 by default.
  • Loading branch information
mosalov committed Jan 29, 2025
1 parent 9775cd8 commit ef3774a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion explore_recipe/code_axs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import csv
from itertools import product
import hashlib
import time

# Function to preprocess the input query by removing a specific prefix
def preprocess_query(query, beginning_to_remove = "explore,"):
Expand Down Expand Up @@ -66,7 +67,7 @@ def parse_and_store_commands(__query, stored_newborn_entry=None, csv_file_name="
return csv_path

# Function to retrieve results of parsing, combine and execute commands
def retrieve_and_execute_commands(csv_path, newborn_entry=None, __entry__=None, dry_run=False):
def retrieve_and_execute_commands(csv_path, explore_timeout_s, newborn_entry=None, __entry__=None, dry_run=False):
# Read headers and combinations from the csv file
with open(csv_path, mode="r", newline="", encoding="utf-8") as file:
reader = csv.reader(file)
Expand Down Expand Up @@ -116,6 +117,9 @@ def retrieve_and_execute_commands(csv_path, newborn_entry=None, __entry__=None,
print(new_query)
else:
__entry__.get_kernel().byquery(new_query)

if explore_timeout_s > 0 and index < len(combinations) - 1:
time.sleep(explore_timeout_s)

# Store the list of commands in the newborn entry and save it
newborn_entry.plant("query_list", query_list)
Expand Down
2 changes: 2 additions & 0 deletions explore_recipe/data_axs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
"csv_file_name": "parameters.csv",
"dry_run": false,

"explore_timeout_s": 0,

"csv_path": [ "^^", "parse_and_store_commands" ]
}

0 comments on commit ef3774a

Please sign in to comment.