diff --git a/analyze_batch.py b/analyze_batch.py index a286d33..201a5bc 100644 --- a/analyze_batch.py +++ b/analyze_batch.py @@ -1,14 +1,14 @@ -from datetime import datetime -from datetime import timedelta -import sys import os -from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer -import numpy as np -import matplotlib.pyplot as plt +import sys from collections import defaultdict -from loader import load, dmt, cms -import math +from datetime import timedelta + +import matplotlib.pyplot as plt +import numpy as np +from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer + from common import calc_intervals +from loader import load, dmt, cms printnoln = lambda text: print(text, end='', flush=True) rprint = lambda text: print('\r' + text) diff --git a/calctoxdiff.py b/calctoxdiff.py index eea7047..5a17628 100644 --- a/calctoxdiff.py +++ b/calctoxdiff.py @@ -1,13 +1,14 @@ import importlib -import sys import os -from os import listdir -from os.path import isfile, join -from scipy.stats import ks_2samp +import sys from collections import defaultdict from datetime import datetime +from os import listdir +from os.path import isfile, join + import matplotlib.pyplot as plt import numpy as np +from scipy.stats import ks_2samp colors = {'neg': 'red', 'neu': 'green', 'pos': 'blue', 'com': 'orange'} diff --git a/common.py b/common.py index ad05687..7853a3e 100644 --- a/common.py +++ b/common.py @@ -1,4 +1,4 @@ -from loader import load, dmt, cms +from loader import dmt def calc_intervals(posts): diff --git a/loader.py b/loader.py index 562ce6a..ae11207 100644 --- a/loader.py +++ b/loader.py @@ -1,17 +1,17 @@ -from xml.dom import minidom -from datetime import datetime -from collections import defaultdict -import time import multiprocessing import operator -from mt import mt +import time import xml.etree.cElementTree as et +from collections import defaultdict +from datetime import datetime + +from mt import mt printnoln = lambda text: print(text, end='', flush=True) rprint = lambda text: print('\r' + text) -def dmt(data): return mt(multiprocessing.cpu_count(), data, False) +def dmt(data): return mt(multiprocessing.cpu_count() * 2, data, False) def cms(): return int(round(time.time() * 1000)) diff --git a/sentiments.py b/sentiments.py index 1115de3..61159e8 100644 --- a/sentiments.py +++ b/sentiments.py @@ -1,10 +1,9 @@ import os import sys -from collections import defaultdict from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer -from loader import load, cms, dmt +from loader import load, dmt printnoln = lambda text: print(text, end='', flush=True) rprint = lambda text: print('\r' + text)