Skip to content

Commit

Permalink
Minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
samoturk committed Apr 19, 2018
1 parent ca64128 commit 95948ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mol2vec/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ def __init__(self, vec):
raise TypeError('numpy.ndarray expected, got %s' % type(self.vec))

def __str__(self):
return "%d dimensional vector" % len(self.vec)
return "%s dimensional vector" % str(self.vec.shape)

__repr__ = __str__

def __len__(self):
return len(self.vec)

_repr_html_ = __str__


class MolSentence:
"""Class for storing mol sentences in pandas DataFrame
Expand Down Expand Up @@ -67,6 +69,9 @@ def __iter__(self): # Iterate over words (for word in MolSentence:...)
for x in self.sentence:
yield x

_repr_html_ = __str__



def mol2sentence(mol, radius):

Expand Down Expand Up @@ -291,7 +296,7 @@ def insert_unk(corpus, out_corpus, threshold=3, uncommon='UNK'):
out_corpus : str
Outfile corpus file
threshold : int
Radius of morgan fingerprint
Number of identifier occurrences to consider it uncommon
uncommon : str
String to use to replace uncommon words/identifiers
Expand Down

0 comments on commit 95948ad

Please sign in to comment.