Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Dec 15, 2021
2 parents 5651a0a + e864f2a commit cc907b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/dashboard/sync/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def record_payout_activity(fulfillment):
created_by=kwargs['profile'])
bounty.handle_event(event)
activity = Activity.objects.create(**kwargs)
activity.populate_hackathon_activity_index()
activity.populate_activity_index()

except Exception as e:
logger.error(f"error in record_bounty_activity: {e} - {event_name} - {bounty}")
7 changes: 7 additions & 0 deletions app/grants/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import numpy as np
from grants.clr_data_src import fetch_contributions, fetch_grants, fetch_summed_contributions
from grants.models import GrantCLRCalculation


def populate_data_for_clr(grants, contributions, clr_round):
Expand Down Expand Up @@ -485,7 +486,11 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn
print(f"- starting grants iter at {round(time.time(),1)}")
# for full calc - calculate the clr for each grant given additional potential_donations
total_count = grants.count()

invalid_clr_calculations = GrantCLRCalculation.objects.filter(latest=True, grantclr=clr_round.pk)

for grant in grants:
invalid_clr_calculations.exclude(grant=grant.pk)
# five potential additional donations plus the base case of 0
potential_donations = [0, 1, 10, 100, 1000, 10000]

Expand Down Expand Up @@ -545,6 +550,8 @@ def predict_clr(save_to_db=False, from_date=None, clr_round=None, network='mainn

debug_output.append({'grant': grant.id, "title": grant.title, "clr_prediction_curve": (potential_donations, potential_clr), "grants_clr": grants_clr})

invalid_clr_calculations.update(latest=False, active=False)

print(f"\nTotal execution time: {(timezone.now() - clr_calc_start_time)}\n")

return debug_output

0 comments on commit cc907b0

Please sign in to comment.