tabulate: fix sval -> return typo in _statistic().
[pygrader.git] / pygrader / tabulate.py
index d8a962d00615ac48ad4e28e6124993d25c285073..e070c7d018e9d37089eb098712f9da3a09074dfe 100644 (file)
@@ -53,7 +53,7 @@ if _numpy is None:
 else:
     _statistics_container = _numpy.array
 
-def _statistic(iterabale, statistic):
+def _statistic(iterable, statistic):
     """Calculate statistics on an list of numbers
     """
     global _numpy_import_error
@@ -62,18 +62,18 @@ def _statistic(iterabale, statistic):
         _LOG.warning('error importing numpy, falling back to workarounds')
         _LOG.warning(str(_numpy_import_error))
         _numpy_import_error = None
-    if stat == 'Mean':
+    if statistic == 'Mean':
         if _numpy is None:  # work around missing numpy
             return _mean(iterable)
         else:
             return gs.mean()
-    elif stat == 'Std. Dev.':
+    elif statistic == 'Std. Dev.':
         if _numpy is None:  # work around missing numpy
-            sval = _std(iterable)
+            return _std(iterable)
         else:
             return gs.std()
     else:
-        raise NotImplementedError(stat)
+        raise NotImplementedError(statistic)
 
 def tabulate(course, statistics=False, stream=None, use_color=None, **kwargs):
     """Return a table of student's grades to date