-
Notifications
You must be signed in to change notification settings - Fork 9
Draft: Make fof compare work with radar fof files #103
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,6 +388,13 @@ def check_file_with_tolerances( | |
| diff_df = diff_df.groupby(["file_ID", "variable"]).max() | ||
|
|
||
| if input_file_ref.file_type == FileType.FOF: | ||
| # A value present (non-NaN) in one file but missing (NaN) in the other is a | ||
| # real difference -- an observation appeared or disappeared. The relative | ||
| # diff is NaN there and check_variable would treat NaN as within tolerance, | ||
| # silently passing it; force those cells to fail. Both-NaN stays NaN (and | ||
| # passes), since both being missing means they are equal. | ||
| only_one_nan = df_ref.isna() ^ df_cur.isna() | ||
|
Comment on lines
+391
to
+396
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't this be useful for every
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, should we move this out of the fof file only code path and into the general dataframe code path?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see any reason why not. Do you see any drawbacks? |
||
| diff_df = diff_df.mask(only_one_nan, np.inf) | ||
| diff_df = diff_df.to_frame() | ||
|
|
||
| out, err, tol = check_variable(diff_df, df_tol) | ||
|
|
||
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 guess that needs to be discussed with an expert.