<commit_before>import sys
import pytest
import math
from ezdxf.algebra.vector import Vector, is_close
PY3 = sys.version_info.major > 2


def test_init_no_params():
    v = Vector()
    assert v == (0, 0, 0)
    assert v == Vector()


def test_init_one_param():
    v = Vector((2, 3))
    assert v == (2, 3)  # z is 0.

    v = Vector((2, 3, 4))
    assert v == (2, 3, 4)  # z is 0.


def test_init_two_params():
    v = Vector(1, 2)
    assert v == (1, 2)  # z is 0.

    v = Vector(5, 6, 7) - Vector(1, 1, 1)
    assert v == (4, 5, 6)

    v = Vector.from_deg_angle(0)
    assert v == (1, 0)

    length, angle = 7, 45
    v = Vector.from_deg_angle(angle, length)
    x = math.cos(math.radians(angle)) * length
    y = math.sin(math.radians(angle)) * length
    assert v == (x, y)


def test_init_three_params():
    v = Vector(1, 2, 3)
    assert v == (1, 2, 3)


def test_from_angle():
    angle = math.radians(50)
    length = 3.
    assert Vector.from_rad_angle(angle, length) == (math.cos(angle) * length, math.sin(angle) * length, 0)


def test_vector_as_tuple():
    v = Vector(1, 2, 3)
    assert v[0] == 1
    assert v[1] == 2
    assert v[2] == 3
    assert tuple(v) == (1, 2, 3)
<commit_msg>added Vector tuple tests<commit_after>import sys
import pytest
import math
from ezdxf.algebra.vector import Vector, is_close
PY3 = sys.version_info.major > 2


def test_init_no_params():
    v = Vector()
    assert v == (0, 0, 0)
    assert v == Vector()


def test_init_one_param():
    v = Vector((2, 3))
    assert v == (2, 3)  # z is 0.

    v = Vector((2, 3, 4))
    assert v == (2, 3, 4)  # z is 0.


def test_init_two_params():
    v = Vector(1, 2)
    assert v == (1, 2)  # z is 0.

    v = Vector(5, 6, 7) - Vector(1, 1, 1)
    assert v == (4, 5, 6)

    v = Vector.from_deg_angle(0)
    assert v == (1, 0)

    length, angle = 7, 45
    v = Vector.from_deg_angle(angle, length)
    x = math.cos(math.radians(angle)) * length
    y = math.sin(math.radians(angle)) * length
    assert v == (x, y)


def test_init_three_params():
    v = Vector(1, 2, 3)
    assert v == (1, 2, 3)


def test_from_angle():
    angle = math.radians(50)
    length = 3.
    assert Vector.from_rad_angle(angle, length) == (math.cos(angle) * length, math.sin(angle) * length, 0)


def test_vector_as_tuple():
    v = Vector(1, 2, 3)
    assert v[0] == 1
    assert v[1] == 2
    assert v[2] == 3
    assert tuple(v) == (1, 2, 3)

    assert isinstance(v[:2], tuple)
    assert v[:2] == (1, 2)
    assert v[1:] == (2, 3)
    assert isinstance(v.xyz, tuple)
    assert v.xyz == (1, 2, 3)

{'fraction_non_alphanumeric': 0.16355866355866355, 'fraction_numerical': 0.04972804972804973, 'mean_word_length': 2.631875881523272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7537553', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1019, 'n_words': 306}