Skip to content

Commit

Permalink
MAINT: replace deprecated .warn() method (#219)
Browse files Browse the repository at this point in the history
* MAINT: replace deprecated `.warn()` method

* FIX: replace type checking with isinstance

* FIX: indentation

* FIX: trailing whitespace
  • Loading branch information
valentynbez authored Aug 7, 2023
1 parent eca1176 commit 097bdc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deblur/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, label, sequence):
[trans_dict[b] for b in self.sequence], dtype=np.int8)

def __eq__(self, other):
return (type(self) == type(other) and
return (isinstance(other, type(self)) and
self.sequence == other.sequence and
self.frequency == other.frequency)

Expand Down
12 changes: 6 additions & 6 deletions scripts/deblur
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ def remove_artifacts(seqs_fp, output_dir, ref_fp, ref_db_fp,
"does not match the number of indexed "
"reference databases")
else:
logger.warn('sortmerna database does not exist, '
'creating it into dir %s' % output_dir)
logger.warning('sortmerna database does not exist, '
'creating it into dir %s' % output_dir)
ref_db_fp = build_index_sortmerna(
ref_fp=ref_fp,
working_dir=output_dir)
Expand Down Expand Up @@ -531,9 +531,9 @@ def workflow(seqs_fp, output_dir, pos_ref_fp, pos_ref_db_fp,
"""Launch deblur workflow"""
start_log(level=log_level * 10, filename=log_file)
logger = logging.getLogger(__name__)
logger.warn('deblur version %s workflow started on %s' %
(__version__, seqs_fp))
logger.warn('parameters: %s' % locals())
logger.warning('deblur version %s workflow started on %s' %
(__version__, seqs_fp))
logger.warning('parameters: %s' % locals())

# set the error distribution
if error_dist is None:
Expand Down Expand Up @@ -634,7 +634,7 @@ def workflow(seqs_fp, output_dir, pos_ref_fp, pos_ref_db_fp,
min_size=min_size, ref_fp=ref_fp, ref_db_fp=ref_db_fp,
threads_per_sample=threads_per_sample)
if deblurred_file_name is None:
logger.warn('deblurring failed for file %s' % input_fp)
logger.warning('deblurring failed for file %s' % input_fp)
logger.info('finished processing per sample fasta files')
else:
# we're want to start parallel mode - so need to create
Expand Down

0 comments on commit 097bdc6

Please sign in to comment.