<commit_before># Shift a 3D dataset using SciPy Interpolation libraries.
#
# Developed as part of the tomviz project (www.tomviz.com).


def transform_scalars(dataset, SHIFT=None):

    from tomviz import utils
    from scipy import ndimage

    data_py = utils.get_array(dataset) # Get data as numpy array.

    if data_py is None: #Check if data exists
        raise RuntimeError("No data array found!")

    print('Shifting Images...')

    data_py_return = ndimage.interpolation.shift(data_py, SHIFT, order=0)

    utils.set_array(dataset, data_py_return)
    print('Shifting Complete')<commit_msg>Shift3D: Preserve array order<commit_after># Shift a 3D dataset using SciPy Interpolation libraries.
#
# Developed as part of the tomviz project (www.tomviz.com).


def transform_scalars(dataset, SHIFT=None):

    from tomviz import utils
    from scipy import ndimage
    import numpy as np

    data_py = utils.get_array(dataset) # Get data as numpy array.

    if data_py is None: #Check if data exists
        raise RuntimeError("No data array found!")

    print('Shifting Images...')

    data_py_return = np.empty_like(data_py)
    ndimage.interpolation.shift(data_py, SHIFT, order=0, output=data_py_return)

    utils.set_array(dataset, data_py_return)
    print('Shifting Complete')
{'fraction_non_alphanumeric': 0.08662026295436968, 'fraction_numerical': 0.0038669760247486465, 'mean_word_length': 3.920152091254753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6404731', 'n_tokens_mistral': 418, 'n_tokens_neox': 410, 'n_words': 124}