Skip to content

Conversation

@dragonprevost
Copy link
Contributor

Construction of testing class for heat matrix.

Copy link
Contributor

@avesk avesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! There are only a couple small things. The capacity/queue_size thing would be a bit annoying to switch around and isn't critical for functionality so I understand if you think we should just move ahead with the merge and address it in a subsequent PR

oldest_frame_decay = .5**self.queue_size

# Check queue is full
if self.capacity >= self.queue_size:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think capacity and queue_size should be swapped. I.e Capacity should be the maximum capacity of the queue, and queue size should be the current number of elements in the queue

self.heat_matrix = (self.heat_matrix / self._get_oldest_frame()) * new_frame

#Calculate overall decay being applied to a frame during its life time
oldest_frame_decay = .5**self.queue_size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line can go inside the if block since its only relevant under the full queue condition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either that or just make line 41 self.heat_matrix = self.heat_matrix * .5 - (self._get_oldest_frame()*(.5**self.queue_size))

class InvalidOriginError(Exception):
"""Raised when origin is outside of matrix"""
pass
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pick: probably should print some error message out here instead of a pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants