Skip to content
Snippets Groups Projects
Commit e64d0076 authored by David Verelst's avatar David Verelst
Browse files

revert previous commit, debugging why test on runner is not passing

parent 8a5c9d5b
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ class dummy(object):
regex_units = re.compile('(\\[.*?\\])')
def ReadFileHAWCStab2Header(fname, dtype=None):
def ReadFileHAWCStab2Header(fname):
"""
Read a file with a weird HAWCStab2 header that starts with a #, and
includes the column number and units between square brackets.
......@@ -79,7 +79,7 @@ def ReadFileHAWCStab2Header(fname, dtype=None):
# and another with frozen wake assumption
columns = get_col_names(line_header, colwidths)
df = pd.read_fwf(fname, widths=colwidths, comment='#', header=None,
names=columns, dtype=dtype)
names=columns)
units = regex_units.findall(''.join(columns))
return df, units
......@@ -155,8 +155,8 @@ class results(object):
return res
def load_pwr_df(self, fname, dtype=None):
return ReadFileHAWCStab2Header(fname, dtype=dtype)
def load_pwr_df(self, fname):
return ReadFileHAWCStab2Header(fname)
def load_cmb(self, fname):
# aero-(servo)-elastic results for HS2>=2.14 have real_eig as 3th set
......
......@@ -121,6 +121,10 @@ class Tests(unittest.TestCase):
df_data, units = res.load_pwr_df(fname, dtype=np.float32)
data = np.loadtxt(fname, dtype=np.float32)
self.assertEqual(data.shape, df_data.shape)
print(data.dtype)
print(data.values.dtype)
print(data)
print(data.values)
np.testing.assert_almost_equal(data, df_data.values, decimal=6)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment