Skip to content

API catch for short signal #4

Description

@kcpevey

The catch for failing to converge on a solution (and the note to provide a longer signal) is not included in the API call. With the API, this will fail with only the scipy error Number of calls to function has reached maxfev and no other info. Something similar to what's below should be mimicked in the API

main_deconstruct.py Line 106:  
  
    try:
        tide = harmonica.Tide().deconstruct_tide(df[wl], df['datetimes'], cons=args.cons,
            n_period=args.num_periods, positive_ph=args.positive_phase)
    except RuntimeWarning as w:
        if 'Number of calls to function has reached maxfev' in str(w):
            print("\nThe solver failed to converge to a solution. Provide a longer signal.")
        else:
            print(str(w))
        print('\nFailed.\n')
        return

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions