Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space filling #4

Merged
merged 13 commits into from
Aug 14, 2024
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A predictable, interpretable wordcloud library
Run `poetry install`

## Development
Run `poetry run black src` and `poetry run pylint src` for styling and linting.
Run `poetry run black wrdcld` and `poetry run pylint wrdcld` for styling and linting.

## Testing
Todo
Run `python -m unittest discover tests/`
561 changes: 0 additions & 561 deletions Untitled.ipynb

This file was deleted.

526 changes: 526 additions & 0 deletions space_filling_experiments.ipynb

Large diffs are not rendered by default.

Empty file added tests/__init__.py
Empty file.
24 changes: 24 additions & 0 deletions tests/test_rectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from wrdcld.rectangle import Rectangle
from unittest import TestCase


class TestRectangle(TestCase):
def test_basic_properties(self):
r = Rectangle(width=5, height=7, x=1, y=2)
self.assertEqual(r.xy, (1, 2))
self.assertEqual(r.wh, (5, 7))
self.assertEqual(r.right, 6)
self.assertEqual(r.bottom, 9)
self.assertEqual(r.xyrb, (1, 2, 6, 9))
self.assertEqual(r.area, 35)

def test_rotation(self):
r = Rectangle(width=10, height=3, x=20, y=30)
r_ccw = r.rotated_ccw

self.assertEqual(r_ccw.x, 20)
self.assertEqual(r_ccw.y, 23)
self.assertEqual(r_ccw.width, 3)
self.assertEqual(r_ccw.height, 10)

self.assertEqual(r.area, r_ccw.area)
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.