From cdf8b6953310ee8aeec4b68385e8fa30ed51ce5f Mon Sep 17 00:00:00 2001 From: Tim O'Donnell <timodonnell@gmail.com> Date: Wed, 23 May 2018 13:42:12 -0400 Subject: [PATCH] fix --- mhcflurry/allele_encoding.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mhcflurry/allele_encoding.py b/mhcflurry/allele_encoding.py index 46ab3d8c..fb33f487 100644 --- a/mhcflurry/allele_encoding.py +++ b/mhcflurry/allele_encoding.py @@ -54,13 +54,9 @@ class AlleleEncoding(object): Returns ------- - list of numpy arrays. Pass it to numpy.array to get an array with shape + numpy.array to get an array with shape (num sequences, sequence length, m) where m is vector_encoding_length(vector_encoding_name) - - The reason to return a list instead of an array is that the list can - use much less memory in the common case where many of the rows are - the same. """ cache_key = ( "fixed_length_vector_encoding", @@ -87,7 +83,7 @@ class AlleleEncoding(object): else: # Raw values vector_encoded = allele_to_fixed_length_sequence.values - result = [vector_encoded[i] for i in indices] + result = numpy.array([vector_encoded[i] for i in indices]) self.encoding_cache[cache_key] = result return self.encoding_cache[cache_key] -- GitLab