From 28062121a1d1e50742550bb8ce69e83ce5d7ba37 Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 11:21:21 -0400 Subject: [PATCH 1/6] fix double parentheses --- quail/analysis/recmat.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quail/analysis/recmat.py b/quail/analysis/recmat.py index d5a0fe8..bb3cf77 100644 --- a/quail/analysis/recmat.py +++ b/quail/analysis/recmat.py @@ -51,7 +51,7 @@ def recall_matrix(egg, match='exact', distance='euclidean', features=None): return _recmat_smooth(egg.pres, egg.rec, features, distance, match) def _recmat_exact(presented, recalled, features): - lists = presented.index.to_numpy()() + lists = presented.index.to_numpy() cols = max(presented.shape[1], recalled.shape[1]) result = np.empty((presented.shape[0], cols))*np.nan for li, l in enumerate(lists): @@ -59,8 +59,8 @@ def _recmat_exact(presented, recalled, features): r_list = recalled.loc[l] for i, feature in enumerate(features): get_feature = lambda x: np.array(x[feature]) if not np.array(pd.isnull(x['item'])).any() else np.nan - p = np.vstack(p_list.apply(get_feature).to_numpy()()) - r = r_list.dropna().apply(get_feature).to_numpy()() + p = np.vstack(p_list.apply(get_feature).to_numpy()) + r = r_list.dropna().apply(get_feature).to_numpy() r = np.vstack(list(filter(lambda x: x is not np.nan, r))) try: m = [np.where((p==x).all(axis=1))[0] for x in r] @@ -90,15 +90,15 @@ def _recmat_smooth(presented, recalled, features, distance, match): return recmat def _similarity_smooth(presented, recalled, features, distance): - lists = presented.index.to_numpy()() + lists = presented.index.to_numpy() res = np.empty((len(lists), len(features), recalled.iloc[0].shape[0], presented.iloc[0].shape[0]))*np.nan for li, l in enumerate(lists): p_list = presented.loc[l] r_list = recalled.loc[l] for i, feature in enumerate(features): get_feature = lambda x: np.array(x[feature]) if np.array(pd.notna(x['item'])).any() else np.nan - p = np.vstack(p_list.apply(get_feature).to_numpy()()) - r = r_list.dropna().apply(get_feature).to_numpy()() + p = np.vstack(p_list.apply(get_feature).to_numpy()) + r = r_list.dropna().apply(get_feature).to_numpy() r = np.vstack(list(filter(lambda x: x is not np.nan, r))) tmp = 1 - cdist(r, p, distance) res[li, i, :tmp.shape[0], :] = tmp From caab6c1643befb0142b963b851f7685f896bd05f Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 11:57:35 -0400 Subject: [PATCH 2/6] bumped pandas requirement to min version with .to_numpy() --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ecfe191..3516a25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ numpy>=1.10.4 scipy>=0.17.1 matplotlib>=1.5.1 seaborn>=0.9.0 -pandas>=0.18.1 +pandas>=0.24.0 future six deepdish From fdefd10f79d435f31020d3747c83a24ddaae4cf9 Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 12:00:32 -0400 Subject: [PATCH 3/6] remove tests for python 3.5, add 3.7 & 3.8 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 22e9f83..cfebb25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ services: - xvfb python: - '2.7' -- '3.5' - '3.6' +- '3.7' +- '3.8' before_script: - export DISPLAY=:99.0 - sleep 3 From e811a7943089e20074e813aa07ed7289d0725560 Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 12:09:06 -0400 Subject: [PATCH 4/6] drop support for python 2.7, add 3.9 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cfebb25..e67c21d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ sudo: false services: - xvfb python: -- '2.7' - '3.6' - '3.7' - '3.8' +- '3.9' before_script: - export DISPLAY=:99.0 - sleep 3 From 90bdd37c218e01f7656de0a9f5c1855138782140 Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 12:57:38 -0400 Subject: [PATCH 5/6] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6d7fd9b..c5d356e 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( name='quail', - version='0.2.0', + version='0.2.1', description=DESCRIPTION, long_description=LONG_DESCRIPTION, author='Contextual Dynamics Lab', From 4d6041b497adea63b17f31270c0663038a7f50cf Mon Sep 17 00:00:00 2001 From: paxtonfitzpatrick Date: Thu, 3 Jun 2021 13:00:45 -0400 Subject: [PATCH 6/6] update python version requirement in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6918d9..0e6ff8b 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ This will work on clean systems, but if you encounter issues you may need to run

Requirements

-+ python 2.7, 3.4+ ++ python>=3.6 + pandas>=0.18.0 + seaborn>=0.7.1 + matplotlib>=1.5.1