[med-svn] [Git][med-team/q2-feature-classifier][master] 7 commits: New upstream version 2024.5.0

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Wed Jun 26 14:18:55 BST 2024



Michael R. Crusoe pushed to branch master at Debian Med / q2-feature-classifier


Commits:
7f0ea9e4 by Michael R. Crusoe at 2024-06-26T14:40:56+02:00
New upstream version 2024.5.0
- - - - -
542ac242 by Michael R. Crusoe at 2024-06-26T14:40:56+02:00
routine-update: New upstream version

- - - - -
ddd13d02 by Michael R. Crusoe at 2024-06-26T14:40:58+02:00
Update upstream source from tag 'upstream/2024.5.0'

Update to upstream version '2024.5.0'
with Debian dir ffff324b7fc4f8577057592bb3370476e12e0dbb
- - - - -
50563344 by Michael R. Crusoe at 2024-06-26T14:41:18+02:00
routine-update: Regenerate debian/control from debian/control.in

- - - - -
e7de91d5 by Michael R. Crusoe at 2024-06-26T14:50:15+02:00
Drop sklearn-1.2.1 patch, it was applied upstream.

- - - - -
cc32ae67 by Michael R. Crusoe at 2024-06-26T14:51:34+02:00
d/patches/configparser.patch: copy from qiime

- - - - -
053e6e6d by Michael R. Crusoe at 2024-06-26T15:05:25+02:00
Only build for Python 3.11 until upstream catches up with Python 3.12.

- - - - -


13 changed files:

- debian/changelog
- debian/control
- debian/control.in
- + debian/patches/configparser.patch
- debian/patches/series
- − debian/patches/sklearn-1.2.1.patch
- debian/rules
- debian/tests/run-unit-test
- q2_feature_classifier/_skl.py
- q2_feature_classifier/_version.py
- q2_feature_classifier/classifier.py
- q2_feature_classifier/tests/test_classifier.py
- q2_feature_classifier/tests/test_custom.py


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+q2-feature-classifier (2024.5.0-1) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * New upstream version
+  * Regenerate debian/control from debian/control.in (routine-update)
+  * Drop sklearn-1.2.1 patch, it was applied upstream.
+  * d/patches/configparser.patch: copy from qiime
+  * Only build for Python 3.11 until upstream catches up with Python
+    3.12.
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Wed, 26 Jun 2024 14:40:56 +0200
+
 q2-feature-classifier (2024.2.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                dh-sequence-python3,
-               python3,
+               python3-all,
                python3-setuptools,
                python3-pytest-cov,
                python3-sklearn,
@@ -15,11 +15,11 @@ Build-Depends: debhelper-compat (= 13),
                python3-skbio,
                ncbi-blast+,
                vsearch,
-               qiime (>= 2024.2),
-               q2-types (>= 2024.2),
-               q2-quality-control (>= 2024.2),
-               q2-taxa (>= 2024.2),
-               q2-feature-table (>= 2024.2)
+               qiime (>= 2024.5),
+               q2-types (>= 2024.5),
+               q2-quality-control (>= 2024.5),
+               q2-taxa (>= 2024.5),
+               q2-feature-table (>= 2024.5)
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/med-team/q2-feature-classifier
 Vcs-Git: https://salsa.debian.org/med-team/q2-feature-classifier.git
@@ -37,11 +37,11 @@ Depends: ${shlibs:Depends},
          python3-biom-format,
          ncbi-blast+,
          vsearch,
-         qiime (>= 2024.2),
-         q2-types (>= 2024.2),
-         q2-quality-control (>= 2024.2),
-         q2-taxa (>= 2024.2),
-         q2-feature-table (>= 2024.2)
+         qiime (>= 2024.5),
+         q2-types (>= 2024.5),
+         q2-quality-control (>= 2024.5),
+         q2-taxa (>= 2024.5),
+         q2-feature-table (>= 2024.5)
 Description: QIIME 2 plugin supporting taxonomic classification
  QIIME 2 is a powerful, extensible, and decentralized microbiome analysis
  package with a focus on data and analysis transparency. QIIME 2 enables


=====================================
debian/control.in
=====================================
@@ -6,7 +6,7 @@ Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                dh-sequence-python3,
-               python3,
+               python3-all,
                python3-setuptools,
                python3-pytest-cov,
                python3-sklearn,


=====================================
debian/patches/configparser.patch
=====================================
@@ -0,0 +1,27 @@
+From: Athos Ribeiro <athos.ribeiro at canonical.com>                               
+Date: Mon, 3 Jun 2024 11:31:54 -0300                                            
+Subject: Use ConfigParser instead of SafeConfigParser                   
+                                                                                
+The configparser's SafeConfigParser has been renamed to ConfigParser in         
+Python 3.2 [1]. It was finally removed in Python 3.12 [2].                      
+                                                                                
+[1] https://docs.python.org/dev/whatsnew/3.2.html#configparser                  
+[2] https://docs.python.org/3/whatsnew/3.12.html#configparser                   
+                                                                                
+Last-Update: 2024-06-03                                                         
+Forwarded: not-needed, see https://github.com/qiime2/q2-sample-classifier/pull/229
+
+--- q2-types.orig/versioneer.py
++++ q2-types/versioneer.py
+@@ -340,9 +340,9 @@
+     # configparser.NoOptionError (if it lacks "VCS="). See the docstring at
+     # the top of versioneer.py for instructions on writing your setup.cfg .
+     setup_cfg = os.path.join(root, "setup.cfg")
+-    parser = configparser.SafeConfigParser()
++    parser = configparser.ConfigParser()
+     with open(setup_cfg, "r") as f:
+-        parser.readfp(f)
++        parser.read_file(f)
+     VCS = parser.get("versioneer", "VCS")  # mandatory
+ 
+     def get(parser, name):


=====================================
debian/patches/series
=====================================
@@ -1 +1 @@
-sklearn-1.2.1.patch
+configparser.patch


=====================================
debian/patches/sklearn-1.2.1.patch deleted
=====================================
@@ -1,80 +0,0 @@
-Description: fix test failures with sklearn 1.2.1
- This patch works around an issue with scikit-learn not being tolerant about
- ngram_range being a list instead of a tuple anymore, and the json module
- tending to forcefully convert tuples from specifications into lists.
-Author: Étienne Mollier <emollier at debian.org>
-Forwarded: https://github.com/qiime2/q2-feature-classifier/issues/187
-Last-Update: 2023-02-02
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- q2-feature-classifier.orig/q2_feature_classifier/_skl.py
-+++ q2-feature-classifier/q2_feature_classifier/_skl.py
-@@ -17,7 +17,7 @@
-            {'__type__': 'feature_extraction.text.HashingVectorizer',
-             'analyzer': 'char_wb',
-             'n_features': 8192,
--            'ngram_range': [7, 7],
-+            'ngram_range': (7, 7),
-             'alternate_sign': False}],
-           ['classify',
-            {'__type__': 'custom.LowMemoryMultinomialNB',
---- q2-feature-classifier.orig/q2_feature_classifier/tests/test_classifier.py
-+++ q2-feature-classifier/q2_feature_classifier/tests/test_classifier.py
-@@ -66,7 +66,7 @@
-                      {'__type__': 'feature_extraction.text.HashingVectorizer',
-                       'analyzer': 'char_wb',
-                       'n_features': 8192,
--                      'ngram_range': [8, 8],
-+                      'ngram_range': (8, 8),
-                       'alternate_sign': False}],
-                     ['classify',
-                      {'__type__': 'naive_bayes.GaussianNB'}]]
-@@ -117,7 +117,7 @@
-                      {'__type__': 'feature_extraction.text.HashingVectorizer',
-                       'analyzer': 'char_wb',
-                       'n_features': 8192,
--                      'ngram_range': [8, 8],
-+                      'ngram_range': (8, 8),
-                       'alternate_sign': False}],
-                     ['classify',
-                      {'__type__': 'linear_model.LogisticRegression'}]]
---- q2-feature-classifier.orig/q2_feature_classifier/tests/test_custom.py
-+++ q2-feature-classifier/q2_feature_classifier/tests/test_custom.py
-@@ -39,7 +39,7 @@
-                 {'__type__': 'feature_extraction.text.HashingVectorizer',
-                  'analyzer': 'char',
-                  'n_features': 8192,
--                 'ngram_range': [8, 8],
-+                 'ngram_range': (8, 8),
-                  'alternate_sign': False}],
-                 ['classify',
-                  {'__type__': 'custom.LowMemoryMultinomialNB',
-@@ -68,7 +68,7 @@
- 
-         params = {'analyzer': 'char',
-                   'n_features': 8192,
--                  'ngram_range': [8, 8],
-+                  'ngram_range': (8, 8),
-                   'alternate_sign': False}
-         hv = HashingVectorizer(**params)
-         unchunked = hv.fit_transform(X)
---- q2-feature-classifier.orig/q2_feature_classifier/classifier.py
-+++ q2-feature-classifier/q2_feature_classifier/classifier.py
-@@ -84,6 +84,8 @@
- 
- def pipeline_from_spec(spec):
-     def as_steps(obj):
-+        if 'ngram_range' in obj:
-+            obj['ngram_range'] = tuple(obj['ngram_range'])
-         if '__type__' in obj:
-             klass = _load_class(obj['__type__'])
-             return klass(**{k: v for k, v in obj.items() if k != '__type__'})
-@@ -323,6 +325,8 @@
-                 kwargs[param] = json.loads(kwargs[param])
-             except (json.JSONDecodeError, TypeError):
-                 pass
-+            if param == 'feat_ext__ngram_range':
-+                kwargs[param] = tuple(kwargs[param])
-         pipeline = pipeline_from_spec(spec)
-         pipeline.set_params(**kwargs)
-         if class_weight is not None:


=====================================
debian/rules
=====================================
@@ -3,6 +3,8 @@
 # DH_VERBOSE := 1
 export LC_ALL=C.UTF-8
 
+export PYBUILD_DISABLE=python3.12
+
 # For testing, we need .egg-info so the entry points are available.
 export PYBUILD_BEFORE_TEST=python{version} setup.py develop --install-dir {build_dir}
 # Delete .egg-info and other files that were generated along with .egg-info


=====================================
debian/tests/run-unit-test
=====================================
@@ -18,7 +18,9 @@ if [ ! -f /usr/lib/python3/dist-packages/pytest_cov/__init__.py ] ; then
 fi
 
 # Run build-time tests
-for py in $(py3versions -s 2> /dev/null)
-do
-    ${py} -m pytest -v  --cov=${pkg}
-done
+# for py in $(py3versions -s 2> /dev/null)
+# do
+#     ${py} -m pytest -v  --cov=${pkg}
+# done
+
+python3.11 -m pytest -v  --cov=${pkg}


=====================================
q2_feature_classifier/_skl.py
=====================================
@@ -61,7 +61,7 @@ _specific_fitters = [
            {'__type__': 'feature_extraction.text.HashingVectorizer',
             'analyzer': 'char_wb',
             'n_features': 8192,
-            'ngram_range': [7, 7],
+            'ngram_range': (7, 7),
             'alternate_sign': False}],
           ['classify',
            {'__type__': 'custom.LowMemoryMultinomialNB',


=====================================
q2_feature_classifier/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (tag: 2024.2.0, Release-2024.2)"
-    git_full = "5ce76be5b72482a7d033fb9d2c41446edd75851a"
-    git_date = "2024-02-16 21:57:24 +0000"
+    git_refnames = " (tag: 2024.5.0, Release-2024.5)"
+    git_full = "d14730e4fc0447415705d0084b17f18f7e6b4d82"
+    git_date = "2024-05-29 04:15:35 +0000"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
q2_feature_classifier/classifier.py
=====================================
@@ -86,6 +86,8 @@ def spec_from_pipeline(pipeline):
 
 def pipeline_from_spec(spec):
     def as_steps(obj):
+        if 'ngram_range' in obj:
+            obj['ngram_range'] = tuple(obj['ngram_range'])
         if '__type__' in obj:
             klass = _load_class(obj['__type__'])
             return klass(**{k: v for k, v in obj.items() if k != '__type__'})
@@ -206,11 +208,8 @@ def classify_sklearn(reads: DNAFASTAFormat, classifier: Pipeline,
                      read_orientation: str = 'auto'
                      ) -> pd.DataFrame:
 
-    if n_jobs in (0, -1):
+    if n_jobs == 0:
         n_jobs = get_available_cores()
-    elif n_jobs < -1:
-        n_less = abs(n_jobs + 1)
-        n_jobs = get_available_cores(n_less=n_less)
 
     try:
         # autotune reads per batch
@@ -266,11 +265,9 @@ _parameter_descriptions = {
     'reads_per_batch': 'Number of reads to process in each batch. If "auto", '
                        'this parameter is autoscaled to '
                        'min( number of query sequences / n_jobs, 20000).',
-    'n_jobs': 'The maximum number of concurrent worker processes. If -1 '
+    'n_jobs': 'The maximum number of concurrent worker processes. If 0 '
               'all CPUs are used. If 1 is given, no parallel computing '
-              'code is used at all, which is useful for debugging. For '
-              'n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for '
-              'n_jobs = -2, all CPUs but one are used.',
+              'code is used at all, which is useful for debugging.',
     'pre_dispatch': '"all" or expression, as in "3*n_jobs". The number of '
                     'batches (of tasks) to be pre-dispatched.'
 }
@@ -332,6 +329,8 @@ def _register_fitter(name, spec):
                 kwargs[param] = json.loads(kwargs[param])
             except (json.JSONDecodeError, TypeError):
                 pass
+            if param == 'feat_ext__ngram_range':
+                kwargs[param] = tuple(kwargs[param])
         pipeline = pipeline_from_spec(spec)
         pipeline.set_params(**kwargs)
         if class_weight is not None:


=====================================
q2_feature_classifier/tests/test_classifier.py
=====================================
@@ -66,7 +66,7 @@ class ClassifierTests(FeatureClassifierTestPluginBase):
                      {'__type__': 'feature_extraction.text.HashingVectorizer',
                       'analyzer': 'char_wb',
                       'n_features': 8192,
-                      'ngram_range': [8, 8],
+                      'ngram_range': (8, 8),
                       'alternate_sign': False}],
                     ['classify',
                      {'__type__': 'naive_bayes.GaussianNB'}]]
@@ -117,7 +117,7 @@ class ClassifierTests(FeatureClassifierTestPluginBase):
                      {'__type__': 'feature_extraction.text.HashingVectorizer',
                       'analyzer': 'char_wb',
                       'n_features': 8192,
-                      'ngram_range': [8, 8],
+                      'ngram_range': (8, 8),
                       'alternate_sign': False}],
                     ['classify',
                      {'__type__': 'linear_model.LogisticRegression'}]]


