Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects

peak_finder

Merged usov_i requested to merge JakHolzer-peak-finder into det1d

Created by: JakHolzer

function to find peaks (more detailed description in email)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Owner

    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!

  • usov_i
  • usov_i
    usov_i @usov_i started a thread on commit f9ced1ce
  • 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(
    • Author Owner

      Created by: ivan-usov

      If you consider that the parameter is invalid, then raise ValueError(). The function should be aborted, rather than continued.

    • Author Owner

      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.

    • Author Owner

      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 inside else.
    • Author Owner

      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!

  • Author Owner

    Created by: ivan-usov

    Review: Approved

  • Author Owner

    Merged by: ivan-usov at 2020-09-15 12:26:01 UTC

  • Please register or sign in to reply
    Loading