<commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst

import warnings

import numpy as np
from .core import Kernel, Kernel1D, Kernel2D
from ..utils.exceptions import AstropyUserWarning

# Disabling all doctests in this module until a better way of handling warnings
# in doctests can be determined
__doctest_skip__ = ['*']


def convolve(array, kernel, boundary=None, fill_value=0.,
             normalize_kernel=False):
    '''
    Convolve an array with a kernel.

    This routine differs from `scipy.ndimage.filters.convolve` because
    it includes a special treatment for `NaN` values. Rather than
    including `NaNs` in the convolution calculation, which causes large
    `NaN` holes in the convolved image, `NaN` values are replaced with
    interpolated values using the kernel as an interpolation function.
<commit_msg>Changed default of convolve to 'fill'<commit_after># Licensed under a 3-clause BSD style license - see LICENSE.rst

import warnings

import numpy as np
from .core import Kernel, Kernel1D, Kernel2D
from ..utils.exceptions import AstropyUserWarning

# Disabling all doctests in this module until a better way of handling warnings
# in doctests can be determined
__doctest_skip__ = ['*']


def convolve(array, kernel, boundary='fill', fill_value=0.,
             normalize_kernel=False):
    '''
    Convolve an array with a kernel.

    This routine differs from `scipy.ndimage.filters.convolve` because
    it includes a special treatment for `NaN` values. Rather than
    including `NaNs` in the convolution calculation, which causes large
    `NaN` holes in the convolved image, `NaN` values are replaced with
    interpolated values using the kernel as an interpolation function.

{'fraction_non_alphanumeric': 0.06329113924050633, 'fraction_numerical': 0.004602991944764097, 'mean_word_length': 4.055232558139535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3198406', 'n_tokens_mistral': 490, 'n_tokens_neox': 462, 'n_words': 209}