Skip to content

Commit

Permalink
Merge branch 'stable-1.x' into bloody
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqdaouda committed Nov 25, 2014
2 parents 1ff2c7b + 8c43751 commit e19c993
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 133 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.7
=====

* BUG FIX: looping through CSV lines now works
* Added tests for CSV

1.1.6
=====

Expand Down
2 changes: 1 addition & 1 deletion pyGeno/pyGenoObjectBases.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def flushIndexes(cls) :
def help(cls) :
"""Returns a list of available field for queries. Ex
Transcript.help()"""
return cls._wrapped_class.help()
return cls._wrapped_class.help().replace("_Raba", "")

@classmethod
def ensureGlobalIndex(cls, fields) :
Expand Down
128 changes: 0 additions & 128 deletions pyGeno/tests/tests.py

This file was deleted.

9 changes: 7 additions & 2 deletions pyGeno/tools/parsers/CSVTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self, csvFile, lineNumber = None) :
self.data = []
if lineNumber != None :
self.lineNumber = lineNumber

tmpL = csvFile.lines[lineNumber].replace('\r', '\n').replace('\n', '')
tmpData = tmpL.split(csvFile.separator)

Expand All @@ -91,7 +92,11 @@ def __init__(self, csvFile, lineNumber = None) :

def __getitem__(self, key) :
"""Returns the value of field 'key'"""
return self.data[self.csvFile.legend[key.lower()]]
try :
indice = self.csvFile.legend[key.lower()]
except KeyError :
raise KeyError("CSV File has no column: '%s'" % key)
return self.data[indice]

def __setitem__(self, key, value) :
"""Sets the value of field 'key' to 'value' """
Expand Down Expand Up @@ -209,7 +214,7 @@ def next(self) :
self.currentPos += 1
if self.currentPos >= len(self) :
raise StopIteration
return CSVEntry(self, self[self.currentPos])
return CSVEntry(self, self.currentPos)

def __getitem__(self, line) :
if self.lines[line].__class__ is not CSVEntry :
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
setup(
name='pyGeno',

version='1.1.6',
version='1.1.7',

description='A python package for Personalized Proteogenomics',
long_description=long_description,
Expand All @@ -21,7 +21,7 @@
author='Tariq Daouda',
author_email='[email protected]',

test_suite="pyGeno.tests.tests",
test_suite="pyGeno.tests",

license='ApacheV2.0',

Expand Down

0 comments on commit e19c993

Please sign in to comment.