@@ -2072,7 +2072,9 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
20722072 phase_name = "Environmental" ,
20732073 time_removal = False ,
20742074 load_range_percentage = 0.25 ,
2075- number_of_bins = 0 ,
2075+ number_of_range_bins = 0 ,
2076+ number_of_mean_bins = 0 ,
2077+ number_of_dwell_bins = 0 ,
20762078 temperature_range_filtering_limit = 0.0 ,
20772079 time_filtering_limit = 72.0 ,
20782080 time_filtering_limit_units = "hr" ,
@@ -2104,7 +2106,9 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
21042106 phase_name = "Environmental" ,
21052107 time_removal = False ,
21062108 load_range_percentage = 0.25 ,
2107- number_of_bins = 0 ,
2109+ number_of_range_bins = 0 ,
2110+ number_of_mean_bins = 0 ,
2111+ number_of_dwell_bins = 0 ,
21082112 temperature_range_filtering_limit = 0.0 ,
21092113 time_filtering_limit = 72.0 ,
21102114 time_filtering_limit_units = "hr" ,
@@ -2136,7 +2140,9 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
21362140 phase_name = "" ,
21372141 time_removal = False ,
21382142 load_range_percentage = 0.25 ,
2139- number_of_bins = 0 ,
2143+ number_of_range_bins = 0 ,
2144+ number_of_mean_bins = 0 ,
2145+ number_of_dwell_bins = 0 ,
21402146 temperature_range_filtering_limit = 0.0 ,
21412147 time_filtering_limit = 72.0 ,
21422148 time_filtering_limit_units = "hr" ,
@@ -2168,19 +2174,89 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
21682174 phase_name = "Environmental" ,
21692175 time_removal = False ,
21702176 load_range_percentage = 0.25 ,
2171- number_of_bins = - 1 ,
2177+ number_of_range_bins = - 1 ,
2178+ number_of_mean_bins = 0 ,
2179+ number_of_dwell_bins = 0 ,
21722180 temperature_range_filtering_limit = 0.0 ,
21732181 time_filtering_limit = 72.0 ,
21742182 time_filtering_limit_units = "hr" ,
21752183 generated_cycles_label = "Generated Cycles from pySherlock" ,
21762184 )
21772185 )
2178- pytest .fail ("No exception raised when using a missing generated_cycles_label parameter" )
2186+ pytest .fail ("No exception raised when using invalid number_of_range_bins parameter" )
2187+ except Exception as e :
2188+ assert isinstance (e , pydantic .ValidationError )
2189+ assert (
2190+ str (e .errors ()[0 ]["msg" ])
2191+ == "Value error, number_of_range_bins must be greater than or equal to 0."
2192+ )
2193+
2194+ try :
2195+ lifecycle .import_thermal_signal (
2196+ ImportThermalSignalRequest (
2197+ file_name = "C:/Temp/ThermalSignalMissing.csv" ,
2198+ project = "Tutorial Project" ,
2199+ thermal_signal_file_properties = ThermalSignalFileProperties (
2200+ header_row_count = 0 ,
2201+ numeric_format = "English" ,
2202+ column_delimiter = "," ,
2203+ time_column = "Time" ,
2204+ time_units = "sec" ,
2205+ temperature_column = "Temperature" ,
2206+ temperature_units = "C" ,
2207+ ),
2208+ phase_name = "Environmental" ,
2209+ time_removal = False ,
2210+ load_range_percentage = 0.25 ,
2211+ number_of_range_bins = 0 ,
2212+ number_of_mean_bins = - 1 ,
2213+ number_of_dwell_bins = 0 ,
2214+ temperature_range_filtering_limit = 0.0 ,
2215+ time_filtering_limit = 72.0 ,
2216+ time_filtering_limit_units = "hr" ,
2217+ generated_cycles_label = "Generated Cycles from pySherlock" ,
2218+ )
2219+ )
2220+ pytest .fail ("No exception raised when using invalid number_of_mean_bins parameter" )
2221+ except Exception as e :
2222+ assert isinstance (e , pydantic .ValidationError )
2223+ assert (
2224+ str (e .errors ()[0 ]["msg" ])
2225+ == "Value error, number_of_mean_bins must be greater than or equal to 0."
2226+ )
2227+
2228+ try :
2229+ lifecycle .import_thermal_signal (
2230+ ImportThermalSignalRequest (
2231+ file_name = "C:/Temp/ThermalSignalMissing.csv" ,
2232+ project = "Tutorial Project" ,
2233+ thermal_signal_file_properties = ThermalSignalFileProperties (
2234+ header_row_count = 0 ,
2235+ numeric_format = "English" ,
2236+ column_delimiter = "," ,
2237+ time_column = "Time" ,
2238+ time_units = "sec" ,
2239+ temperature_column = "Temperature" ,
2240+ temperature_units = "C" ,
2241+ ),
2242+ phase_name = "Environmental" ,
2243+ time_removal = False ,
2244+ load_range_percentage = 0.25 ,
2245+ number_of_range_bins = 0 ,
2246+ number_of_mean_bins = 0 ,
2247+ number_of_dwell_bins = - 1 ,
2248+ temperature_range_filtering_limit = 0.0 ,
2249+ time_filtering_limit = 72.0 ,
2250+ time_filtering_limit_units = "hr" ,
2251+ generated_cycles_label = "Generated Cycles from pySherlock" ,
2252+ )
2253+ )
2254+ pytest .fail ("No exception raised when using invalid number_of_dwell_bins parameter" )
21792255 except Exception as e :
21802256 assert isinstance (e , pydantic .ValidationError )
21812257 assert (
21822258 str (e .errors ()[0 ]["msg" ])
2183- == "Value error, number_of_bins must be greater than or equal to 0."
2259+ == "Value error, number_of_dwell_bins must be greater than or equal to 0."
21842260 )
21852261
21862262 try :
@@ -2200,7 +2276,9 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
22002276 phase_name = "Environmental" ,
22012277 time_removal = False ,
22022278 load_range_percentage = 0.25 ,
2203- number_of_bins = 0 ,
2279+ number_of_range_bins = 0 ,
2280+ number_of_mean_bins = 0 ,
2281+ number_of_dwell_bins = 0 ,
22042282 temperature_range_filtering_limit = 0.0 ,
22052283 time_filtering_limit = 72.0 ,
22062284 time_filtering_limit_units = "" ,
@@ -2232,7 +2310,9 @@ def helper_test_import_thermal_signal(lifecycle: Lifecycle):
22322310 phase_name = "Environmental" ,
22332311 time_removal = False ,
22342312 load_range_percentage = 0.25 ,
2235- number_of_bins = 0 ,
2313+ number_of_range_bins = 0 ,
2314+ number_of_mean_bins = 0 ,
2315+ number_of_dwell_bins = 0 ,
22362316 temperature_range_filtering_limit = 0.0 ,
22372317 time_filtering_limit = 72.0 ,
22382318 time_filtering_limit_units = "hr" ,
0 commit comments