-
Notifications
You must be signed in to change notification settings - Fork 73
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
Change assert #712
Change assert #712
Conversation
I believe that all the |
If that fixes it, go ahead. I don't think there is a way to ignore the index column in that function. As for the one in corrections_test, don't worry about it. That is a flaky test that will be removed soon. |
Yes!! The fails were local |
It appears for me that travis still hasn't finished, is there something wrong with travis? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this PR should have 2 commits, one where the function in testing_utils are replaced with the pandas one, and other where esmeralda and beersheba test are corrected for different indices. (Basically squash first three commits and give it a meaningful name)
@@ -27,7 +27,9 @@ def test_create_deconvolution_df(ICDATADIR): | |||
CutType.abs, ecut, 3) for _, t in true_dst.groupby('event')]) | |||
true_dst = true_dst.loc[true_dst.E > ecut, :].reset_index(drop=True) | |||
|
|||
assert_dataframes_close(new_dst, true_dst) | |||
#new_dst .reset_index(drop=True)# | |||
#true_dst.reset_index(drop=True)# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove instead of comment
@@ -163,7 +163,8 @@ def test_esmeralda_tracks_exact(data_hdst, esmeralda_tracks, correction_map_file | |||
#some events are not in df_tracks_exact | |||
events = df_tracks_exact.event.unique() | |||
df_tracks_cut = df_tracks[df_tracks.event.isin(events)] | |||
assert_dataframes_close (df_tracks_cut[columns2], df_tracks_exact[columns2]) | |||
|
|||
assert_dataframes_close (df_tracks_cut[columns2].reset_index(drop=True), df_tracks_exact[columns2].reset_index(drop=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe split the line, is a bit long
|
||
def assert_dataframes_close(df1, df2, check_types=True, rtol=None, atol=None, **kwargs): | ||
if rtol: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone else also check this makes sense, @gonzaponte , @andLaing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR replaces dataframe comparison from the custom to pandas one, that is more suitable when comparing mixed (floats and strings) dataframes. Good job @MiryamMV and welcome to IC developers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR replaces dataframe comparison from the custom to pandas one, that is more suitable when comparing mixed (floats and strings) dataframes. Good job @MiryamMV and welcome to IC developers!
After replacing the _compare_dataframes IC function with the pandas.testing function assert_frame_equal (with @mmkekic help) there are 3 test that fail. These are beersheba_test.py (not clear), esmeralda_test.py (it fails because the index of the compared dataframes is different) and corrections_test.py (not clear to me either, but apparently not related to the changes I made).
@mmkekic suggested to open this PR so we can discuss what approach to take @andLaing @gonzaponte