diff --git a/bug_features.py b/bugbug/bug_features.py similarity index 100% rename from bug_features.py rename to bugbug/bug_features.py diff --git a/bugbug.py b/bugbug/bug_rules.py similarity index 100% rename from bugbug.py rename to bugbug/bug_rules.py diff --git a/bugzilla.py b/bugbug/bugzilla.py similarity index 99% rename from bugzilla.py rename to bugbug/bugzilla.py index 1b06d208..59fd01ea 100644 --- a/bugzilla.py +++ b/bugbug/bugzilla.py @@ -9,7 +9,7 @@ import os import requests from libmozdata import bugzilla -import db +from bugbug import db BUGS_DB = 'data/bugs.json' diff --git a/db.py b/bugbug/db.py similarity index 100% rename from db.py rename to bugbug/db.py diff --git a/labels.py b/bugbug/labels.py similarity index 98% rename from labels.py rename to bugbug/labels.py index dc198d98..e67e0f6d 100644 --- a/labels.py +++ b/bugbug/labels.py @@ -5,7 +5,7 @@ import csv -import bugzilla +from bugbug import bugzilla def get_tracking_labels(): diff --git a/repository.py b/bugbug/repository.py similarity index 98% rename from repository.py rename to bugbug/repository.py index c506da81..84ef297e 100644 --- a/repository.py +++ b/bugbug/repository.py @@ -8,7 +8,7 @@ import re import hglib -import db +from bugbug import db COMMITS_DB = 'data/commits.json' diff --git a/utils.py b/bugbug/utils.py similarity index 100% rename from utils.py rename to bugbug/utils.py diff --git a/handwritten_rules_run.py b/handwritten_rules_run.py index 10ae6af5..8bf03abc 100644 --- a/handwritten_rules_run.py +++ b/handwritten_rules_run.py @@ -3,11 +3,11 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. -import bugbug -import bugzilla -from labels import get_labels +from bugbug import bug_rules +from bugbug import bugzilla +from bugbug import labels -classes = get_labels() +classes = labels.get_labels() true_positives = 0 true_negatives = 0 @@ -22,7 +22,7 @@ for bug in bugzilla.get_bugs(): is_bug = classes[bug_id] - is_bug_pred = bugbug.is_bug(bug) + is_bug_pred = bug_rules.is_bug(bug) if is_bug_pred and is_bug: true_positives += 1 diff --git a/run.py b/run.py index 88009ce9..b8a334c4 100644 --- a/run.py +++ b/run.py @@ -18,11 +18,11 @@ from sklearn.model_selection import train_test_split from sklearn.pipeline import FeatureUnion from sklearn.pipeline import Pipeline -import bug_features -import bugzilla -import repository -from labels import get_labels -from utils import ItemSelector +from bugbug import bug_features +from bugbug import bugzilla +from bugbug import repository +from bugbug.labels import get_labels +from bugbug.utils import ItemSelector nlp = spacy.load('en')