=====================================
q2_feature_classifier/tests/test_custom.py
=====================================
@@ -39,7 +39,7 @@ class CustomTests(FeatureClassifierTestPluginBase):
                 {'__type__': 'feature_extraction.text.HashingVectorizer',
                  'analyzer': 'char',
                  'n_features': 8192,
-                 'ngram_range': [8, 8],
+                 'ngram_range': (8, 8),
                  'alternate_sign': False}],
                 ['classify',
                  {'__type__': 'custom.LowMemoryMultinomialNB',
@@ -68,7 +68,7 @@ class CustomTests(FeatureClassifierTestPluginBase):
 
         params = {'analyzer': 'char',
                   'n_features': 8192,
-                  'ngram_range': [8, 8],
+                  'ngram_range': (8, 8),
                   'alternate_sign': False}
         hv = HashingVectorizer(**params)
         unchunked = hv.fit_transform(X)



View it on GitLab: https://salsa.debian.org/med-team/q2-feature-classifier/-/compare/3beaea82de2137c72d4a997cf57b34f9913ad5d1...053e6e6d2378868ebe770162deb415fa29a6999b

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/med-team/q2-feature-classifier/-/compare/3beaea82de2137c72d4a997cf57b34f9913ad5d1...053e6e6d2378868ebe770162deb415fa29a6999b
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/20240626/89284e46/attachment-0001.htm>


More information about the debian-med-commit mailing list