Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
shorter way to suppress a warning
  • Loading branch information
proost committed Jan 25, 2018
1 parent 9063506 commit addb70b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions conekt/models/expression/profiles.py
@@ -1,9 +1,9 @@
from conekt import db
from conekt.models.species import Species
from conekt.models.sequences import Sequence
from conekt.models.condition_tissue import ConditionTissue

import json
import contextlib
from collections import defaultdict
from statistics import mean
from math import log
Expand Down Expand Up @@ -169,17 +169,11 @@ def get_heatmap(species_id, probes, zlog=True, raw=False):
order = data['order']
experiments = data['data']

try:
with contextlib.suppress(ValueError):
not_found.remove(profile.probe.lower())
except ValueError as _:
# Element not in list
pass

try:
with contextlib.suppress(ValueError):
not_found.remove(profile.sequence.name.lower())
except ValueError as _:
# Element not in list
pass

values = {}

Expand All @@ -205,7 +199,7 @@ def get_heatmap(species_id, probes, zlog=True, raw=False):
"shortest_alias":profile.sequence.shortest_alias})

if len(not_found) > 0:
flash("Couldn't fine profile for: %s" % ",".join(not_found), "warning")
flash("Couldn't find profile for: %s" % ",".join(not_found), "warning")

return {'order': order, 'heatmap_data': output}

Expand Down

0 comments on commit addb70b

Please sign in to comment.