Add find_points_tol for interpolation in RS_budgets.py#232
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a find_points_tol parameter to the interpolate_all_stat_and_pstat_fields_onto_points function in RS_budgets.py to allow users to control the tolerance used when finding interpolation points in the underlying Probes class.
Changes:
- Added
find_points_tolas an optional parameter tointerpolate_all_stat_and_pstat_fields_onto_pointsfunction signature - Passed the
find_points_tolparameter to all threeProbesinstantiations within the function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if_pass_points_to_rank0_only=True, | ||
| interpolation_output_fname="interpolated_fields.hdf5" | ||
| interpolation_output_fname="interpolated_fields.hdf5", | ||
| find_points_tol=None |
There was a problem hiding this comment.
Using None as the default value for find_points_tol will cause the parameter to be passed as None to the Probes class, overriding its default value. This could lead to runtime errors since the downstream find_points method expects a float, not None. Consider either conditionally passing the parameter only when it's not None, or using the same default value as the Probes class (e.g., np.finfo(np.double).eps * 10).
| max_pts=128, | ||
| output_fname = interpolation_output_fname | ||
| output_fname = interpolation_output_fname, | ||
| find_points_tol=find_points_tol |
There was a problem hiding this comment.
Passing find_points_tol=None will override the default value in the Probes class. If find_points_tol is None in the function signature, this should be conditionally passed (only if not None) or a proper default value should be used instead of None.
| max_pts=128, | ||
| output_fname = interpolation_output_fname | ||
| output_fname = interpolation_output_fname, | ||
| find_points_tol=find_points_tol |
There was a problem hiding this comment.
Passing find_points_tol=None will override the default value in the Probes class. If find_points_tol is None in the function signature, this should be conditionally passed (only if not None) or a proper default value should be used instead of None.
| max_pts=128, | ||
| output_fname = interpolation_output_fname | ||
| output_fname = interpolation_output_fname, | ||
| find_points_tol=find_points_tol |
There was a problem hiding this comment.
Passing find_points_tol=None will override the default value in the Probes class. If find_points_tol is None in the function signature, this should be conditionally passed (only if not None) or a proper default value should be used instead of None.
|
Nice! thanks! :D |
Adding a
find_points_toloptional input forinterpolate_all_stat_and_pstat_fields_onto_pointsin RS_budgets.py to be used in the call toProbes