Skip to content

Commit 727fc3a

Browse files
committed
up
1 parent e09f3cd commit 727fc3a

File tree

10 files changed

+45
-138
lines changed

10 files changed

+45
-138
lines changed

benchmarks/test_computations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_python_clip_vector(benchmark: Any) -> None:
1818
fastvector.python_clip_vector,
1919
args=(v, -1, 1, v),
2020
rounds=NUM_ROUNDS,
21-
iterations=NUM_ITERATIONS
21+
iterations=NUM_ITERATIONS,
2222
)
2323

2424

@@ -27,7 +27,7 @@ def test_naive_cython_clip_vector(benchmark: Any) -> None:
2727
fastvector.naive_cython_clip_vector,
2828
args=(v, -1, 1, v),
2929
rounds=NUM_ROUNDS,
30-
iterations=NUM_ITERATIONS
30+
iterations=NUM_ITERATIONS,
3131
)
3232

3333

@@ -36,7 +36,7 @@ def test_cython_clip_vector(benchmark: Any) -> None:
3636
fastvector.cython_clip_vector,
3737
args=(v, -1, 1, v),
3838
rounds=NUM_ROUNDS,
39-
iterations=NUM_ITERATIONS
39+
iterations=NUM_ITERATIONS,
4040
)
4141

4242

@@ -45,5 +45,5 @@ def test_np_clip(benchmark: Any) -> None:
4545
np.clip,
4646
args=(a, -1, 1, a),
4747
rounds=NUM_ROUNDS,
48-
iterations=NUM_ITERATIONS
48+
iterations=NUM_ITERATIONS,
4949
)

fastvector/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22
from .version import __version__
33

44

5-
__all__ = [
6-
'Vector2D'
7-
'__version__'
8-
]
5+
__all__ = ["Vector2D", "__version__"]

fastvector/computations.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

fastvector/cython_computations.pyx

Lines changed: 0 additions & 36 deletions
This file was deleted.

fastvector/dtypes.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

fastvector/vector.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ def __init__(self, x: SupportsFloat = 0.0, y: SupportsFloat = 0.0) -> None:
2323
self.x = x
2424
self.y = y
2525
else:
26-
raise TypeError('You must pass in int/float value for x and y!')
26+
raise TypeError("You must pass in int/float value for x and y!")
2727

2828
def __repr__(self) -> str:
2929
"""Return the vector representation.
3030
3131
Returns:
3232
The representation of the vector.
3333
"""
34-
return f'vector.Vector2D({self.x}, {self.y})'
34+
return f"vector.Vector2D({self.x}, {self.y})"
3535

3636
def __str__(self) -> str:
3737
"""The vector as a string.
3838
3939
Returns:
4040
The vector as a string.
4141
"""
42-
return f'({self.x}, {self.y})'
42+
return f"({self.x}, {self.y})"
4343

4444
def __abs__(self) -> float:
4545
"""Return the length (magnitude) of the vector.
@@ -74,7 +74,7 @@ def __lt__(self, other_vector: Vector2D) -> bool:
7474
False, else.
7575
"""
7676
if not isinstance(other_vector, Vector2D):
77-
raise TypeError('You must pass in a Vector2D instance!')
77+
raise TypeError("You must pass in a Vector2D instance!")
7878
return abs(self) < abs(other_vector)
7979

8080
def __add__(self, other_vector: Vector2D) -> Vector2D:
@@ -87,7 +87,7 @@ def __add__(self, other_vector: Vector2D) -> Vector2D:
8787
The addition vector of the self and the other vector.
8888
"""
8989
if not isinstance(other_vector, Vector2D):
90-
raise TypeError('You must pass in a Vector2D instance!')
90+
raise TypeError("You must pass in a Vector2D instance!")
9191
x = self.x + other_vector.x
9292
y = self.y + other_vector.y
9393
return Vector2D(x, y)
@@ -102,7 +102,7 @@ def __sub__(self, other_vector: Vector2D) -> Vector2D:
102102
The subtraction vector of the self and the other vector.
103103
"""
104104
if not isinstance(other_vector, Vector2D):
105-
raise TypeError('You must pass in a Vector2D instance!')
105+
raise TypeError("You must pass in a Vector2D instance!")
106106
x = self.x - other_vector.x
107107
y = self.y - other_vector.y
108108
return Vector2D(x, y)
@@ -125,7 +125,7 @@ def __mul__(
125125
result: SupportsFloat = self.x * other.x + self.y * other.y
126126
return result
127127
if not isinstance(other, numbers.Real):
128-
raise TypeError('You must pass in an int/float!')
128+
raise TypeError("You must pass in an int/float!")
129129
return Vector2D(self.x * other, self.y * other)
130130

131131
def __truediv__(self, other: SupportsFloat) -> Vector2D:
@@ -142,5 +142,5 @@ def __truediv__(self, other: SupportsFloat) -> Vector2D:
142142
The multiplication of self and the other vector/number.
143143
"""
144144
if not isinstance(other, numbers.Real):
145-
raise TypeError('You must pass in an int/float!')
145+
raise TypeError("You must pass in an int/float!")
146146
return Vector2D(self.x / other, self.y / other)

fastvector/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.0.0'
1+
__version__ = "4.0.0"

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[metadata]
33
name = fastvector
4-
version = 3.0.0
4+
version = 4.0.0
55
description = "This is a simple vector python package."
66
long_description = file: README.md
77
long_description_content_type = text/markdown

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ def main() -> None:
1010
with open("requirements.txt") as fp:
1111
install_requires = fp.read().strip().split("\n")
1212

13-
metadata = dict(
14-
install_requires=install_requires
15-
)
13+
metadata = dict(install_requires=install_requires)
1614
setup(**metadata)
1715

1816

0 commit comments

Comments
 (0)