From 43549cf1f1edb971efba00c593444f71c6539d5c Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 29 Dec 2022 08:15:45 -0600 Subject: [PATCH] A couple small changes from original PR comments --- openmc/stats/multivariate.py | 5 ++--- src/distribution_spatial.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index bff8c301a8..799cb9adda 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -627,7 +627,7 @@ class MeshSpatial(Spatial): This distribution specifies a mesh to sample over, chooses whether it will be volume normalized, and can set the source strengths. - .. versionadded:: 0.13 + .. versionadded:: 0.13.3 Parameters ---------- @@ -651,8 +651,7 @@ class MeshSpatial(Spatial): Whether or not the strengths will be normalized by volume. """ - def __init__(self, - mesh, strengths=None, volume_normalized=True): + def __init__(self, mesh, strengths=None, volume_normalized=True): self.mesh = mesh self.strengths = strengths self.volume_normalized = volume_normalized diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index 89fef61558..c1e000fcde 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -243,8 +243,8 @@ Position MeshSpatial::sample(uint64_t* seed) const // Create random variable for sampling element from mesh double eta = prn(seed); // Sample over the CDF defined in initialization above - int32_t elem_bin = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta); - return mesh_ptr_->sample(seed, elem_bin); + int32_t elem_idx = lower_bound_index(mesh_CDF_.begin(), mesh_CDF_.end(), eta); + return mesh_ptr_->sample(seed, elem_idx); } //==============================================================================