[med-svn] [Git][med-team/falcon][master] 2 commits: Down to 17 failed tests, 79 passed

Steffen Möller gitlab at salsa.debian.org
Sat Aug 29 02:36:53 BST 2020



Steffen Möller pushed to branch master at Debian Med / falcon


Commits:
0f51ee7a by Steffen Moeller at 2020-08-29T03:35:16+02:00
Down to 17 failed tests, 79 passed

- - - - -
5509c29f by Steffen Moeller at 2020-08-29T03:36:39+02:00
Cosmetics.

- - - - -


7 changed files:

- debian/control
- + debian/patches/fixUnicodeReadHelpers.patch
- + debian/patches/introduceRawStrings.patch
- + debian/patches/networkx_addPath.patch
- debian/patches/python2to3.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/control
=====================================
@@ -5,9 +5,11 @@ Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                dh-python,
+               python3-all-dev,
+               python3-setuptools,
                cython3,
                nim,
-               python3-all-dev,
+               rsync,
                python3-future (>= 0.16.0),
                python3-msgpack,
                python3-networkx (>= 2.5),
@@ -15,8 +17,6 @@ Build-Depends: debhelper-compat (= 13),
                python3-numpy,
                python3-h5py,
                python3-pytest,
-               python3-setuptools,
-               rsync
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/falcon
 Vcs-Git: https://salsa.debian.org/med-team/falcon.git


=====================================
debian/patches/fixUnicodeReadHelpers.patch
=====================================
@@ -0,0 +1,17 @@
+Index: falcon/FALCON/test/helpers.py
+===================================================================
+--- falcon.orig/FALCON/test/helpers.py
++++ falcon/FALCON/test/helpers.py
+@@ -30,9 +30,10 @@ def get_test_data_dir():
+ 
+ 
+ def assert_filecmp(got, expected_path):
+-    #result = [line.strip() for line in StringIO(got)] # fails on unicode
++    result = [line.strip() for line in StringIO(got)] # fails on unicode
+     #result = [line.strip() for line in io.TextIOWrapper(io.StringIO(got))] # for unicode
+-    result = [line.strip() for line in StringIO(bytes(got, 'utf-8'))]
++    #result = [line.strip() for line in StringIO(bytes(got, 'utf-8'))]
++    #result = [line.strip() for line in StringIO(got.encode('utf-8'))]
+     expected = [line.strip() for line in open(expected_path)]
+     diffs = list(difflib.context_diff(result, expected, fromfile='got', tofile='expected'))
+     if diffs:


