diging / tethne

Python module for bibliographic network analysis.
http://diging.github.io/tethne/
GNU General Public License v3.0
82 stars 32 forks source link

Cannot read a zotero rdf file. List index out of range error #82

Closed ravikanth720 closed 9 years ago

ravikanth720 commented 9 years ago

The following error encountered when reading a zotero rdf containing 10 records.

Steps to recreate the issue.

  1. Download 10 papers from jstor using zotero
  2. Place it in appropriate folder with proper naming convention (tethnehome/tethne/tests/data/dataset/dataset.rdf)
  3. Change the number of papers the test is expecting from 12 to 10
  4. Run the test for zotero reader as shown below

(tethneEnv)ravi@marvin:~/tethne/tethne$ nosetests tethne/tests/test_readers_zotero.py

Expected Result: Test to return OK.

Actual Result:

ERROR: test_read (tethne.tests.test_readers_zotero.TestZoteroParser)

Traceback (most recent call last):
  File "/home/ravi/tethne/tethne/tethne/tests/test_readers_zotero.py", line 16, in test_read
    corpus = read(datapath)
  File "/home/ravi/tethne/tethne/tethne/readers/zotero.py", line 180, in read
    return Corpus(papers, index_by=index_by, **kwargs)
  File "/home/ravi/tethne/tethne/tethne/classes/corpus.py", line 149, in __init__
    self.indexed_papers = {self._generate_index(paper): paper for paper in papers}
  File "/home/ravi/tethne/tethne/tethne/classes/corpus.py", line 149, in <dictcomp>
    self.indexed_papers = {self._generate_index(paper): paper for paper in papers}
  File "/home/ravi/tethne/tethne/tethne/classes/corpus.py", line 171, in _generate_index
    authors = zip(*paper.authors)[0]
IndexError: list index out of range
ravikanth720 commented 9 years ago

This bug is fixed in the latest version of code from a different fix. I tested it with different zotero rdf files

erickpeirson commented 9 years ago

@ravikanth720 Be sure to mention this issue in your commit messages and pull requests. See this page. That way we can see exactly what you're talking about!

ravikanth720 commented 9 years ago

82 does not seem to be a problem any more with the latest version of develop branch.

There is no additional commit required for this issue. Sorry for not being clear before. Can I close this defect? @erickpeirson

erickpeirson commented 9 years ago

Haha, you don't have to tag the issue in a comment on the issue, I just thought that you had code somewhere.

Yes, if this is no longer a problem, go ahead and close it.