Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1908)

Unified Diff: appengine/findit/model/suspected_cl_confidence.py

Issue 2072893002: [Findit] scripts to calculate confidence level of Findit results. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/util_scripts/remote_queries/calculate_confidence_scores.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/suspected_cl_confidence.py
diff --git a/appengine/findit/model/suspected_cl_confidence.py b/appengine/findit/model/suspected_cl_confidence.py
index f12667ab0d2bff9a0671d048e6ece6e2f78530b5..06d5748e43d2e430760896a87e4ad5bca2adaea9 100644
--- a/appengine/findit/model/suspected_cl_confidence.py
+++ b/appengine/findit/model/suspected_cl_confidence.py
@@ -7,6 +7,7 @@ from google.appengine.ext import ndb
from common.time_util import GetUTCNow
from model.versioned_model import VersionedModel
+
class ConfidenceInformation(ndb.Model):
correct = ndb.IntegerProperty()
total = ndb.IntegerProperty()
@@ -42,8 +43,7 @@ class SuspectedCLConfidence(VersionedModel):
"""
# Start date of querying suspected CLs.
- # Note: the confidence scores will be for all the CLs up until end_date,
- # not just for CLs from start date to end_date.
+ # Note: the start date will be 6 months before end date.
start_date = ndb.DateTimeProperty(indexed=False)
# End date of querying suspected CLs.
@@ -75,7 +75,8 @@ class SuspectedCLConfidence(VersionedModel):
@classmethod
def Get(cls, version=None):
confidences = cls.GetVersion(version=version)
- return confidences or cls() if version is None else confidences
+ return (confidences or VersionedModel.Create() if version is None
+ else confidences)
def Update(
self, start_date, end_date,
« no previous file with comments | « no previous file | appengine/findit/util_scripts/remote_queries/calculate_confidence_scores.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698