Skip to content

Commit

Permalink
adjust to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Griesfeller committed May 7, 2024
1 parent 7d43be4 commit 5719526
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pyaro_readers/nilupmfebas/ebas_nasa_ames.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ def read_file(
lc = 0 # line counter
dc = 0 # data block line counter
mc = 0 # meta block counter
END_VAR_DEF = np.nan # will be set (info stored in header)
IN_DATA = False
end_var_def = np.nan # will be set (info stored in header)
in_data = False
data = []
self.file = nasa_ames_file
try:
Expand All @@ -647,7 +647,7 @@ def read_file(
return

for line in lines:
if IN_DATA: # in data block (end of file)
if in_data: # in data block (end of file)
try:
data.append(tuple(float(x.strip()) for x in line.strip().split()))
except Exception as e:
Expand Down Expand Up @@ -676,18 +676,18 @@ def read_file(
logger.warning(msg)
else: # behind header section and before data definition (contains column defs and meta info)
if mc == 0: # still in column definition
END_VAR_DEF = self._NUM_FIXLINES + self.num_cols_dependent - 1
end_var_def = self._NUM_FIXLINES + self.num_cols_dependent - 1
NUM_HEAD_LINES = self.num_head_lines
try:
self.var_defs.append(self._read_vardef_line(line))
except Exception as e:
logger.warning(repr(e))

elif lc < END_VAR_DEF:
elif lc < end_var_def:
self.var_defs.append(self._read_vardef_line(line))

elif lc == NUM_HEAD_LINES - 1:
IN_DATA = True
in_data = True
self._data_header = h = [x.strip() for x in line.split()]
# append information of first two columns to variable
# definition array.
Expand All @@ -706,7 +706,7 @@ def read_file(
if only_head:
return
logger.debug("REACHED DATA BLOCK")
elif lc >= END_VAR_DEF + 2:
elif lc >= end_var_def + 2:
try:
name, val = line.split(
":", 1
Expand Down

0 comments on commit 5719526

Please sign in to comment.