Skip to content
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

Avoid out-of-bounds values in Lambert interpolation parameters #718

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions src/kikuchipy/signals/util/_master_pattern.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2019-2024 The kikuchipy developers
#
# Copyright 2019-2025 the kikuchipy developers
#
# This file is part of kikuchipy.
#
Expand All @@ -14,6 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with kikuchipy. If not, see <http://www.gnu.org/licenses/>.
#

# The following copyright notice is included because the following
# functionality in this file is derived and adapted from EMsoft:
Expand Down Expand Up @@ -704,9 +706,9 @@ def _get_lambert_interpolation_parameters(
nij_i = dtype(j_this + scale)
niip_i = nii_i + 1
nijp_i = nij_i + 1
if niip_i > npx:
if niip_i >= npx:
niip_i = nii_i # pragma: no cover
if nijp_i > npy:
if nijp_i >= npy:
nijp_i = nij_i # pragma: no cover
if nii_i < 0:
nii_i = niip_i # pragma: no cover
Expand Down
Loading