Fix for our 2 big functions

STFile
- import of date was incorrect
- comparisons to master CSV row info needed str casting
Fixed the STDEV and MEDIAN being the same

Just a wee too much copy-pasta
StDev now separates based on server and dir

STDs
- Initial setup now creates a nested dictionary (server, then direction)

STFile
- After calculating StDev, add to correct device type, carrier, server,
AND direction
moving some of the printout into the STDs

This way, the main can be a little more simple, and not require as much
work from the user
now main should work properly
main and prints should now work
-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
Fixed the correct computation of the median

Made it so it returns the mathematically correct median calculation when
presented with an even-lengthed array of numbers
needs to be minus 1

When you have an array of even length (e.g. 6), and you divide by 2,
you get 3. The element at index 3 is actually the 4th element. To get
the correct median, we need to average this value with the 3rd element,
i.e. element at index 2. So, we need to use -1, not +1.
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”)