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

Branchsophie #10

Open
wants to merge 2 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
4 changes: 2 additions & 2 deletions 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
return component in NEURON_COMPONENTS
17 changes: 8 additions & 9 deletions tests/test_gitgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ 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)

assert test_cv == true_cv

@pytest.fixture(params=['soma', 'axon', 'synapse', 'dendrite',
pytest.mark.xfail('fibroblast')])
Expand All @@ -56,4 +55,4 @@ def test_is_neuron_component(neuron_component):

test_neuron_component = is_neuron_component(neuron_component)
true_neuron_component = neuron_component in NEURON_COMPONENTS
assert test_neuron_component == true_neuron_component
assert test_neuron_component == true_neuron_component