now main should work properly
-sp has option to take cmd line input
Converting Indiv to str parsing. created TCP/UDP

This is a step in the conversion of IndivSpeedTest into two separate
classes (TCP and UDP) and having them parse the data from a string
rather than a file stream

IndivSpeedTest
- simplified class. Only has base variables, a simple init, and string
just returns the string that was passed in. Does NO PARSING

TCP
- Currently looks exactly like old IndivSpeedTest
- Currently has 1 new class variable, WindowSize

UDP
- Currently looks exactly like old IndivSpeedTest
- Currently has 2 new class variables, DatagramSize and TargetBandwidth

Pings, PingThread, STDs, STFile
- made imports of global_str_padding to be one line (use of ‘;’ )
- all class variables of “this_” variety are renamed to “my”. Not as
hard to type

STFile
- End of loadHeaderInfo() now calls parseIndivTests(), and passes in
the remaining file contents (fs.read())
- parseIndivTests takes the string, and splits it based on ‘\n\n’. It
then iterates through the “chunks”, and appends chunks that are a part
of a single test. These new “chunks” are put into sortedFileContents.
The elements in this array are then analyzed (to determine TCP or
UDP-ness), and the appropriate constructor is called.
more progress on converting Indiv

STDs
- running with options now requires the first arg be a -b or -p
(brandon or peter), and the following arguments determine the tests used

TCP
- beginning of init checks to see if there was an error in the test
- loadHeaderInfo loads the measurement format

STFile
- After splitting text into their individual tests, it now calls the
constructor, and puts the object into the proper array in STFile.
Starting conversion to parsing of tests as strings

all files
- removed sys import in all __name__=“__main__” checks. it wasn’t being
used
- all objects have a short_str_method variable (consistent naming)

IndivSpeedTest
- TestNumber is a common variable to all children classes

TCP
- loadHeaderInfo gets TestNumber and iPerfCommandLine from array of
strings. then determines iperf options
- createPingThreads now splits the array of strings into threads, then
into up and down directions, and then call the PingThread constructor.

UDP
- basic constructor (copies text into variable. __str__ returns this
string)

STDs
- loadRawData has more options

STFile
- now creates the TCP and UDP objects

Pings
- optimized parsing and setting of __str__ specific variables

PingThread
- final ping is now a Ping object stored in myfinalPing
- parsing of array of strings. Empty Pings are also inserted where they
are missing.
UDP basic info is parsed

utils
- getMedian now returns correct number for an even number of values

STDs
- added “help” or “-h” options that print out a helpful guide to using
main

STFile
- removed “Starting UDP” check during initial splitting of chunks.
splitting 1 second UDP tests is done later
- calc_TCP_StDev now check to see if test had an error in it

IndivST
- __init__ does some generic parsing, like getting basic info common to
both tests

TCP
- SUM thread is stored as a variable, not in self.PingThreads
- __init__ first calls the SpeedTest.__init__()
- sum_UpThreads() and sum_DownThreads() now use the new structure of
self.PingThreads and the PingThread objects to determine the summed
thread
- __str__ method has been reworked for new variables and
self.myPingThreads structure

UDP
- __init__ first calls the SpeedTest.__init__()
- createPingThreads is currently all commented out
- __str__ method has been reworked for new variables and
self.myPingThreads structure
Ground control calling Major Update

buglist
- updates of broad description of fixes

utils
- test for files being run as main is now a function call
- added an example at the bottom on list comprehension (one line list
manipulations)

All essential Data Structure files
- Changed top block (check for __name__==__main__) to the function call
(using function in utils)

STFile
- change of some function names

IndivST
- MeasurementFormat changed to MeasuringFmt (it’s shorter)

TCP_Test
- no longer keeping track of SUM threads (too many issues)
- before passing list of strings (the pings before parsing), the array
are sorted, and the first and last ping put in their proper places.
Unordered list of strings was causing problems

UDP_Test
- Works similar to TCP, only one thread is created. There are also some
variables to keep track of the “Server Report” info
- has no other function that init, createPingThreads, and str

PingThread
- nested IF is for the 1 second UDP tests. In those tests, final ping
and test ping are both from 0.0->1.0
- array_itize simplified
forgot to add filter in TCP_Test for [SUM] threads. They are now fully
ignored
All objects now using Strings should be working properly.

main
- added user interaction for running functions

STDS
- moved all csvExport calls from main into their respective functions
- slightly altered __str__ to output data in a more readable fashion

IndivTest
- now correctly catches errors in UDP tests

TCP_Test
- If error, now only prevents the parsing of PingThreads. Basic
information from iPerfCommand is still parsed
- getLongestThreadTime now takes a variable (which direction the user
wants the longest thread time of, i.e. Up or Down, or ALL)
- Added explanatory comments for some code blocks
- __str__ now gives more useful information when an error was found

UDP_Test
- If error, now only prevents the parsing of PingThreads. Basic
information from iPerfCommand is still parsed
- __str__ now returns more useful information
user input in main needed to be a little more modular
Adding comments and explanations where needed in all files.
Also, TCP_Test and UDP_Test __str__ methods are now a little more
efficient
fixing of appending to results CSV

The program flow is such that, in STFile, we first see if the file is
recorded in the master CSV.

If what was returned was an index, it creates an empty array. It then
gets all of the TCP threads in the correct order (which is test # 1, 2,
4, and then 5). If the test exists, it runs the test’s function. If the
test does not exist, the mini-array appended for that test is 4 values
of error.

In the TCP_Test, the function to get the stdev and median values checks
if there are errors in the test. If there are, a 4 element array of
“None” is returned. Otherwise, a 4 element array of the stdev and
median of the up and down streams are returned.

After the 4 element array is returned, we extend the end array with the
values, and move to the next test. The 16 value array at the end of
this is appended to the correct CSV array for that file.
adding some progress bars

Now, when reading files, creating the histogram, or appending to the
results_CSV, the terminal will output the current progress (either the
folder and “files read”/“total files”, or the device type, carrier, and
“objects read”/“objects total”)
Working on convertTo2D function

The function needs to be reworked to use the new structure (tests
separated by type TCP vs. UDP).
Currently, the array-itization of the TCP tests seem to be working fine.
The UDP tests need a little bit of work
Most of the changes were to improve how the tests were parsed, stored
in the STDS, and how values were appended to the CPUC_Results CSV.

IndivSpeedTest
- Checking for Errors now correctly accounts for possible error messages
- Sometimes no iPerfCommand was issued before the tests were quitted.
This is now accounted for

TCP_Test
- put thread splitting part of createPingThreads into try/except block.
If something in it broke, there must have been an error in what was
printed out by iPerf. The test is then ignored.
- array of 4 values returned by create_Array_For_Results now contains
values that are a little more descriptive

STDS
- created array of bad_info_Files (to hold file objects whose data is
not very correct
- appending StDev/Median to CSV now appends the objects bad_info_Files.
- At the end of the function, if there are still empty values in the
last 16 cells (where StDev and Median go), then it is filled with
“FileMissingError”.
- __str__ prints out the info of the objects in bad_info_Files is
recursivelyPrint is True

SpeedTestFile
- the function that search for the row index of the file in the
CPUC_Results CSV now tries with locationID, Date, and Time if index was
still None at the end of the first loop
Forgot a comment
Changed progress bar to be a bar

Now, instead of showing numbers for just one area, the progress bar
shows the progress through either the entire amount of files to be read
(loadRawData), or the number of objects yet to be processed (append
StDev and Median to Results CSV)
There are many much more comments now. And that’s all that this commit
really was
Changed output into CPUC_Results for errors
Merge branch 'Indiv_w/_String'