SLVE 1.3 - Bug Fixes, Performance Updates, Code Cleanup, New Pie Chart

in #utopian-io5 years ago (edited)

Steem Late Vote Explorer Logo



Steem Late Vote Explorer (SLVE) is a tool I designed to visually represent and track last-minute votes in the interests of education and abuse detection. It is built with customizability in mind and can currently stream the blockchain to show a live feed of last-minute votes, as well as saving that data for visual representation at any time. For more information, please read the introductory post.



Github Repository



Bug Fixes


Increased default maximum time allowed to vote before cashout

The new HF20 update saw a new feature come into place whereby vote effectiveness decreases from 100% to 0% in the last 12 hours:

Previously, in the last 12 hours before the payout of a post, no votes were being counted. This has been changed now in a way that the effectiveness of a vote in these last 12 hours goes from 100% to 0%. Which means: if you vote 30 minutes before the payout, your vote uses the same amount of voting power but would have pretty much no impact on the rewards.
Src

When I read this, i saw fit to increase the default maximum time before cashout because once that 12 hour countdown begins, all flags will become less and less useful:

Up from 24 to 36


Fixed a bug caused by missing data in the steem sincerity library

I recently came across a bug whereby steem sincerity was showing some users attributes as all null, a new development (I think from new accounts and lack of continuation from sincerity devs).
https://steem-sincerity.dapptools.info/s/api/accounts-info/egor.isakov

{
    "data": {
        "egor.isakov": {
            "classification_bot_score": null,
            "classification_human_score": null,
            "classification_spammer_score": null,
            "comment_average_image_count": null,
            "comment_average_word_count": null,
            "comment_count": null,
            "comment_random_sample": null,
            "incoming_votes_diversity": null,
            "incoming_votes_down_count": null,
            "incoming_votes_self_percent": null,
            "incoming_votes_up_count": null,
            "outgoing_votes_diversity": null,
            "outgoing_votes_self_percent": null,
            "post_average_word_count": null,
            "post_count": null
        }
    },
    "error": "",
    "messages": [],
    "status": "ok"
}

This was causing errors when the program was trying to perform the > operation on a NoneType and a float, so I fixed the problem with a simple try/except which has the benefit of dealing with any other errors that might occur.


Tidied up code

Before the recent update, my code was still very messy and the comments were all over the place and not following any particular set of rules.

Before...
After...

On top of that, I broke down the whole old system of streaming which was just a lot of functions with a streaming loop at the end which would start whenever the library was imported, essentially making it into a large script. I moved the streamer into a main class (AbuseDetection) along with all the other functions and info_digger was also way too large so I broke it down into lots of smaller, hidden functions to help improve readability:

  • _check
  • _age_check
  • _vest_check
  • _usd_check

The full commit can be seen here:
https://github.com/sisygoboom/abuse_detection_steemit/commit/4a1c66f48c7afe21ef0b97b7d6a13f3375081ba3#diff-1aebab2304d7a62c1579560d0cfe4a4e



New Features


Linked the two classes

import make_pie
make_pie instance generation
Importing the make_pie library into my main blockchain info/digging library means users do not have to manually find the database directories and copy/paste them when trying to make a new instance, instead the data can be passed straight from one class to another when making a new instance.
linking classes


Add threading to streamer

Once I linked the two libraries, it made sense to have the streamer running in the background. This way, users can create pie charts in real time, without having to go through the struggle of opening new windows or stopping the streamer.

threader and streamer

threading stream + piecharts


New pie chart

The make_pie module had three available pie charts before the update:

  • make_pie_incoming_value
  • make_pie_outgoing_value
  • make_pie_outgoing_quantity

To accommodate for the new feature, I needed to change these things:

  1. Add a new data point to the _update_db, this essentially counts all the incoming votes

  2. Adapt the get_incoming_value function into a get_incoming function that works in a similar way to the get_outgoing function. Yellow highlights mark additions and changes.

  3. Finally, I made the procedure below to tie it all together, then deleted my DBs and ran the streamer to collect a DB with all the data fields filled in.
Result



Roadmap

  • GUI
    • Some sort of file explorer/directory style viewer to view information
    • Build pie charts into GUI
  • Make text output optional at the instance declaration level


GitHub Account

https://github.com/sisygoboom

Sort:  

Thank you for your contribution. A nice update to the project, the names, and numbers in the piechart are overlapping. The code looks neat after tidying up and its great to see good comments in the code.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

The overlapping names can be fixed by entering a custom 'accuracy' parameter when creating a new instance but it is something I'll now be looking to automate.

Thanks for the feedback!

Thank you for your review, @codingdefined! Keep up the good work!

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

Hi @sisygoboom!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hi, @sisygoboom!

You just got a 0.33% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @sisygoboom!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.032
BTC 61041.41
ETH 2947.17
USDT 1.00
SBD 3.85