<commit_before>'''
Created on Apr 2, 2015

@author: ayan
'''

from __future__ import (absolute_import, division, print_function)

import numpy as np


def vector_sum(x_arr, y_arr):
    """
    Calculate the vector sum of arrays of
    x and y vectors.

    :param x_arr: array of x-directed vectors
    :type x_arr: numpy.array
    :param y_arr: array of y-directed vectors
    :type y_arr: numpy.array
    :return: array of vector sums
    :rtype: numpy.array

    """
    vector_sum = np.sqrt(x_arr**2 + y_arr**2)
    return vector_sum


def rotate_vectors(x_arr, y_arr, angle_arr):
    """
    Given x and y vectors in a projected coordinate
    system, rotate them by angles into a different
    coordinate system.

    All arrays must have the same dimensions.

    :param x_arr: array of x-directed vectors
    :type x_arr: numpy.array
    :param y_arr: array of y-directed vectors
    :type y_arr: numpy.array<commit_msg>Don't issue warnings in vector_sum<commit_after>'''
Created on Apr 2, 2015

@author: ayan
'''

from __future__ import (absolute_import, division, print_function)

import numpy as np
import numpy.ma as ma


def vector_sum(x_arr, y_arr):
    """
    Calculate the vector sum of arrays of
    x and y vectors.

    :param x_arr: array of x-directed vectors
    :type x_arr: numpy.array
    :param y_arr: array of y-directed vectors
    :type y_arr: numpy.array
    :return: array of vector sums
    :rtype: numpy.array

    """
    vector_sum = ma.sqrt(x_arr**2 + y_arr**2)
    return vector_sum


def rotate_vectors(x_arr, y_arr, angle_arr):
    """
    Given x and y vectors in a projected coordinate
    system, rotate them by angles into a different
    coordinate system.

    All arrays must have the same dimensions.

    :param x_arr: array of x-directed vectors
    :type x_arr: numpy.array
    :param y_arr: array of y-directed vectors
    :type y_arr: numpy.array
{'fraction_non_alphanumeric': 0.08109531332280147, 'fraction_numerical': 0.00737230121116377, 'mean_word_length': 3.1666666666666665, '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': '2193577', 'n_tokens_mistral': 638, 'n_tokens_neox': 596, 'n_words': 227}