From 99fee36f207a70b4bb54284ea2425932b057b18e Mon Sep 17 00:00:00 2001 From: ltcptgeneral <35508619+ltcptgeneral@users.noreply.github.com> Date: Mon, 19 Nov 2018 17:12:27 -0600 Subject: [PATCH] analysis.py - v 1.0.3.007 changelog v 1.0.3.007: - added builtin benchmark function - added builtin random (linear) data generation function --- .gitignore | 2 ++ __pycache__/analysis.cpython-37.pyc | Bin 18017 -> 18596 bytes analysis.py | 31 +++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..59e9f428 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +benchmark_data.csv diff --git a/__pycache__/analysis.cpython-37.pyc b/__pycache__/analysis.cpython-37.pyc index f1dd7180548b5775ba03796fc362908bfa36efd6..826be6363f84a6888d3d512748fd37dfa245635d 100644 GIT binary patch delta 2652 zcmZuyd2Ae48J};Co!Pa$w%6>uJ^q+-#hjX=isa7!P}dYmE2HPyIgY9L`A`eH8A z<*;t*#04=U?l#?vK9A`kn?IHn&o;9iTVX6G?lrxO{#-NH>6>TfIh=3iJM1$H9QK=j zhYQU@;#IL#`z4$ag9gli;|Q8T44^zKnX7k67(``OLglP%7Lm3ZRnk<_ib*R%jWmt4 z64Hv%MVgDWQY=B8`j=rT8pP#ThHm0DSdJdz3S5H~#FbcyS;T8+a4lw&unyN@4sjJ$ zp_h0)uE$*BYOKZ@;u;KLEpdp3+kka6TwSF0tYU7!0o;i7vtZWYCTyUHjo64y#P!&W zEySB}Gqw^pU>mj*H)02N5;tKNcF*pY%x2t!TX7quXu<8+L$1x(i#v#0u@C!++i(zf z;x3A4$G!LfK1fmrK8(BZA(A@L_X#Pq?@@PSeM5b7eM3Vl&zIll8nxApsg_C^Da{(UX^PY>)Z(Yp#0N@<|V$QeWOVsB!T(By02LR@*WL`GF6`sjI z4?o~u-{UZAJ?VQD;3s^@e+hoZ|K-09zqYOw)&bn&_g4J}?(@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)O I?eo2V1MVdb, " @@ -48,6 +48,7 @@ import math import matplotlib import numbers import numpy as np +import random import scipy from sklearn import * #import statistics <-- statistics.py functions have been integrated into analysis.py as of v 1.0.3.002 @@ -584,6 +585,34 @@ def basic_analysis(filepath): #assumes that rows are the independent variable an return[row_b_stats, column_b_stats, row_histo] +def benchmark(x, y): + + start_g = time.time() + generate_data("benchmark_data.csv", x, y, -10, 10) + end_g = time.time() + + start_a = time.time() + basic_analysis("benchmark_data.csv") + end_a = time.time() + + return [(end_g - start_g), (end_a - start_a)] + +def generate_data(filename, x, y, low, high): + + file = open(filename, "w") + + for i in range (0, y, 1): + + temp = "" + + for j in range (0, x - 1, 1): + + temp = str(random.uniform(low, high)) + "," + temp + + temp = temp + str(random.uniform(low, high)) + file.write(temp + "\n") + + #statistics def below------------------------------------------------------------------------------------------------------------------------------------------------------ class StatisticsError(ValueError):