-
-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
results page by different keyword #1586
Conversation
app/retail/utils.py
Outdated
] | ||
for i in [6, 5, 4, 3, 2, 1]: | ||
try: | ||
history = history + [[f'{i} months ago', base_stats.filter(created_on__lt=(timezone.now() - timezone.timedelta(days=i*30))).first().val],] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (150 > 120 characters)
E231 missing whitespace after ','
from dashboard.models import Bounty | ||
base_bounties = Bounty.objects.current().filter(network='mainnet') | ||
base_bounties = Bounty.objects.current().filter(network='mainnet').filter(idx_status__in=['done', 'expired', 'cancelled']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (126 > 120 characters)
|
||
|
||
def get_bounty_median_turnaround_time(func='turnaround_time_started', keyword=None): | ||
from dashboard.models import Bounty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'dashboard.models.Bounty' imported but unused
app/retail/utils.py
Outdated
def build_stat_results(keyword=None): | ||
timeout = 60 * 60 * 24 | ||
key = f'build_stat_results_{keyword}' | ||
#results = cache.get(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
app/retail/utils.py
Outdated
timeout = 60 * 60 * 24 | ||
key = f'build_stat_results_{keyword}' | ||
#results = cache.get(key) | ||
#if results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
app/retail/utils.py
Outdated
).order_by('-pk') | ||
context['members_history'], context['slack_ticks'] = get_history(base_stats, "Members") | ||
|
||
pp.profile_time('Stats1') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
app/retail/utils.py
Outdated
#jdi history | ||
base_stats = Stat.objects.filter( | ||
key='joe_dominance_index_30_value', | ||
key='joe_dominance_index_30_value', #TODO - JDI by keywords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E261 at least two spaces before inline comment
E262 inline comment should start with '# '
for year in range(2018, 2025): | ||
months = range(1, 12) | ||
if year == 2018: | ||
months = range(6, 12) | ||
for month in months: | ||
then = timezone.datetime(year, month, 3).replace(tzinfo=pytz.UTC) | ||
if then < timezone.now(): | ||
row = get_bounty_history_row(then.strftime("%B %Y"), then) | ||
row = get_bounty_history_row(then.strftime("%B %Y"), then, keyword) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
app/retail/utils.py
Outdated
context['max_bounty_history'] = float(context['universe_total_usd']) * .7 | ||
context['bounty_abandonment_rate'] = f'{bounty_abandonment_rate}%' | ||
context['bounty_average_turnaround'] = str(round(get_bounty_median_turnaround_time('turnaround_time_submitted')/24, 1)) + " days" | ||
context['hourly_rate_distribution'] = '$15 - $120' | ||
context['bounty_average_turnaround'] = str(round(get_bounty_median_turnaround_time('turnaround_time_submitted', keyword)/24, 1)) + " days" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (142 > 120 characters)
app/retail/utils.py
Outdated
context['bounty_claimed_completion_rate'] = f'{completion_rate}%' | ||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started'), 1) | ||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started', keyword), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (122 > 120 characters)
Codecov Report
@@ Coverage Diff @@
## master #1586 +/- ##
==========================================
- Coverage 29.92% 29.63% -0.29%
==========================================
Files 130 131 +1
Lines 9658 9782 +124
Branches 1247 1269 +22
==========================================
+ Hits 2890 2899 +9
- Misses 6662 6777 +115
Partials 106 106
Continue to review full report at Codecov.
|
for i in [6, 5, 4, 3, 2, 1]: | ||
try: | ||
plural = 's' if i != 1 else '' | ||
history = history + [[f'{i} month{plural} ago', base_stats.filter(created_on__lt=(timezone.now() - timezone.timedelta(days=i*30))).first().val],] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (157 > 120 characters)
E231 missing whitespace after ','
] | ||
|
||
for stat in stats_to_create: | ||
#print(stat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
) | ||
|
||
for keyword in keywords: | ||
all_bounties = Bounty.objects.filter(current_bounty=True, network='mainnet', web3_created__gt=(timezone.now() - timezone.timedelta(days=days))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (155 > 120 characters)
continue | ||
|
||
val = int(100 * (joe_bounties.count()) / (all_bounties.count())) | ||
val_val = int(100 * sum([(b.value_in_usdt_now if b.value_in_usdt_now else 0) for b in joe_bounties]) / sum([(b.value_in_usdt_now if b.value_in_usdt_now else 0) for b in all_bounties])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (196 > 120 characters)
] | ||
|
||
for stat in stats_to_create: | ||
#print(stat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
val=val, | ||
) | ||
for stat in stats_to_create: | ||
#print(stat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from retail.utils import programming_languages | ||
from django.conf import settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F811 redefinition of unused 'settings' from line 18
import logging | ||
import warnings | ||
|
||
warnings.filterwarnings("ignore", category=DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
print(f"starting at {timezone.now()}") | ||
for path in paths: | ||
self.warm_path(path) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W391 blank line at end of file
app/retail/utils.py
Outdated
context['bounty_claimed_completion_rate'] = f'{completion_rate}%' | ||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started'), 1) | ||
|
||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started', keyword), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (122 > 120 characters)
this is ready for review |
|
||
from retail.utils import programming_languages | ||
|
||
warnings.filterwarnings("ignore", category=DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
app/retail/utils.py
Outdated
|
||
import pytz | ||
from marketing.models import Alumni, LeaderboardRank, Stat | ||
from requests_oauthlib import OAuth2Session | ||
|
||
programming_languages = ['css', 'solidity', 'python', 'javascript', 'ruby', 'html', 'design'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we should include more programming languages?`
app/assets/yge/youvegoteth/send.js
Outdated
@@ -55,7 +55,7 @@ var promptForAuth = function(event) { | |||
|
|||
token_contract(tokenAddress).allowance.call(from, to, function(error, result) { | |||
if (error || result.toNumber() == 0) { | |||
_alert("You have not yet enabled this token. To enable this token, go to the <a style='padding-left:5px;' href='/settings/tokens'> Token Settings page and enable it</a>. (this is only needed one time per token)"); | |||
_alert({'message':"You have not yet enabled this token. To enable this token, go to the <a style='padding-left:5px;' href='/settings/tokens'> Token Settings page and enable it</a>. (this is only needed one time per token)"},'warning'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before value for key 'message'. (key-spacing)
A space is required after ','. (comma-spacing)
pp.profile_time('alumni') | ||
context['count_open'] = base_bounties.filter(network='mainnet', idx_status__in=['open']).count() | ||
context['count_started'] = base_bounties.filter(network='mainnet', idx_status__in=['started', 'submitted']).count() | ||
context['count_done'] = base_bounties.filter(network='mainnet', idx_status__in=['done']).count() | ||
pp.profile_time('count_*') | ||
|
||
# Leaderboard | ||
context['top_orgs'] = LeaderboardRank.objects.filter(active=True, leaderboard='quarterly_orgs').order_by('rank').values_list('github_username', flat=True) | ||
context['top_orgs'] = base_leaderboard.filter(active=True, leaderboard='quarterly_orgs').order_by('rank').values_list('github_username', flat=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (151 > 120 characters)
pp.profile_time('completion_rate') | ||
bounty_abandonment_rate = round(100 - completion_rate, 1) | ||
context['universe_total_usd'] = sum(base_bounties.filter(network='mainnet').values_list('_val_usd_db', flat=True)) | ||
pp.profile_time('universe_total_usd') | ||
context['max_bounty_history'] = float(context['universe_total_usd']) * .7 | ||
context['bounty_abandonment_rate'] = f'{bounty_abandonment_rate}%' | ||
context['bounty_average_turnaround'] = str(round(get_bounty_median_turnaround_time('turnaround_time_submitted')/24, 1)) + " days" | ||
context['bounty_average_turnaround'] = str(round(get_bounty_median_turnaround_time('turnaround_time_submitted', keyword)/24, 1)) + " days" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (142 > 120 characters)
context['bounty_claimed_completion_rate'] = f'{completion_rate}%' | ||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started'), 1) | ||
context['bounty_median_pickup_time'] = round(get_bounty_median_turnaround_time('turnaround_time_started', keyword), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (122 > 120 characters)
Description
This PR builds on top of #1486 to start laying the groundwork for querying our results by different keywords (.e.g.
results/javascript
orresults/python
Still TODO
Profile
object )