Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corey's first pull request (no thanks to alex) #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitgoing/gitgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def cv(x):
cv : float
The coefficient of variation of the entire array
"""
return mean_plus_one(x)/std_plus_one(x)
return std_plus_one(x)/mean_plus_one(x)

def is_neuron_component(component):
return component in NEURON_COMPONENTS
16 changes: 8 additions & 8 deletions tests/test_gitgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def test_std_plus_one(x_norm):
true_std = np.std(x_norm) + 1
assert test_std == true_std

# def test_cv_broken(x_norm):
# from gitgoing.gitgoing import std_plus_one, mean_plus_one, cv
#
# test_cv = cv(x_norm)
# true_cv = std_plus_one(x_norm)/mean_plus_one(x_norm)
#
# # This test will fail
# assert test_cv == true_cv
def test_cv_broken(x_norm):
from gitgoing.gitgoing import std_plus_one, mean_plus_one, cv

test_cv = cv(x_norm)
true_cv = std_plus_one(x_norm)/mean_plus_one(x_norm)

# This test will fail
assert test_cv == true_cv

@pytest.fixture(params=['soma', 'axon', 'synapse', 'dendrite',
pytest.mark.xfail('fibroblast')])
Expand Down