From 3fa6af8594f8109f388f30d99517bdd432b9ff7c Mon Sep 17 00:00:00 2001 From: ltcptgeneral Date: Fri, 13 Sep 2019 13:59:13 -0500 Subject: [PATCH] analysis.py v 1.1.0.002 --- .../__pycache__/analysis.cpython-37.pyc | Bin 6328 -> 6164 bytes data analysis/analysis/analysis.py | 41 ++++++------------ 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/data analysis/analysis/__pycache__/analysis.cpython-37.pyc b/data analysis/analysis/__pycache__/analysis.cpython-37.pyc index 9ad5ef203802b116d4666be3993f4860b7a03487..0c111de60490081d84bac42b7ba169d8956f6a3c 100644 GIT binary patch delta 1350 zcmZ`&&1=*^6i=E>noYZ3+3j}gM?0;EjnHLRL9l)xRq>{XMRY(*x-)IFO)|?QyV`o_ z!5+K_mU#8xQ4mA~^&o;L5B>%2!HXbXJ$ckO*=?wcO_(>y@BM!7y}WsOUw>N5E@U!> z1lOk@5AJ-K*vVF8W9Qh>Eu120Vz??+VIOf-Ps5rl#n>>`VIOtVo`DTnx+0Mb$!<#| zOGh3mc$DObvMu2Z)kvNc9?Qfescq?@jI#++Bx;Q05~M`57|HjMEt!mw;TS3;q%zTC z#7vNJQi+jbf=rMDF;Ys9gXB<*j3vlnG8rRfV%(6dsm*k~TCdiswb}{$QAUy)Yqr0& zN?o=(ZzP_11Hm~-xD#$5wu0I|r3Ac=*J3;j`kEES8vwH9 zCT)bsV}zpFWgDc-N4D#trV}QK>b*o4=TJWZTH(w?!MaOr?)L+u<0xc62$N_UtYMAN zj?1yLbS&3embdaNf=S4JITsSGjRtl>v=J+9>5{hXsSPdGC z)4?)Q;CdT9E8e}(i!JDBK~E=bv=m+eq?>}T2zXI21`1RG`w*Qez04;;x{6DEJ{kQk zEe@8d0sC{bG`3KW*`h*A=12Y$SGc~yicdjO_*7IY&-GLY;C)oW^$pgp3MDEGr$hEp zi5`95qnZ|~Q=-DI(y{qIsu}SA+@lij)_C-*TtCeZz%y3;wzq6^efPPw!9`4%jou#- zH@j=xwB0tn%sGSMiHyojGd?#2%=qxQh`XojasR~_b@j9GKekrE$GhwO&t^CO&Lv0UTrS!b5=Dd%iVmpY1O$qaAo6-9yFSMD>e(BS zP;7B2X-=j@KtsnB=!8UvM1^Q6kStmn8XEfJ&Fm(MR*FY{?|biiZ)P;}*k?p2P< z<)VU*{mU1hbXT5LI_l@ocJEIDo#=r<3{{~8TH*_2L3)#z=q+9diljK>N~DCjGPi;< zDa%}iSAr_3&iERs$=*7tOWz<3^i|#nnxr|aStN^+Ymp`CCvDP}phG&+FOy~THNFz8 zl2zGM=gYwwS(CWI*MkkRA#szhpG-HsNj7D#P3(6Rx=34B3T?5iry99Om#B87kZsna zZJNJQo~mRAafj*>-=AQxObr>lf_Q~4NW6=9m6{UoAzq{F5<7@D=%&Q`h;6zh@dL#7 z=(fZMwDh6k>|7RlhrPq@VYl0Lzq1s@8@l0u@n~>VydjQWv~$nZ)sx4M9v|7!DDeaT zlG&H1VFZE85g)uLX9VCh6$EWVO>vOlyS*FDafarE| zWFclrf~#ek3j>(WjtsPgQPF&xUe-6#@9RG<&XHo(=joFMH*8V6mHyRW^EDbWKcycv zk6#tdPM+wa$PW|P6CL|#h#q?pu=$1aNd21r-u(1UTU2fdQ$s@vH+SM_GM(jd-!ZI- zin$HynENdqF8)xn1uG`WG|ocUO?O%+^IJ8L{v-Xeb=;HHVuy|j2k7SK71ZDO%5zsV z*h^ow9!|TQySoJS&#f-!rifq+8xsT2M}bg;Ke`|l z=?IRRC0}8$qbU-M7-kOR UTun18mT8sCmSL5whNX+~KX-jvga7~l diff --git a/data analysis/analysis/analysis.py b/data analysis/analysis/analysis.py index e17b0665..8b3589c4 100644 --- a/data analysis/analysis/analysis.py +++ b/data analysis/analysis/analysis.py @@ -7,10 +7,14 @@ # number of easter eggs: 2 # setup: -__version__ = "1.1.0.001" +__version__ = "1.1.0.002" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: +1.1.0.002: + - snapped (removed) majority of uneeded imports + - forced object mode (bad) on all jit + - TODO: stop numba complaining about not being able to compile in nopython mode 1.1.0.001: - removed from sklearn import * to resolve uneeded wildcard imports 1.1.0.000: @@ -132,28 +136,11 @@ __all__ = [ # imports (now in alphabetical order! v 1.0.3.006): -from bisect import bisect_left, bisect_right -import collections import csv -from decimal import Decimal -import functools -from fractions import Fraction -from itertools import groupby -import math -import matplotlib import numba from numba import jit -import numbers import numpy as np -import pandas -import random -import scipy -from scipy.optimize import curve_fit -from scipy import stats from sklearn import preprocessing -# import statistics <-- statistics.py functions have been integrated into analysis.py as of v 1.0.3.002 -import time -import torch class error(ValueError): pass @@ -172,7 +159,7 @@ def _init_device(setting, arg): # initiates computation device for ANNs else: raise error("specified device does not exist") -@jit +@jit(forceobj=True) def load_csv(filepath): with open(filepath, newline='') as csvfile: file_array = np.array(list(csv.reader(csvfile))) @@ -180,7 +167,7 @@ def load_csv(filepath): return file_array # data=array, mode = ['1d':1d_basic_stats, 'column':c_basic_stats, 'row':r_basic_stats], arg for mode 1 or mode 2 for column or row -@jit +@jit(forceobj=True) def basic_stats(data): data_t = np.array(data).astype(float) @@ -193,13 +180,13 @@ def basic_stats(data): return _mean, _median, _stdev, _variance # returns z score with inputs of point, mean and standard deviation of spread -@jit +@jit(forceobj=True) def z_score(point, mean, stdev): score = (point - mean) / stdev return score # expects 2d array, normalizes across all axes -@jit +@jit(forceobj=True) def z_normalize(array, *args): array = np.array(array) @@ -210,7 +197,7 @@ def z_normalize(array, *args): return array -@jit +@jit(forceobj=True) # expects 2d array of [x,y] def histo_analysis(hist_data): @@ -228,22 +215,22 @@ def histo_analysis(hist_data): return mean_derivative, stdev_derivative -@jit +@jit(forceobj=True) def mean(data): return np.mean(data) -@jit +@jit(forceobj=True) def median(data): return np.median(data) -@jit +@jit(forceobj=True) def stdev(data): return np.std(data) -@jit +@jit(forceobj=True) def variance(data): return np.var(data) \ No newline at end of file