Skip to content

Commit ef3774a

Browse files
committed
Added a explore_timeout_s parameter to wait for between experiments. 0 by default.
1 parent 9775cd8 commit ef3774a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

explore_recipe/code_axs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import csv
22
from itertools import product
33
import hashlib
4+
import time
45

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

6869
# Function to retrieve results of parsing, combine and execute commands
69-
def retrieve_and_execute_commands(csv_path, newborn_entry=None, __entry__=None, dry_run=False):
70+
def retrieve_and_execute_commands(csv_path, explore_timeout_s, newborn_entry=None, __entry__=None, dry_run=False):
7071
# Read headers and combinations from the csv file
7172
with open(csv_path, mode="r", newline="", encoding="utf-8") as file:
7273
reader = csv.reader(file)
@@ -116,6 +117,9 @@ def retrieve_and_execute_commands(csv_path, newborn_entry=None, __entry__=None,
116117
print(new_query)
117118
else:
118119
__entry__.get_kernel().byquery(new_query)
120+
121+
if explore_timeout_s > 0 and index < len(combinations) - 1:
122+
time.sleep(explore_timeout_s)
119123

120124
# Store the list of commands in the newborn entry and save it
121125
newborn_entry.plant("query_list", query_list)

explore_recipe/data_axs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
"csv_file_name": "parameters.csv",
1414
"dry_run": false,
1515

16+
"explore_timeout_s": 0,
17+
1618
"csv_path": [ "^^", "parse_and_store_commands" ]
1719
}

0 commit comments

Comments
 (0)