Skip to content

Commit

Permalink
Merge branch 'stable' into BUGFIX-Tukey_circle_plot_on_Oneway_not_flush
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmorrow committed Mar 29, 2018
2 parents 1e43d2c + baca8c7 commit 9d216e4
Show file tree
Hide file tree
Showing 6 changed files with 559 additions and 84 deletions.
1 change: 1 addition & 0 deletions .cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"sci_analysis/test/test_graph_boxplots.py::MyTestCase": true,
"sci_analysis/test/test_graph_boxplots.py::TestWarnings": true,
"sci_analysis/test/test_graph_frequency.py": true,
"sci_analysis/test/test_graph_histo.py": true,
"sci_analysis/test/test_groupcorrelation.py::MyTestCase::test_pearson_correlation_different_alpha": true
}
74 changes: 72 additions & 2 deletions build/lib/sci_analysis/test/test_data_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
import numpy.ma as ma
import pandas as pd

from ..data import is_array, is_dict, is_dict_group, is_group, is_iterable, is_tuple, to_float, flatten, is_series, \
Vector, is_data, is_vector, is_numeric
from ..data import (is_array, is_dict, is_dict_group, is_group, is_iterable, is_tuple, to_float, flatten, is_series,
Vector, is_data, is_vector, is_numeric, is_number)


class MyTestCase(unittest.TestCase):
inputs = {
'num': 3,
'float': 1.34,
'string': "hello",
'num_string': '1.34',
'char': "h",
'none': None,
'list': [1, 2, 3, 4, 5],
Expand Down Expand Up @@ -44,6 +46,8 @@ class MyTestCase(unittest.TestCase):

ans_array = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -77,6 +81,8 @@ class MyTestCase(unittest.TestCase):

ans_dict = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -110,6 +116,8 @@ class MyTestCase(unittest.TestCase):

ans_iterable = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -143,6 +151,8 @@ class MyTestCase(unittest.TestCase):

ans_tuple = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -176,6 +186,8 @@ class MyTestCase(unittest.TestCase):

ans_data = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -209,6 +221,8 @@ class MyTestCase(unittest.TestCase):

ans_vector = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -242,6 +256,8 @@ class MyTestCase(unittest.TestCase):

ans_group = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -275,6 +291,8 @@ class MyTestCase(unittest.TestCase):

ans_dict_group = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -308,6 +326,8 @@ class MyTestCase(unittest.TestCase):

ans_series = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -341,6 +361,8 @@ class MyTestCase(unittest.TestCase):

ans_numeric = {
'num': 0,
'float': 0,
'num_string': 0,
'string': 0,
'char': 0,
'none': 0,
Expand Down Expand Up @@ -372,6 +394,41 @@ class MyTestCase(unittest.TestCase):
'dict_of_lists': 0
}

ans_number = {
'num': 1,
'float': 1,
'num_string': 1,
'string': 0,
'char': 0,
'none': 0,
'list': 0,
'num_list': 0,
'mixed_list': 0,
'zero_len_list': 0,
'multiple_dim_list': 0,
'tuple': 0,
'num_tuple': 0,
'mixed_tuple': 0,
'dict': 0,
'array': 0,
'float_array': 0,
'nan_array': 0,
'negative_array': 0,
'masked_array': 0,
'multi_dim_array': 0,
'scalar_array': 1,
'zero_len_array': 0,
'empty_array': 0,
'vector': 0,
'series': 0,
'dict_series': 0,
'large_array': 0,
'large_list': 0,
'group': 0,
'group_of_lists': 0,
'dict_of_lists': 0
}

# Test logic tests

def test_001_is_array(self):
Expand Down Expand Up @@ -536,6 +593,19 @@ def test_010_is_numeric(self):
eval_numeric[name] = 0
self.assertTrue(eval_numeric == self.ans_numeric, "FAIL: is_numeric test")

def test_011_is_number(self):
"""Test the is_number function"""
eval_numeric = {}
for name, test in self.inputs.items():
try:
assert is_number(test)
print("PASS: " + name)
eval_numeric[name] = 1
except AssertionError:
print("FAIL: " + name)
eval_numeric[name] = 0
self.assertTrue(eval_numeric == self.ans_number, "FAIL: is_number test")

def test_050_to_float_list(self):
"""Test the to_float int list conversion"""
input_float = range(5)
Expand Down

0 comments on commit 9d216e4

Please sign in to comment.