Skip to content

Commit 04a3445

Browse files
committed
remove get_quadrant, bump to v0.2.0
1 parent 700be65 commit 04a3445

4 files changed

Lines changed: 3 additions & 30 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ A SICP'ish Points implemented in Python using hexlet-pairs.
1010
>>> p = points.make(100, 200)
1111
>>> print(points.to_string(p))
1212
(100, 200)
13-
>>> points.get_quadrant(p)
14-
1
1513
>>> points.get_x(p)
1614
100
1715
>>> points.get_y(p)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "hexlet-points"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
description = "A SICP'ish Points implemented in Python using hexlet-pairs"
55
authors = ["Hexlet Team <info@hexlet.io>"]
66
license = "ISC"

src/hexlet/points/__init__.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
from hexlet import pairs
66

7-
__all__ = ( # noqa: WPS317
7+
__all__ = ( # noqa: WPS317
88
'make',
99
'get_x', 'get_y',
10-
'to_string', 'get_quadrant',
10+
'to_string',
1111
)
1212

1313

@@ -29,16 +29,3 @@ def get_y(point: pairs.Pair) -> int:
2929
def to_string(point: pairs.Pair) -> str:
3030
"""Return a string representation of the point."""
3131
return repr((get_x(point), get_y(point)))
32-
33-
34-
def get_quadrant(point: pairs.Pair) -> int:
35-
"""Return a quadrant number for the point."""
36-
return {
37-
(True, True): 1,
38-
(False, True): 2,
39-
(False, False): 3,
40-
(True, False): 4,
41-
}[(
42-
get_x(point) > 0,
43-
get_y(point) > 0,
44-
)]

test/test_points.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,3 @@ def test_to_string():
1818
assert points.to_string(p) == '(100, 200)', (
1919
'Should return a proper representation.'
2020
)
21-
22-
23-
def test_get_quadrant():
24-
"""Test to_string conversion."""
25-
p1 = points.make(1, 1)
26-
p2 = points.make(-1, 1)
27-
p3 = points.make(-1, -1)
28-
p4 = points.make(1, -1)
29-
assert points.get_quadrant(p1) == 1, 'Should detect a quadrant #1.'
30-
assert points.get_quadrant(p2) == 2, 'Should detect a quadrant #2.'
31-
assert points.get_quadrant(p3) == 3, 'Should detect a quadrant #3.'
32-
assert points.get_quadrant(p4) == 4, 'Should detect a quadrant #4.'

0 commit comments

Comments
 (0)