Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions pysemtools/postprocessing/statistics/RS_budgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ def interpolate_all_stat_and_pstat_fields_onto_points(
if_do_dssum_before_interp=True,
if_create_boundingBox_for_interp=False,
if_pass_points_to_rank0_only=True,
interpolation_output_fname="interpolated_fields.hdf5"
interpolation_output_fname="interpolated_fields.hdf5",
find_points_tol=None
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
):

from mpi4py import MPI # equivalent to the use of MPI_init() in C
Expand Down Expand Up @@ -958,34 +959,24 @@ def interpolate_all_stat_and_pstat_fields_onto_points(
# point_interpolator_type="multiple_point_legendre_numpy", \
# global_tree_type="domain_binning" , \
# max_pts = 256 )

probe_kwargs = {
"comm": comm,
"msh": msh,
"point_interpolator_type": "multiple_point_legendre_numpy",
"max_pts": 128,
"output_fname": interpolation_output_fname,
}
if find_points_tol is not None:
probe_kwargs["find_points_tol"] = find_points_tol

if not if_pass_points_to_rank0_only:
probes = Probes(
comm,
probes=xyz,
msh=msh,
point_interpolator_type="multiple_point_legendre_numpy",
max_pts=128,
output_fname = interpolation_output_fname
)
probes = Probes(probes=xyz, **probe_kwargs)
else:
if comm.Get_rank() == 0:
probes = Probes(
comm,
probes=xyz,
msh=msh,
point_interpolator_type="multiple_point_legendre_numpy",
max_pts=128,
output_fname = interpolation_output_fname
)
probes = Probes(probes=xyz, **probe_kwargs)
else:
probes = Probes(
comm,
probes=None,
msh=msh,
point_interpolator_type="multiple_point_legendre_numpy",
max_pts=128,
output_fname = interpolation_output_fname
)
probes = Probes(probes=None, **probe_kwargs)

###########################################################################################
for fname in these_names:
Expand Down