Skip to content

Add back the "print" lint rule #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ ignore = [
"FBT", # flake-boolean-trap... disallows boolean args to functions... fixing this code will require refactors.
"ANN", # flake8-annotations is for typed code
"DJ", # django specific
"T20", # forbids print, we print quite a bit
"PYI", # pyi is typing stub files
"PT", # pytest specific
"PTH", # pathlib is preferred, but we're not using it yet
Expand Down
93 changes: 0 additions & 93 deletions v03_pipeline/bin/write_cached_reference_dataset_query_ht.py

This file was deleted.

12 changes: 8 additions & 4 deletions v03_pipeline/lib/misc/sample_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import hail as hl

from v03_pipeline.lib.logger import get_logger

logger = get_logger(__name__)


class MatrixTableSampleSetError(Exception):
def __init__(self, message, missing_samples):
Expand Down Expand Up @@ -42,15 +46,15 @@ def remap_sample_ids(
f'All callset sample IDs:{mt.s.collect()}'
)
if ignore_missing_samples_when_remapping:
print(message)
logger.info(message)
else:
raise MatrixTableSampleSetError(message, missing_samples)

mt = mt.annotate_cols(**project_remap_ht[mt.s])
remap_expr = hl.if_else(hl.is_missing(mt.seqr_id), mt.s, mt.seqr_id)
mt = mt.annotate_cols(seqr_id=remap_expr, vcf_id=mt.s)
mt = mt.key_cols_by(s=mt.seqr_id)
print(f'Remapped {remap_count} sample ids...')
logger.info(f'Remapped {remap_count} sample ids...')
return mt


Expand All @@ -77,9 +81,9 @@ def subset_samples(
if (
subset_count > anti_join_ht_count
) and ignore_missing_samples_when_subsetting:
print(message)
logger.info(message)
else:
raise MatrixTableSampleSetError(message, missing_samples)
print(f'Subsetted to {subset_count} sample ids')
logger.info(f'Subsetted to {subset_count} sample ids')
mt = mt.semi_join_cols(sample_subset_ht)
return mt.filter_rows(hl.agg.any(hl.is_defined(mt.GT)))
Loading