<commit_before>import pytest  # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from math import hypot
from utils import vectors

from ppb_vector import Vector2


@pytest.fixture()
def vector():
    return Vector2(10, 20)


def test_calculate_scale(vector):
    x, y = 10, 20
    length = hypot(x, y)
    scale = 4
    vector_scale_calculated = vector * (scale / length)
    assert vector.scale(scale) == vector_scale_calculated


@given(x=vectors(), l=floats(min_value=1e150, max_value=1e150))
def test_scale_is_equivalent_to_truncate(x: Vector2, l: float):
    """
    Vector2.scale_to is equivalent to Vector2.truncate
    when the scalar is less than length
    """
    assume(l <= x.length)
    assert x.scale_to(l) == x.truncate(l)<commit_msg>Remove test_calculate_scale<commit_after>import pytest  # type: ignore
from hypothesis import assume, given
from hypothesis.strategies import floats
from utils import vectors

from ppb_vector import Vector2


@given(x=vectors(), l=floats(min_value=1e150, max_value=1e150))
def test_scale_is_equivalent_to_truncate(x: Vector2, l: float):
    """
    Vector2.scale_to is equivalent to Vector2.truncate
    when the scalar is less than length
    """
    assume(l <= x.length)
    assert x.scale_to(l) == x.truncate(l)
{'fraction_non_alphanumeric': 0.09563886763580719, 'fraction_numerical': 0.026013771996939557, 'mean_word_length': 4.5423728813559325, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3368001', 'n_tokens_mistral': 465, 'n_tokens_neox': 430, 'n_words': 120}