There seems to be an inconsistency between the comment about the formula and the formula itself (regarding days_since_last_activity). From our IRC chat (below) and the related bug title, the comment should be:
> === modified file 'lib/lp/bugs/scripts/bugheat.py'
> --- lib/lp/bugs/scripts/bugheat.py 2010-04-22 12:14:18 +0000
> +++ lib/lp/bugs/scripts/bugheat.py 2010-04-22 12:14:19 +0000
> @@ -86,5 +86,19 @@
> self.bug.date_last_updated.replace(tzinfo=None)).days
> total_heat = int(total_heat * (0.99 ** days))
>
> - return total_heat
> + # Bug heat increases by a quarter of the maximum bug heat divided by
> + # the number of days between the bug's creating and its last activity.
# the number of days since the bugs last activity.
{{{
14:17 < noodles775> intellectronica: I can't see that days_since_last_activity is being used for anything?
14:18 < noodles775> Did you mean to do (max_heat * 0.25 / (days_since_created - days_since_last_activity)) or something similar, looking at the comment?
14:19 < noodles775> Ah, or looking at the related bug title, I'm guessing it should be s/dasy_since_created/days_since_last_activity on line 21 on the MP diff?
14:21 < intellectronica> noodles775: no, i think that's a cut-n-paste error.
14:27 < noodles775> intellectronica: so should it be divided by the number of days *since* the bugs last activity (as stated in the bug title), or divided by the difference between the days since the bug was created and it's last activity (as the comment seems to suggest?)
14:28 < intellectronica> noodles775: it should be divided by the days since the bug's creation
14:28 < noodles775> intellectronica: so the bug 567439 title is wrong then, ok.
14:28 < mup> Bug #567439: Add MAX_HEAT / 4 / days since last activity to bug heat <story-bug-heat> <Launchpad Bugs:In Progress by intellectronica> <https://launchpad.net/bugs/567439>
14:29 < intellectronica> noodles775: oh, right, it is. there's another bug for a calculation based on time since last activity, i must have confused them.
}}}
There seems to be an inconsistency between the comment about the formula and the formula itself (regarding days_since_ last_activity) . From our IRC chat (below) and the related bug title, the comment should be:
> === modified file 'lib/lp/ bugs/scripts/ bugheat. py' bugs/scripts/ bugheat. py 2010-04-22 12:14:18 +0000 bugs/scripts/ bugheat. py 2010-04-22 12:14:19 +0000 date_last_ updated. replace( tzinfo= None)). days
> --- lib/lp/
> +++ lib/lp/
> @@ -86,5 +86,19 @@
> self.bug.
> total_heat = int(total_heat * (0.99 ** days))
>
> - return total_heat
> + # Bug heat increases by a quarter of the maximum bug heat divided by
> + # the number of days between the bug's creating and its last activity.
# the number of days since the bugs last activity.
> + days_since_ last_activity = ( bug.date_ last_updated. replace( tzinfo= None), date_last_ message. replace( tzinfo= None))) .days datecreated. replace( tzinfo= None)). days max_bug_ heat for task in self.bug.bugtasks)
> + datetime.utcnow() -
> + max(self.
> + self.bug.
> + days_since_created = (
> + datetime.utcnow() - self.bug.
> + if days_since_created > 0:
> + max_heat = max(
> + task.target.
> + if max_heat is not None:
> + total_heat = total_heat + (max_heat * 0.25 / days_since_created)
s/days_ since_created/ days_since_ last_activity
> +
> + return int(total_heat)
Similarly in the test:
> + expected = int((fresh_heat * (0.99 ** 10)) + (100 * 0.25 / 20))
s/20/10
{{{ last_activity is being used for anything? last_activity) ) or something similar, looking at the comment? since_created/ days_since_ last_activity on line 21 on the MP diff? /launchpad. net/bugs/ 567439>
14:17 < noodles775> intellectronica: I can't see that days_since_
14:18 < noodles775> Did you mean to do (max_heat * 0.25 / (days_since_created - days_since_
14:19 < noodles775> Ah, or looking at the related bug title, I'm guessing it should be s/dasy_
14:21 < intellectronica> noodles775: no, i think that's a cut-n-paste error.
14:27 < noodles775> intellectronica: so should it be divided by the number of days *since* the bugs last activity (as stated in the bug title), or divided by the difference between the days since the bug was created and it's last activity (as the comment seems to suggest?)
14:28 < intellectronica> noodles775: it should be divided by the days since the bug's creation
14:28 < noodles775> intellectronica: so the bug 567439 title is wrong then, ok.
14:28 < mup> Bug #567439: Add MAX_HEAT / 4 / days since last activity to bug heat <story-bug-heat> <Launchpad Bugs:In Progress by intellectronica> <https:/
14:29 < intellectronica> noodles775: oh, right, it is. there's another bug for a calculation based on time since last activity, i must have confused them.
}}}