-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparameters_testing_classic.py
46 lines (37 loc) · 1.26 KB
/
parameters_testing_classic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
This module is testing the impact the change of input parameters
has to the result (the time and error of the simulation)
"""
import numpy as np # type: ignore
from parameters_testing_utilities import aggregate_all_tests
from heat_transfer_simulation import create_and_run_simulation
def perform_tests():
"""
Running all the test scenarios defined withing it
"""
no_of_repetitions = 5
steps = 200
# Defining all the scenarios we want to test
testing_scenarios = [
{
"parameter": "number_of_elements",
# "values": list(map(int, np.linspace(10, 1000, steps)))
"values": range(1, 100, 50)
},
{
"parameter": "dt",
# "values": list(map(int, np.linspace(1, 1000, steps)))
"values": range(20, 120, 50)
},
{
"parameter": "theta",
# "values": np.linspace(0.5, 1.0, steps)
"values": np.arange(0.5, 1.0, 0.2)
}
]
aggregate_all_tests(simulation_func=create_and_run_simulation,
testing_scenarios=testing_scenarios,
no_of_repetitions=no_of_repetitions,
description="classic")
if __name__ == '__main__':
perform_tests()