• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ladybug-tools / ladybug-geometry / 259 / 1
96%
master: 93%

Build:
Build:
LAST BUILD BRANCH: dependabot/pip/setuptools-57.0.0
DEFAULT BRANCH: master
Ran 18 Jan 2020 08:10PM UTC
Files 42
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Jan 2020 08:07PM UTC coverage: 96.346%. First build
259.1

push

travis-ci

Chris Mackey
feat(hash): Add __hash__ methods that agree with __eq__ to all objects

I realized that we were overwriting the __eq__ method on a number of objects without overwriting the __hash__ method, which I have come to realize is strongly discouraged in Python. So this commit fixes this by adding hash methods that agree with the __eq__ operator.  This should also allow us to create sets of these geometry objects if we so desire.

The only thing I didn't implement that _might_ be worthwhile to implement in the future is that I am not caching the hash value once it is calculated, which is something that we could do given that all of the geometry objects are immutable. This will allow for quicker hashing if we plan to hash the object multiple times but it also uses up a little more memory per object to store the hash. Right now, we really don't end up hashing the object multiple times in any of our typical workflows such that I think the trade-off isn't worth it. However, we should reconsider this if we find cases in the future where we are hashing the objects multiple times.

8306 of 8621 relevant lines covered (96.35%)

0.96 hits per line

Source Files on job 259.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 245
  • Travis Job 259.1
  • 41b295bd on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc