Skip to content
Snippets Groups Projects
Commit 361bc440 authored by Flug Schwein's avatar Flug Schwein
Browse files

Improve graphing when full VP is in the Account's history

parent e4708798
No related branches found
No related tags found
2 merge requests!5Taken current version of master branch in the https://github.com/holgern/beem,!4Original changes pushed to master at https://github.com/holgern/beem
...@@ -496,8 +496,12 @@ class AccountSnapshot(list): ...@@ -496,8 +496,12 @@ class AccountSnapshot(list):
if self.downvote_vp[-1] > STEEM_100_PERCENT: if self.downvote_vp[-1] > STEEM_100_PERCENT:
self.downvote_vp[-1] = STEEM_100_PERCENT self.downvote_vp[-1] = STEEM_100_PERCENT
recharge_time = self.account.get_manabar_recharge_timedelta({"current_mana_pct": self.downvote_vp[-2] / 100}) recharge_time = self.account.get_manabar_recharge_timedelta({"current_mana_pct": self.downvote_vp[-2] / 100})
# Add full downvote VP once fully charged
self.downvote_vp_timestamp.append(self.vp_timestamp[-1] + recharge_time) self.downvote_vp_timestamp.append(self.vp_timestamp[-1] + recharge_time)
self.downvote_vp.append(STEEM_100_PERCENT) self.downvote_vp.append(STEEM_100_PERCENT)
# Add full downvote VP just before new Vote
self.downvote_vp_timestamp.append(ts-timedelta(seconds=1))
self.downvote_vp.append(STEEM_100_PERCENT)
self.downvote_vp[-1] -= self.steem._calc_resulting_vote(STEEM_100_PERCENT, weight) * 4 self.downvote_vp[-1] -= self.steem._calc_resulting_vote(STEEM_100_PERCENT, weight) * 4
if self.downvote_vp[-1] < 0: if self.downvote_vp[-1] < 0:
...@@ -513,8 +517,12 @@ class AccountSnapshot(list): ...@@ -513,8 +517,12 @@ class AccountSnapshot(list):
self.vp[-1] = STEEM_100_PERCENT self.vp[-1] = STEEM_100_PERCENT
recharge_time = self.account.get_manabar_recharge_timedelta( recharge_time = self.account.get_manabar_recharge_timedelta(
{"current_mana_pct": self.vp[-2] / 100}) {"current_mana_pct": self.vp[-2] / 100})
# Add full VP once fully charged
self.vp_timestamp.append(self.vp_timestamp[-1] + recharge_time) self.vp_timestamp.append(self.vp_timestamp[-1] + recharge_time)
self.vp.append(STEEM_100_PERCENT) self.vp.append(STEEM_100_PERCENT)
# Add full VP just before new Vote
self.vp_timestamp.append(ts-timedelta(seconds=1))
self.vp.append(STEEM_100_PERCENT)
self.vp[-1] += self.downvote_vp[-1] / 4 self.vp[-1] += self.downvote_vp[-1] / 4
if self.vp[-1] < 0: if self.vp[-1] < 0:
self.vp[-1] = 0 self.vp[-1] = 0
...@@ -522,7 +530,6 @@ class AccountSnapshot(list): ...@@ -522,7 +530,6 @@ class AccountSnapshot(list):
self.vp_timestamp.append(ts) self.vp_timestamp.append(ts)
self.downvote_vp_timestamp.append(ts) self.downvote_vp_timestamp.append(ts)
else: else:
self.vp.append(self.vp[-1]) self.vp.append(self.vp[-1])
...@@ -533,8 +540,12 @@ class AccountSnapshot(list): ...@@ -533,8 +540,12 @@ class AccountSnapshot(list):
if self.vp[-1] > STEEM_100_PERCENT: if self.vp[-1] > STEEM_100_PERCENT:
self.vp[-1] = STEEM_100_PERCENT self.vp[-1] = STEEM_100_PERCENT
recharge_time = self.account.get_manabar_recharge_timedelta({"current_mana_pct": self.vp[-2] / 100}) recharge_time = self.account.get_manabar_recharge_timedelta({"current_mana_pct": self.vp[-2] / 100})
# Add full VP once fully charged
self.vp_timestamp.append(self.vp_timestamp[-1] + recharge_time) self.vp_timestamp.append(self.vp_timestamp[-1] + recharge_time)
self.vp.append(STEEM_100_PERCENT) self.vp.append(STEEM_100_PERCENT)
# Add full VP just before new Vote
self.vp_timestamp.append(ts - timedelta(seconds=1))
self.vp.append(STEEM_100_PERCENT)
self.vp[-1] -= self.steem._calc_resulting_vote(self.vp[-1], weight) self.vp[-1] -= self.steem._calc_resulting_vote(self.vp[-1], weight)
if self.vp[-1] < 0: if self.vp[-1] < 0:
self.vp[-1] = 0 self.vp[-1] = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment