Skip to content

Commit

Permalink
Getting rid of sys.maxint (doesn't exist in Python3), just picking a …
Browse files Browse the repository at this point in the history
…too-large number.
  • Loading branch information
julia326 committed Sep 13, 2017
1 parent 9e050a9 commit c6d16b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/test_mutant_protein_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import absolute_import, print_function, division
from operator import attrgetter

from nose.tools import eq_
from nose.tools import eq_, assert_almost_equal
from vaxrank.core_logic import ranked_vaccine_peptides
from mhctools import RandomBindingPredictor
from isovar.cli.variant_sequences import make_variant_sequences_arg_parser
Expand Down Expand Up @@ -132,4 +132,4 @@ def test_keep_top_k_epitopes():
# propagated as expected
mutant_epitope_score = sum(
p.logistic_epitope_score() for p in vaccine_peptide.mutant_epitope_predictions)
eq_(mutant_epitope_score, vaccine_peptide.mutant_epitope_score)
assert_almost_equal(mutant_epitope_score, vaccine_peptide.mutant_epitope_score)
5 changes: 2 additions & 3 deletions vaxrank/core_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from __future__ import absolute_import, print_function, division
import logging
import sys

from numpy import isclose

Expand Down Expand Up @@ -136,7 +135,7 @@ def generate_vaccine_peptides(
min_alt_rna_reads,
min_variant_sequence_coverage,
variant_sequence_assembly,
num_mutant_epitopes_to_keep=sys.maxint,
num_mutant_epitopes_to_keep=10000,
min_epitope_score=0):
"""
Returns dictionary mapping each variant to list of VaccinePeptide objects.
Expand Down Expand Up @@ -179,7 +178,7 @@ def ranked_vaccine_peptides(
min_alt_rna_reads,
min_variant_sequence_coverage,
variant_sequence_assembly,
num_mutant_epitopes_to_keep=sys.maxint,
num_mutant_epitopes_to_keep=10000,
min_epitope_score=0):
"""
Returns sorted list whose first element is a Variant and whose second
Expand Down
3 changes: 1 addition & 2 deletions vaxrank/vaccine_peptide.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from collections import namedtuple
from operator import attrgetter
import sys

import numpy as np

Expand All @@ -43,7 +42,7 @@ def __new__(
cls,
mutant_protein_fragment,
epitope_predictions,
num_mutant_epitopes_to_keep=sys.maxint,
num_mutant_epitopes_to_keep=10000,
min_epitope_score=0):
# only keep the top k epitopes
mutant_epitope_predictions = sorted([
Expand Down

0 comments on commit c6d16b8

Please sign in to comment.