dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
384 stars 126 forks source link

Added Hash Functions to `TimeRange` and `CompoundTimeRange` #981

Closed gawebb-dstl closed 2 months ago

gawebb-dstl commented 2 months ago

Hash functions were added to TimeRange and CompoundTimeRange. The hash functions weren't inherrited from Interval/s (See reason below). Some type annotation was also added.

From Python docs: A class that overrides eq() and does not define hash() will have its hash() implicitly set to None.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 93.50%. Comparing base (8c8f9ee) to head (f5f95ec).

Files Patch % Lines
stonesoup/types/time.py 85.71% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #981 +/- ## ========================================== - Coverage 93.54% 93.50% -0.05% ========================================== Files 202 202 Lines 12930 12935 +5 Branches 2640 2640 ========================================== - Hits 12096 12095 -1 - Misses 590 594 +4 - Partials 244 246 +2 ``` | [Flag](https://app.codecov.io/gh/dstl/Stone-Soup/pull/981/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dstl/Stone-Soup/pull/981/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `66.05% <85.71%> (+<0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/dstl/Stone-Soup/pull/981/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `89.16% <85.71%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.