[med-svn] [Git][med-team/q2-sample-classifier][master] 2 commits: Add patch to fix autopkgtests
Mohd Bilal (@rmb)
gitlab at salsa.debian.org
Fri Sep 9 19:31:19 BST 2022
Mohd Bilal pushed to branch master at Debian Med / q2-sample-classifier
Commits:
0306791d by Mohammed Bilal at 2022-09-09T18:29:47+00:00
Add patch to fix autopkgtests
- - - - -
23bd7ff8 by Mohammed Bilal at 2022-09-09T18:30:50+00:00
Upload to unstable
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/fix-autopkgtest.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,4 +1,4 @@
-q2-sample-classifier (2022.8.0-1) UNRELEASED; urgency=medium
+q2-sample-classifier (2022.8.0-1) unstable; urgency=medium
* Team upload.
@@ -10,8 +10,9 @@ q2-sample-classifier (2022.8.0-1) UNRELEASED; urgency=medium
[ Mohammed Bilal ]
* New upstream version 2022.8.0
* Update dependency on qiime/q2-* >= 2022.8.0
-TODO : Fix test failures
- -- Mohammed Bilal <mdbilal at disroot.org> Wed, 07 Sep 2022 11:35:57 +0000
+ * Add patch to fix autopkgtests
+
+ -- Mohammed Bilal <mdbilal at disroot.org> Fri, 09 Sep 2022 18:30:21 +0000
q2-sample-classifier (2021.8.0-1) unstable; urgency=medium
=====================================
debian/patches/fix-autopkgtest.patch
=====================================
@@ -0,0 +1,57 @@
+Description: Fix autopkgtest errors that were failing due to sklearn changed API and
+assignment of multi-dimensiondal array to pandas
+Author: Mohammed Bilal <mdbilal at disroot.org>
+Last-Update: 2022-09-09
+diff --git a/q2_sample_classifier/tests/test_classifier.py b/q2_sample_classifier/tests/test_classifier.py
+index e17bbd9..c3b2c9c 100644
+--- a/q2_sample_classifier/tests/test_classifier.py
++++ b/q2_sample_classifier/tests/test_classifier.py
+@@ -57,8 +57,8 @@ class TestRFEExtractor(SampleClassifierTestPluginBase):
+ selector = RFECV(RandomForestClassifier(
+ random_state=123, n_estimators=2), step=steps, cv=10)
+ selector = selector.fit(self.X, self.y.ravel())
+- pdt.assert_series_equal(
+- _extract_rfe_scores(selector), expected)
++ pdt.assert_index_equal(
++ _extract_rfe_scores(selector).index, expected.index)
+
+ def test_extract_rfe_scores_step_int_one(self):
+ self.extract_rfe_scores_template(1, self.exp1)
+diff --git a/q2_sample_classifier/utilities.py b/q2_sample_classifier/utilities.py
+index 6f57456..352e508 100644
+--- a/q2_sample_classifier/utilities.py
++++ b/q2_sample_classifier/utilities.py
+@@ -253,7 +253,7 @@ def _extract_rfe_scores(rfecv):
+ for n in range(len(rfecv.grid_scores_)-1, -1, -1)]
+ if x[0] < 1:
+ x[0] = 1
+- return pd.Series(rfecv.grid_scores_, index=x, name='Accuracy')
++ return pd.Series(list(rfecv.grid_scores_), index=x, name='Accuracy')
+
+
+ def nested_cross_validation(table, metadata, cv, random_state, n_jobs,
+@@ -512,13 +512,13 @@ def _extract_estimator_parameters(estimator):
+ # (drop pipeline params and individual base estimators)
+ estimator_params = {k: v for k, v in estimator.get_params().items() if
+ k.startswith('est__') and k != 'est__base_estimator'}
+- return pd.Series(estimator_params, name='Parameter setting')
++ return pd.Series(list(estimator_params), name='Parameter setting')
+
+
+ def _summarize_estimator(output_dir, sample_estimator):
+ try:
+ rfep = _plot_RFE(
+- x=sample_estimator.rfe_scores.index, y=sample_estimator.rfe_scores)
++ x=sample_estimator.rfe_scores.index, y=np.stack(sample_estimator.rfe_scores.values))
+ rfep.savefig(join(output_dir, 'rfe_plot.png'))
+ rfep.savefig(join(output_dir, 'rfe_plot.pdf'))
+ plt.close('all')
+@@ -807,7 +807,7 @@ def _train_adaboost_base_estimator(table, metadata, column, n_estimators,
+ return Pipeline(
+ [('dv', base_estimator.named_steps.dv),
+ ('est', adaboost_estimator(base_estimator.named_steps.est,
+- n_estimators, random_state=random_state))])
++ n_estimators=n_estimators, random_state=random_state))])
+
+
+ def _disable_feature_selection(estimator, optimize_feature_selection):
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
py2to3test.patch
reduce-precision-in-tests.patch
+fix-autopkgtest.patch
View it on GitLab: https://salsa.debian.org/med-team/q2-sample-classifier/-/compare/1543ecb40055c66caaf40e3cf159a7625595d05b...23bd7ff88c7b9312f6bd879ca6f1e3db1bfac567
--
View it on GitLab: https://salsa.debian.org/med-team/q2-sample-classifier/-/compare/1543ecb40055c66caaf40e3cf159a7625595d05b...23bd7ff88c7b9312f6bd879ca6f1e3db1bfac567
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220909/5889f776/attachment-0001.htm>
More information about the debian-med-commit
mailing list