Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
vicpaton committed Sep 5, 2024
1 parent 6e28c65 commit a584d66
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion networkcommons/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def targetlayer_formatter(df, n_elements=25, act_col='stat'):
df = df[act_col].head(n_elements)

df = df.apply(lambda x: 1 if x > 0 else -1 if x < 0 else 0)
print(df)

# Pivot wider
dict_df = df.to_dict()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_decoupler_formatter_string():

def test_targetlayer_formatter():
df = pd.DataFrame({'TF': ['A', 'B', 'C', 'D'], 'sign': [1.5, -2, 0, 3]}).set_index('TF')
result = utils.targetlayer_formatter(df, n_elements=2)
result = utils.targetlayer_formatter(df, n_elements=2, act_col='sign')
expected = {'D': 1, 'B': -1}
assert result == expected

Expand Down

0 comments on commit a584d66

Please sign in to comment.