From 19c972bc7df903686cf56e41b0229c6409cb6bfd Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 9 Jun 2024 17:30:24 +0200 Subject: [PATCH] test sample() only when main --- helper.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/helper.py b/helper.py index df6d2cf..62cbac3 100644 --- a/helper.py +++ b/helper.py @@ -75,12 +75,14 @@ def to_state_string(state, state_nex=None): return state_str -print("Testing") -test_sample([0.7, 0.1, 0.1, 0.1]) -test_sample([0.1, 0.1, 0.2, 0.1]) -test_sample([0.2, 0.8]) -test_sample([0.1, 0.1]) -test_sample([0.3, 0.0, 0.2, 0.0]) -test_sample([0.0, 0.0, 0.0, 0.0]) -test_sample([0.5, 0.0, 0.2, 0.3]) -test_sample([0.3, 0.1, 0.4, 0.2]) + +if __name__ == '__main__': + print("Testing sample()") + test_sample([0.7, 0.1, 0.1, 0.1]) + test_sample([0.1, 0.1, 0.2, 0.1]) + test_sample([0.2, 0.8]) + test_sample([0.1, 0.1]) + test_sample([0.3, 0.0, 0.2, 0.0]) + test_sample([0.0, 0.0, 0.0, 0.0]) + test_sample([0.5, 0.0, 0.2, 0.3]) + test_sample([0.3, 0.1, 0.4, 0.2])