[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

numpy boolean subtract, the `-` operator, is deprecated, use the bitwise_xor, the `^` operator, or the logical_xor function instead (Was: Bug#899205: python-cogent: Test suite fails with latest matplotlib)



Control: tags -1 help

Hi,

I have reported the issue upstream but no response so far.  While the
error message contains some hint how to solve the issue I would like
to backup this by some competent advise.


======================================================================
ERROR: test_consistent_gap_degen_handling (test_core.test_sequence.ModelSequenceTests)
gap degen character should be treated consistently
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.5a99fnj6/downtmp/autopkgtest_tmp/tests/test_core/test_sequence.py", line 660, in test_consistent_gap_degen_handling
    self.assertEqual(dna.stripBadAndGaps(), raw_ungapped)
  File "/usr/lib/python2.7/dist-packages/cogent/core/sequence.py", line 1251, in stripBadAndGaps
    valid_indices -= self._data == i
TypeError: numpy boolean subtract, the `-` operator, is deprecated, use the bitwise_xor, the `^` operator, or the logical_xor function instead.

======================================================================


I would be happy for some suggested patch how to solve this.  The line
in question is

   https://salsa.debian.org/med-team/python-cogent/blob/master/cogent/core/sequence.py

   Line 1251

If my feeling is not totally wrong the correct patch would be 

   valid_indices -= (self._data == i)

since the left value is rather an integer than boolean.

What do you think?

Kind regards

        Andreas.

-- 
http://fam-tille.de


Reply to: