From 2633156ed793f5aab475903ce0cf8acb45ef8daa Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Thu, 25 Jul 2024 20:09:12 +0000 Subject: [PATCH 1/2] correct return value in tutorial --- docs/Basic Usage.ipynb | 43 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/docs/Basic Usage.ipynb b/docs/Basic Usage.ipynb index 6b9dd9c..08a5101 100644 --- a/docs/Basic Usage.ipynb +++ b/docs/Basic Usage.ipynb @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "collapsed": false, "pycharm": { @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 7, "metadata": { "collapsed": false }, @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 8, "metadata": { "collapsed": false }, @@ -88,7 +88,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 9, "metadata": { "collapsed": false }, @@ -108,7 +108,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 10, "metadata": { "collapsed": false }, @@ -117,8 +117,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "[[10]\n", - " [ 9]]\n" + " 0\n", + "9 10\n", + "8 9\n" ] } ], @@ -145,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 11, "metadata": { "collapsed": false }, @@ -166,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 12, "metadata": { "collapsed": false }, @@ -175,7 +176,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "[[10 11 12]]\n" + " 0 1 2\n", + "3 10 11 12\n" ] } ], @@ -195,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "metadata": { "collapsed": false }, @@ -204,16 +206,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "[[10 11 12]\n", - " [ 7 8 9]]\n", - "[1.35401943 0.43928867]\n" + " 0 1 2 score\n", + "3 10 11 12 1.354019\n", + "2 7 8 9 0.439289\n" ] } ], "source": [ - "X_sampled, scores = novelty_score_sample(conditions = X_prime, reference_conditions = X, num_samples = 2, metric = \"euclidean\", integration = \"sum\")\n", - "print(X_sampled)\n", - "print(scores)" + "X_sampled = novelty_score_sample(conditions = X_prime, reference_conditions = X, num_samples = 2, metric = \"euclidean\", integration = \"sum\")\n", + "print(X_sampled)" ] }, { @@ -235,14 +236,14 @@ "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" + "pygments_lexer": "ipython3", + "version": "3.10.13" } }, "nbformat": 4, From 82b3a852311739adf13051f307cf7c39624ce8fa Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Thu, 25 Jul 2024 16:13:02 -0400 Subject: [PATCH 2/2] chore: make pre-commit run --- src/autora/experimentalist/novelty/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/autora/experimentalist/novelty/__init__.py b/src/autora/experimentalist/novelty/__init__.py index 2e7a5e1..6f94a4d 100644 --- a/src/autora/experimentalist/novelty/__init__.py +++ b/src/autora/experimentalist/novelty/__init__.py @@ -71,7 +71,9 @@ def sample( new_conditions.drop("score", axis=1, inplace=True) if isinstance(condition_pool_copy, pd.DataFrame): - new_conditions = pd.DataFrame(new_conditions, columns=condition_pool_copy.columns) + new_conditions = pd.DataFrame( + new_conditions, columns=condition_pool_copy.columns + ) return new_conditions