=====================================
debian/patches/introduceRawStrings.patch
=====================================
@@ -0,0 +1,85 @@
+Author: Steffen Moeller
+Description: Reacting to deprecation warnings like
+   /home/moeller/git/med-team/falcon/FALCON/falcon_kit/run_support.py:311: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.
+ And to the use of backstrings in non-raw Python strings.
+Index: falcon/FALCON/falcon_kit/functional.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/functional.py
++++ falcon/FALCON/falcon_kit/functional.py
+@@ -312,7 +312,7 @@ def parsed_readlengths_from_dbdump_outpu
+     """Given output text from the DBump command,
+     yield all read-lengths.
+     """
+-    re_length = re.compile('^L\s+\d+\s+(\d+)\s+(\d+)$')
++    re_length = re.compile(r'^L\s+\d+\s+(\d+)\s+(\d+)$')
+     for line in output.splitlines():
+         mo = re_length.search(line)
+         if mo:
+@@ -331,8 +331,8 @@ def mapped_readlengths_from_dbdump_outpu
+     https://dazzlerblog.wordpress.com/command-guides/dazz_db-command-guide/
+     """
+     lengths = dict()
+-    re_rid = re.compile('^R\s+(\d+)$')
+-    re_length = re.compile('^L\s+(\d+)\s+(\d+)\s+(\d+)$')
++    re_rid = re.compile(r'^R\s+(\d+)$')
++    re_length = re.compile(r'^L\s+(\d+)\s+(\d+)\s+(\d+)$')
+     for line in output.splitlines():
+         mo = re_rid.search(line)
+         if mo:
+Index: falcon/FALCON/falcon_kit/mains/ovlp_to_graph.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/mains/ovlp_to_graph.py
++++ falcon/FALCON/falcon_kit/mains/ovlp_to_graph.py
+@@ -1443,7 +1443,7 @@ def ovlp_to_graph(args):
+     compound_path_file.close()
+ 
+     # remove short utg using local flow consistent rule
+-    """
++    r"""
+       short UTG like this can be removed, this kind of utg are likely artifects of repeats
+       >____           _____>
+            \__UTG_>__/
+Index: falcon/FALCON/falcon_kit/stats_preassembly.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/stats_preassembly.py
++++ falcon/FALCON/falcon_kit/stats_preassembly.py
+@@ -141,7 +141,7 @@ def metric_fragmentation(preads_fofn):
+     # sed -nr 's;>prolog/([0-9]*)[0-9]/.*;\1;p' %s/*.fasta | sort | uniq -c | awk '{print $1}' | sort | uniq -c
+     fastas = abs_filenames(preads_fofn)
+     assert fastas, 'No fasta found in {!r}'.format(preads_fofn)
+-    call = """perl -e 'while (<>) { if ( m{>[^/]+/(\d+)\d/} ) { $id{$1}++; } }; while (my ($k, $v) = each %%id) { $counts{$v}++; }; while (my ($k, $v) = each %%counts) { print "$v $k\n"; };' %s""" % (' '.join(fastas))
++    call = r"""perl -e 'while (<>) { if ( m{>[^/]+/(\d+)\d/} ) { $id{$1}++; } }; while (my ($k, $v) = each %%id) { $counts{$v}++; }; while (my ($k, $v) = each %%counts) { print "$v $k\n"; };' %s""" % (' '.join(fastas))
+     counts = syscall(call)
+     return functional.calc_metric_fragmentation(counts)
+ 
+@@ -150,7 +150,7 @@ def metric_truncation(db, preads_fofn):
+     # https://jira.pacificbiosciences.com/browse/SAT-105
+     fastas = abs_filenames(preads_fofn)
+     assert fastas, 'No fasta found in {!r}'.format(preads_fofn)
+-    call = """perl -e 'while (<>) { if ( m{>[^/]+/0*(\d+)\d/(\d+)_(\d+)} ) { $lengths{(1 + $1)} += ($3 - $2); } }; while (my ($k, $v) = each %%lengths) { print "$k $v\n"; };' %s""" % (' '.join(fastas))
++    call = r"""perl -e 'while (<>) { if ( m{>[^/]+/0*(\d+)\d/(\d+)_(\d+)} ) { $lengths{(1 + $1)} += ($3 - $2); } }; while (my ($k, $v) = each %%lengths) { print "$k $v\n"; };' %s""" % (' '.join(fastas))
+     # The +1 is because of the DBdump readids start at 1, but these start at 0.
+     length_pairs_output = syscall(call)
+     call = 'DBdump -rh {}'.format(db)
+Index: falcon/FALCON/falcon_kit/run_support.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/run_support.py
++++ falcon/FALCON/falcon_kit/run_support.py
+@@ -19,7 +19,7 @@ import uuid
+ 
+ logger = logging.getLogger(__name__)
+ 
+-from configparser import SafeConfigParser as ConfigParser
++from configparser import ConfigParser
+ 
+ 
+ def _prepend_env_paths(content, names):
+@@ -310,7 +310,7 @@ def parse_cfg_with_sections(stream):
+     try:
+         config = ConfigParser() #strict=False?
+         config.optionxform = str
+-        config.readfp(NativeIO(content))
++        config.read_file(NativeIO(content))
+         sections = config.sections()
+         for sec in sections:
+             result[sec] = dict(config.items(sec))


=====================================
debian/patches/networkx_addPath.patch
=====================================
@@ -0,0 +1,55 @@
+Index: falcon/FALCON/falcon_kit/fc_asm_graph.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/fc_asm_graph.py
++++ falcon/FALCON/falcon_kit/fc_asm_graph.py
+@@ -133,10 +133,10 @@ class AsmGraph(object):
+                 s, v, t = svt.split("~")
+                 type_, length, score, one_path = self.utg_data[(s, t, v)]
+                 one_path = one_path.split("~")
+-                sg.add_path(one_path)
++                nx.add_path(sg,one_path)
+         else:
+             one_path = path_or_edges.split("~")
+-            sg.add_path(one_path)
++            nx.add_path(sg,one_path)
+         return sg
+ 
+     def get_sg_for_ctg(self, ctg_id):
+@@ -150,13 +150,13 @@ class AsmGraph(object):
+         for t, utg in utgs:
+             if t == "simple":
+                 one_path = utg.split("~")
+-                sg.add_path(one_path)
++                nx.add_path(sg,one_path)
+             elif t == "compound":
+                 for svt in utg.split("|"):
+                     s, v, t = svt.split("~")
+                     type_, length, score, one_path = self.utg_data[(s, t, v)]
+                     one_path = one_path.split("~")
+-                    sg.add_path(one_path)
++                    nx.add_path(sg,one_path)
+ 
+         return sg
+ 
+Index: falcon/FALCON/src/utils/fetch_preads.py
+===================================================================
+--- falcon.orig/FALCON/src/utils/fetch_preads.py
++++ falcon/FALCON/src/utils/fetch_preads.py
+@@ -46,7 +46,7 @@ for id_ in a_tig_path:
+     if id_[:4] == p_tig_id:
+         a_path = a_tig_path[id_]
+         if a_path[0] in main_path_nodes and a_path[-1] in main_path_nodes:
+-            p_ugraph.add_path(a_path)
++            nx.add_path(p_ugraph,a_path)
+             for pp in a_path:
+                 all_nodes.add(pp)
+ 
+@@ -54,7 +54,7 @@ for v, w in u_edges:
+     if v in all_nodes and w in all_nodes:
+         for p, s in u_edges[(v, w)]:
+             p = p.split("-")
+-            p_sgraph.add_path(p)
++            nx.add_path(p_sgraph,p)
+             # print p
+             for pp in p:
+                 all_nodes.add(pp)


=====================================
debian/patches/python2to3.patch
=====================================
@@ -66,6 +66,15 @@ Index: falcon/FALCON/falcon_kit/bash.py
 ===================================================================
 --- falcon.orig/FALCON/falcon_kit/bash.py
 +++ falcon/FALCON/falcon_kit/bash.py
+@@ -8,7 +8,7 @@ from . import functional
+ import functools
+ import getpass
+ import logging
+-import md5
++from hashlib import md5
+ import os
+ import tempfile
+ import traceback
 @@ -176,7 +176,7 @@ def script_build_rdb(config, input_fofn_
      params = dict(config)
      length_cutoff = params.get('length_cutoff')
@@ -585,8 +594,8 @@ Index: falcon/FALCON/makefile
 -	which py.test || pip install --user pytest
 -	py.test ${MY_TEST_FLAGS} --junit-xml=test.xml --doctest-modules ${DOCTEST_MODULES} test/
 +	PYTHONPATH=${FALCON_WORKSPACE}/pypeFLOW:${FALCON_WORKSPACE}/FALCON:${FALCON_WORKSPACE}/FALCON/build/lib.linux-x86_64-3.8/:$$PYTHONPATH python3 -c 'import falcon_kit; print(falcon_kit.falcon)'
-+	which py.test || pip3 install --user pytest
-+	PYTHONPATH=${FALCON_WORKSPACE}/pypeFLOW:${FALCON_WORKSPACE}/FALCON:${FALCON_WORKSPACE}/FALCON/build/lib.linux-x86_64-3.8/:$$PYTHONPATH py.test ${MY_TEST_FLAGS} --junit-xml=test.xml --doctest-modules ${DOCTEST_MODULES} test/
++	which py.test-3
++	PYTHONPATH=${FALCON_WORKSPACE}/pypeFLOW:${FALCON_WORKSPACE}/FALCON:${FALCON_WORKSPACE}/FALCON/build/lib.linux-x86_64-3.8/:$$PYTHONPATH py.test-3 ${MY_TEST_FLAGS} --junit-xml=test.xml --doctest-modules ${DOCTEST_MODULES} test/
  autopep8:
  	autopep8 --max-line-length=120 -ir -j0 falcon_kit/ examples/ test/ setup.py
  
@@ -760,3 +769,151 @@ Index: falcon/pypeFLOW/pwatcher/blocking.py
  
  class JobThread(threading.Thread):
      def run(self):
+Index: falcon/FALCON/src/c/ext_falcon.c
+===================================================================
+--- falcon.orig/FALCON/src/c/ext_falcon.c
++++ falcon/FALCON/src/c/ext_falcon.c
+@@ -1,13 +1,57 @@
+ #include "Python.h"
+-static PyMethodDef SpamMethods[] = {
++
++static PyMethodDef FalconMethods[] = {
+     {NULL, NULL, 0, NULL}        /* Sentinel */
+ };
++
++#if 0
++
++// Python 2
++
++
++
+ PyMODINIT_FUNC
+ initext_falcon(void)
+ {
+     PyObject *m;
+ 
+-    m = Py_InitModule("ext_falcon", SpamMethods);
++    m = Py_InitModule("ext_falcon", FalconMethods);
+     if (m == NULL)
+         return;
++    return m;
++}
++#else
++
++// Python 3
++
++static PyObject *FalconError;
++
++static struct PyModuleDef falconmodule = {
++    PyModuleDef_HEAD_INIT,
++    "ext_falcon",
++    NULL,
++    -1,
++    FalconMethods
++};
++
++PyMODINIT_FUNC
++PyInit_ext_falcon(void)
++{
++    PyObject *m;
++
++    m = PyModule_Create(&falconmodule);
++    if (m == NULL)
++        return NULL;
++
++    FalconError = PyErr_NewException("falcon.error", NULL, NULL);
++    Py_XINCREF(FalconError);
++    if (PyModule_AddObject(m, "error", FalconError) < 0) {
++        Py_XDECREF(FalconError);
++        Py_CLEAR(FalconError);
++        Py_DECREF(m);
++        return NULL;
++    }
++
++    return m;
+ }
++#endif
+Index: falcon/FALCON/falcon_kit/FastaReader.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/FastaReader.py
++++ falcon/FALCON/falcon_kit/FastaReader.py
+@@ -8,7 +8,7 @@ from os.path import abspath, expanduser
+ from .io import NativeIO as StringIO
+ import contextlib
+ import gzip
+-import md5
++from hashlib import md5
+ import re
+ import subprocess
+ 
+@@ -68,7 +68,7 @@ class FastaRecord(object):
+             assert self.DELIMITER not in sequence
+             self._name = name
+             self._sequence = sequence
+-            self._md5 = md5.md5(self.sequence).hexdigest()
++            self._md5 = md5(self.sequence.encode('utf-8')).hexdigest()
+             self._id, self._metadata = splitFastaHeader(name)
+         except AssertionError:
+             raise ValueError("Invalid FASTA record data")
+Index: falcon/FALCON/test/test_run_support.py
+===================================================================
+--- falcon.orig/FALCON/test/test_run_support.py
++++ falcon/FALCON/test/test_run_support.py
+@@ -1,5 +1,5 @@
+ import pytest
+-import StringIO
++from io import StringIO
+ import falcon_kit.run_support as mod
+ 
+ 
+@@ -8,7 +8,7 @@ def parse_config(content):
+     (Clean this code up later.)
+     """
+     config = dict()
+-    stream = StringIO.StringIO
++    stream = StringIO
+     cfg2 = mod.parse_cfg_with_sections(stream(content))
+     mod.update_config_from_sections(config, cfg2)
+     mod.update_job_sections(config)
+@@ -102,7 +102,7 @@ def test_update_config_from_sections():
+ 
+ def test_update_config_from_sections_foo():
+     config = dict()
+-    cfg2 = mod.parse_cfg_with_sections(StringIO.StringIO(FC_RUN_CFG))
++    cfg2 = mod.parse_cfg_with_sections(StringIO(FC_RUN_CFG))
+ 
+     import collections
+     cfg2['foo'] = collections.defaultdict(list)
+Index: falcon/FALCON/falcon_kit/run_support.py
+===================================================================
+--- falcon.orig/FALCON/falcon_kit/run_support.py
++++ falcon/FALCON/falcon_kit/run_support.py
+@@ -19,7 +19,7 @@ import uuid
+ 
+ logger = logging.getLogger(__name__)
+ 
+-from ConfigParser import SafeConfigParser as ConfigParser
++from configparser import SafeConfigParser as ConfigParser
+ 
+ 
+ def _prepend_env_paths(content, names):
+Index: falcon/FALCON/test/test_util_io.py
+===================================================================
+--- falcon.orig/FALCON/test/test_util_io.py
++++ falcon/FALCON/test/test_util_io.py
+@@ -10,12 +10,13 @@ def test_io_se1331():
+     """
+     x = ''
+     cmd = 'seq 20000'
+-    beg = time.clock()
++    # processor time in seconds
++    beg = time.time()
+     reader = M.CapturedProcessReaderContext(cmd)
+     with reader:
+         for line in reader.readlines():
+             x += line
+-    end = time.clock()
++    end = time.time()
+     assert end-beg < 1
+ 
+ 


=====================================
debian/patches/series
=====================================
@@ -11,3 +11,6 @@ nimUndeclearedIdentifier.patch
 nimundeclaredWordWrap.patch
 nimTypeMismatch.patch
 python2to3.patch
+networkx_addPath.patch
+introduceRawStrings.patch
+fixUnicodeReadHelpers.patch


=====================================
debian/rules
=====================================
@@ -53,3 +53,5 @@ override_dh_auto_clean:
 	$(RM) -r pypeFLOW/build/lib
 	$(RM) -r pypeFLOW/pypeflow.egg-info
 	$(RM) -r FALCON/falcon_kit.egg-info
+	$(RM) -r FALCON/.pytest_cache
+	find . -name "*.exe" -delete



View it on GitLab: https://salsa.debian.org/med-team/falcon/-/compare/3492618ac8be3cb1cae995da7c7582e574494305...5509c29f3d0729d6fef6a6de1423d78a5ec98658

-- 
View it on GitLab: https://salsa.debian.org/med-team/falcon/-/compare/3492618ac8be3cb1cae995da7c7582e574494305...5509c29f3d0729d6fef6a6de1423d78a5ec98658
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/20200829/6bf89684/attachment-0001.html>


More information about the debian-med-commit mailing list