Open
Conversation
huppd
reviewed
Jan 27, 2026
Collaborator
huppd
left a comment
There was a problem hiding this comment.
Thanks for these nice improvement. I am not sure how much of it is still needed with the other changes, so it is not very urgent right now.
Comment on lines
+114
to
117
| if np.isnan(arr).any(): | ||
| return np.where(np.isnan(arr), -999999, arr) | ||
|
|
||
| return arr |
Collaborator
There was a problem hiding this comment.
It might be slightly less efficinet, but more readable.
Suggested change
| if np.isnan(arr).any(): | |
| return np.where(np.isnan(arr), -999999, arr) | |
| return arr | |
| return np.where(np.isnan(arr), -999999.0, arr) |
| @@ -217,18 +223,20 @@ def compare_var_and_attr_ds(ds1, ds2, nl, output, location): | |||
| if output: | |||
| if location: | |||
Collaborator
There was a problem hiding this comment.
I think this would be safer:
Suggested change
| if location: | |
| if location is None: |
Comment on lines
227
to
+230
| else: | ||
| script_dir = os.path.dirname(os.path.abspath(__file__)) | ||
| path_name = os.path.join(script_dir, "differences.csv") | ||
| parent_dir = os.path.dirname(script_dir) | ||
| path_name = os.path.join(parent_dir, "differences.csv") |
Collaborator
There was a problem hiding this comment.
I would remove this functionalty out of this routine into `fof_compare``:
if location is None:
location = os.path.join(os.getcwd(), 'differences.csv')
For the pytest, the location can be set to the tmp folder. what do you think?
| """ | ||
| array = fill_nans_for_float32(arr_nan) | ||
| array = replace_nan_with_sentinel(arr_nan) | ||
| expected = np.array([1.0, -9.99999e05, 3.0, 4.0, -9.99999e05], dtype=np.float32) |
Collaborator
There was a problem hiding this comment.
Shouldn't it be now
Suggested change
| expected = np.array([1.0, -9.99999e05, 3.0, 4.0, -9.99999e05], dtype=np.float32) | |
| expected = np.array([1.0, -9.99999e05, 3.0, 4.0, -9.99999e05], dtype=np.float64) |
|
|
||
|
|
||
| def fill_nans_for_float32(arr): | ||
| def replace_nan_with_sentinel(arr): |
Collaborator
There was a problem hiding this comment.
I think now it is also casting to 64bit, so I would add it to the name or at least to the doc string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request ensures that float64 values are accepted and that no temporary files are created during the tests