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

another horrible hack to support old pandas version, more test debugging

parent 421b393a
No related branches found
No related tags found
No related merge requests found
......@@ -260,7 +260,11 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20, i0=0,
for db, base_name in zip(db_dir_tags, base_name_tags):
turb_db_dirs = df[db] + df[base_name]
# When set to None, the DataFrame will have text as None
turb_db_src = turb_db_dirs[turb_db_dirs.str.find('None')==-1]
# FIXME: CI runner has and old pandas version
try:
turb_db_src = turb_db_dirs[turb_db_dirs.str.find('None')==-1]
except AttributeError:
turb_db_src = turb_db_dirs[turb_db_dirs.str.findall('None')==-1]
pbs += '\n'
pbs += '# copy to scratch db directory for %s, %s\n' % (db, base_name)
for k in turb_db_src.unique():
......
......@@ -121,13 +121,17 @@ class Tests(unittest.TestCase):
df_data, units = res.load_pwr_df(fname)
data = np.loadtxt(fname)
self.assertEqual(data.shape, df_data.shape)
print(fname)
print(data.dtype)
print(df_data.values.dtype)
for i in range(data.shape[0]):
a = data[i,:]
b = df_data.values[i,:]
if not np.allclose(a,b):
print(i)
print(a-b)
print(a)
print(b)
np.testing.assert_almost_equal(a, b)
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