Skip to content

Failed

tests.test_api.test_export (from pytest)

Failing for the past 1 build (Since Failed#82 )
Took 1 ms.

This test is unclaimed

Error Message

AttributeError: 'function' object has no attribute 'iterrows'

Stacktrace

corpus = <cophi.model.Corpus object at 0x7f589dc5cb00>

    def test_export(corpus):
        output = pathlib.Path("corpus.svmlight")
>       cophi.export(corpus.dtm, output, "svmlight")

tests/test_api.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/cophi/api.py:98: in export
    cophi.model.Corpus.svmlight(corpus, filepath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'cophi.model.Corpus'>, dtm = <function corpus at 0x7f589e9e9f28>
filepath = PosixPath('corpus.svmlight')

    @classmethod
    def svmlight(cls, dtm, filepath):
        """Export corpus to SVMLight format.
    
        Parameters:
            dtm: Document-term matrix.
            filepath: Path to output file.
        """
        with pathlib.Path(filepath).open("w", encoding="utf-8") as file:
>           for title, document in dtm.iterrows():
E           AttributeError: 'function' object has no attribute 'iterrows'

src/cophi/model.py:689: AttributeError