|
From: <wa...@us...> - 2009-09-03 21:30:22
|
Revision: 23788
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=23788&view=rev
Author: wattsk
Date: 2009-09-03 21:30:13 +0000 (Thu, 03 Sep 2009)
Log Message:
-----------
Adding documentation to diagnostics_analysis
Modified Paths:
--------------
pkg/trunk/stacks/diagnostics/diagnostics_analysis/mainpage.dox
pkg/trunk/stacks/diagnostics/diagnostics_analysis/scripts/export_csv.py
pkg/trunk/stacks/diagnostics/diagnostics_analysis/test/bag_csv_test.py
Modified: pkg/trunk/stacks/diagnostics/diagnostics_analysis/mainpage.dox
===================================================================
--- pkg/trunk/stacks/diagnostics/diagnostics_analysis/mainpage.dox 2009-09-03 21:26:38 UTC (rev 23787)
+++ pkg/trunk/stacks/diagnostics/diagnostics_analysis/mainpage.dox 2009-09-03 21:30:13 UTC (rev 23788)
@@ -25,10 +25,10 @@
If your CSV file is too big, it may not be readable by common spreadsheet editor, such as Open Office. To solve this problem, you can make a "sparse" CSV by removing every nth line from the file.
\verbatim
-$ ./sparse_csv.py output/my_bagfile_2009_07_24-topic_csv/status_name.csv [number_of_lines_to_skip]
+$ rosrun diagnostics_analysi sparse_csv.py output/my_bagfile_2009_07_24-topic_csv/status_name.csv -m
\endverbatim
-This makes the file output/my_bagfile_2009_07_24-topic_csv/status_name_sparse.csv, and only records every 10th line be default. To change the frequency of recording, change the number_of_lines_to_skip arguement.
+This makes the file output/my_bagfile_2009_07_24-topic_csv/status_name_sprs_len.csv, and makes sure it is no longer than 65000 lines.
*/
\ No newline at end of file
Modified: pkg/trunk/stacks/diagnostics/diagnostics_analysis/scripts/export_csv.py
===================================================================
--- pkg/trunk/stacks/diagnostics/diagnostics_analysis/scripts/export_csv.py 2009-09-03 21:26:38 UTC (rev 23787)
+++ pkg/trunk/stacks/diagnostics/diagnostics_analysis/scripts/export_csv.py 2009-09-03 21:30:13 UTC (rev 23788)
@@ -51,7 +51,7 @@
# Allow user to set output directory
parser = OptionParser()
parser.add_option("-d", "--directory", dest="directory",
- help="Write output to DIR. Default: %s" % PKG, metavar="DIR",
+ help="Write output to DIR/output. Default: %s" % PKG, metavar="DIR",
default=roslib.packages.get_pkg_dir(PKG), action="store")
options, args = parser.parse_args()
Modified: pkg/trunk/stacks/diagnostics/diagnostics_analysis/test/bag_csv_test.py
===================================================================
--- pkg/trunk/stacks/diagnostics/diagnostics_analysis/test/bag_csv_test.py 2009-09-03 21:26:38 UTC (rev 23787)
+++ pkg/trunk/stacks/diagnostics/diagnostics_analysis/test/bag_csv_test.py 2009-09-03 21:30:13 UTC (rev 23788)
@@ -53,6 +53,7 @@
row_count = 100
+##\brief Make DiagnosticArray message for testing
def make_status_msg(count):
array = DiagnosticArray()
stat = DiagnosticStatus()
@@ -87,10 +88,12 @@
self.skip_10 = make_sparse_skip(self.filename, 10)
self.length_10 = make_sparse_length(self.filename, 10)
+ ##\brief Tests that exported file exists and is not None
def test_file_exists(self):
self.assert_(self.filename is not None, "CSV file is None")
self.assert_(os.path.isfile(self.filename), "CSV file doesn't exist")
+ ##\brief Test that CSV file has correct data, number of lines
def test_export(self):
# Read CSV, count rows
input_reader = csv.reader(open(self.filename, 'rb'))
@@ -108,9 +111,11 @@
self.assert_(count == row_count, "Row count doesn't match")
+ ##\brief Tests that sparse CSV made with 'skip' option has correct number of lines
def test_sparse_skip(self):
self.assert_(len(open(self.skip_10).read().split('\n')) <= int(row_count / 10) + 2, "Length of sparse CSV (skipped) incorrect")
+ ##\brief Tests that sparse CSV made with 'length' option has correct number of lines
def test_sparse_length(self):
self.assert_(len(open(self.length_10).read().split('\n')) == 12, "Length of sparse CSV incorrect")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|