peak_finder
Created by: JakHolzer
function to find peaks (more detailed description in email)
Merge request reports
Activity
31 """ 32 33 if type(data) is not dict and data["file_type"] != "ccl": 34 print("Data is not a dictionary or was not made from ccl file") 35 36 int_threshold = 0.75 if int_threshold is None else int_threshold 37 prominence = 50 if prominence is None else prominence 38 smooth = False if smooth is None else smooth 39 window_size = 7 if window_size is None else window_size 40 poly_order = 3 if poly_order is None else poly_order 41 42 if 0 <= int_threshold <= 1: 43 pass 44 else: 45 int_threshold = 0.75 46 print( Created by: JakHolzer
Well I though it would be better this way - if the value is wrong, than default is selected instead, function can run and user knows that the input was wrong. I understand, that GUI will not have output for a user to see, but the line can be easily changed to fit your needs. I was thinking that instead of print('value is wrong, set to xx'), you could put some messagebox with similar comment. Let me know what you think, I can change it.
Created by: ivan-usov
I see now, well, I don't have a strong opinion on changing bad parameters to their defaults, but I still have a few comments:
- Default value for
int_threshold
is 0.8 in the function and 0.75 in the check. - It's clearer to check for a negative condition, rather than
pass
on a positive one and do the work insideelse
.
- Default value for