peak_finder #64
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "JakHolzer-peak-finder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: JakHolzer
function to find peaks (more detailed description in email)
Created by: ivan-usov
Normally, we try to keep the code "to the left", meaning lower number of indentations is better. Here you can check for a failed condition and do the early exit (guard clause), e.g. instead of
do
Created by: ivan-usov
Review: Changes requested
Try to push the change to the same branch (JakHolzer-peak-finder) and the changes will appear here. Then we can merge!
Created by: JakHolzer
done 👍
Created by: ivan-usov
You can simply replace the default values of function's optional arguments with those numbers.
Created by: ivan-usov
If you consider that the parameter is invalid, then
raise ValueError()
. The function should be aborted, rather than continued.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: JakHolzer
Thank you, that really does look much better.
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:
int_threshold
is 0.8 in the function and 0.75 in the check.pass
on a positive one and do the work insideelse
.Created by: JakHolzer
Both corrected. I must admit that now, when I can see the original code and the new one, I'm starting to see a bit the "programming" thinking. Thank you!
Created by: ivan-usov
Review: Approved
Merged by: ivan-usov at 2020-09-15 12:26:01 UTC