-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing usages of index(t) to a more robust isclose() #23
base: main
Are you sure you want to change the base?
Conversation
Hi @robotAstray thanks for this PR. |
@haggaila, thank you for the message, I will work on this and update you. Thank you. |
Signed-off-by: robotAstray <robotastray@cantab.net>
@haggaila I made changes to the logic, I welcome feedback, suggestions. Thank you. |
Signed-off-by: robotAstray <robotastray@cantab.net>
I renamed the function to something more appropriate that closely describe its behaviour. Signed-off-by: robotAstray <robotastray@cantab.net>
Signed-off-by: robotAstray <robotastray@cantab.net>
Thanks @robotAstray it looks better. I still see an issue - |
…rance()` (#3) * `plot_routines.py`: return index of the closest entry in `find_index_nearest_time_within_tolerance()` Signed-off-by: robotAstray <robotastray@cantab.net> * fix docstring in plot_routines.py for `find_index_nearest_time_within_tolerance()` Signed-off-by: robotAstray <robotastray@cantab.net> * fix docstring in plot_routines.py for `find_index_nearest_time_within_tolerance()` Signed-off-by: robotAstray <robotastray@cantab.net> * Create `/test/plot/__init__.py` Signed-off-by: robotAstray <robotastray@cantab.net> * Create test_plot_routines.py to test `find_index_nearest_time_within_tolerance()` Signed-off-by: robotAstray <robotastray@cantab.net> --------- Signed-off-by: robotAstray <robotastray@cantab.net>
Signed-off-by: robotAstray <robotastray@cantab.net>
* remove __init__.py Signed-off-by: robotAstray <robotastray@cantab.net> * __init__.py formatted Signed-off-by: robotAstray <robotastray@cantab.net> --------- Signed-off-by: robotAstray <robotastray@cantab.net>
Hi @haggaila, I've made some changes to the code based on your feedback. I've addressed the issue regarding the function returning |
Summary
This PR addresses issue #11 .
The PR replaces the usage of index(t) with a more robust approach using
np.isclose()
in theplot_routines.py
Details and Comments
Replaced instances of index(t) with a new function called
find_index_nearest_time_within_tolerance()
, utilisingnp.isclose()
. This change ensures more accurate and reliable time comparisons.Introduced the
rtol
parameter to thefind_index_nearest_time_within_tolerance()
function, offering control over the relative precision used in time comparisons.