Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects

Resolve "SDDSParser has difficulties with OPAL 1.6 stat files"

1 file
+ 13
8
Compare changes
  • Side-by-side
  • Inline
+ 13
8
@@ -22,12 +22,19 @@ class SDDSParser:
# parse header
if version >= 10900:
self._parseHeader1_9(filename)
self._separator = '\s+'
else:
self._parseHeader1_6(filename)
# prevents a bug(?) pd.read_csv
# \s+\t should be equivalent but force the python engine
# it seems the 'c' engine has problems with trailing whitespace in the header strings
# and returns an empty dataset
self._separator = '\s+\t'
# read data
self._dataset = pd.read_csv(filename, skiprows=self._nRows, sep='\s+',
names=self._units.keys(), index_col=False)
self._dataset = pd.read_csv(filename, skiprows=self._nRows,
sep=self._separator,
names=list(self._units.keys()), index_col=False)
def _checkVersion(self, filename):
@@ -64,22 +71,20 @@ class SDDSParser:
if 'SDDS' in line:
continue
elif 'column' in line:
self._nRows += 1
obj = re.match(column_pattern, line)
variable = obj.group(1)
self._units[variable] = obj.group(3)
self._desc[variable] = self.__removeNumber(obj.group(4))
elif 'parameter' in line:
self._nRows += 1
self._nParameters += 1
elif 'description' in line:
self._nRows += 1
continue
elif 'data' in line:
self._nRows += 1
continue
else:
self._nRows += self._nParameters - 1
self._nRows += 1 # there is one more line (with git revision)
break
def _parseHeader1_9(self, filename):
with open(filename) as f:
Loading