lindbladmpo icon indicating copy to clipboard operation
lindbladmpo copied to clipboard

Changing usages of index(t) to a more robust isclose()

Open robotAstray opened this issue 11 months ago • 5 comments

Summary

This PR addresses issue #11 . The PR replaces the usage of index(t) with a more robust approach using np.isclose() in the plot_routines.py

Details and Comments

  • Replaced instances of index(t) with a new function called find_index_nearest_time_within_tolerance(), utilising np.isclose(). This change ensures more accurate and reliable time comparisons.

  • Introduced the rtol parameter to the find_index_nearest_time_within_tolerance() function, offering control over the relative precision used in time comparisons.

robotAstray avatar Aug 04 '23 17:08 robotAstray