Skip to content

Commit 2f23de9

Browse files
Update regression-example-ames-no-preproc-val-set.py
Added corrected CICD test for positive case for purge_model_storage_files.
1 parent 49d261c commit 2f23de9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

regression-example-ames-no-preproc-val-set.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from cerebros.denseautomlstructuralcomponent.dense_automl_structural_component\
1111
import zero_7_exp_decay, zero_95_exp_decay, simple_sigmoid
1212
from ast import literal_eval
13-
from os import listdir
13+
from os.path import exists
1414

1515
NUMBER_OF_TRAILS_PER_BATCH = 2
1616
NUMBER_OF_BATCHES_OF_TRIALS = 2
@@ -222,11 +222,12 @@ def hash_based_split(df, # Pandas dataframe
222222
best_model_found = cerebros.get_best_model(purge_model_storage_files=True)
223223
print(best_model_found.summary())
224224

225+
225226
# Verify purge_model_storage_files works:
226227
model_storage_path = f"{PROJECT_NAME}/models"
227-
num_items = len(listdir(model_storage_path))
228-
print(f"There are {num_items} items in {model_storage_path}")
229-
assert num_items == 0
228+
if exists(model_storage_path):
229+
raise ValueError(f"Failed test: Parh {model_storage_path}" should have beed deleted and was not.)
230+
230231

231232
print("result extracted from cerebros")
232233
print(f"Final result was (val_root_mean_squared_error): {result}")

0 commit comments

Comments
 (0)