Skip to content

Commit

Permalink
fix: classmethod -> staticmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Dec 23, 2018
1 parent 004872f commit a824e48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cophi/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (1, 0, 9)
VERSION = (1, 0, 10)

__version__ = ".".join(map(str, VERSION))
12 changes: 6 additions & 6 deletions src/cophi/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def parse_xml(self, parser=lxml.etree.XMLParser()):
"""
return lxml.etree.parse(str(self.filepath), parser=parser)

@classmethod
@staticmethod
def stringify(tree):
"""Serialize to an encoded string representation of its XML tree.
Expand Down Expand Up @@ -230,7 +230,7 @@ def freq_spectrum(self):
bow = collections.Counter(self.tokens) # no pandas needed here
return pd.Series(collections.Counter(bow.values()))

@classmethod
@staticmethod
def drop(tokens, features):
"""Drop features.
Expand Down Expand Up @@ -365,7 +365,7 @@ def count_corpus(documents):
self.dtm = matrix(counts)
self.dtm = self.dtm.T

@classmethod
@staticmethod
def map_metadata(data, metadata, uuid="uuid", fields=["title"], sep="_"):
"""Map metadata with a UUID.
Expand Down Expand Up @@ -410,7 +410,7 @@ def types(self):
"""
return list(self.dtm.columns)

@classmethod
@staticmethod
def sort(dtm):
"""Descending sorted document-term matrix.
Expand Down Expand Up @@ -444,7 +444,7 @@ def hapax(self):
"""
return list(self.dtm.loc[:, self.dtm.max() == 1].columns)

@classmethod
@staticmethod
def drop(dtm, features):
"""Drop features from document-term matrix.
Expand All @@ -455,7 +455,7 @@ def drop(dtm, features):
features = [token for token in features if token in dtm.columns]
return dtm.drop(features, axis=1)

@classmethod
@staticmethod
def cull(dtm, ratio=None, threshold=None, keepna=False):
"""Remove features that do not appear in a minimum of documents.
Expand Down

0 comments on commit a824e48

Please sign in to comment.