Commit 818eebb5 authored by Mikkel Friis-Møller's avatar Mikkel Friis-Møller
Browse files

maybe fix of failing empty line problem in dlc highlevel

parent 001554cf
......@@ -100,6 +100,7 @@ class DLCHighLevel(object):
self.dlc_df = pd.read_excel(self.filename, sheetname='DLC', skiprows=[1])
# empty strings are now nans, convert back to empty strings
self.dlc_df.fillna('', inplace=True)
self.dlc_df.fillna('\n', inplace=True)
# force headers to lower case
self.dlc_df.columns = [k.lower() for k in self.dlc_df.columns]
if 'dlc' not in self.dlc_df.columns and 'name' in self.dlc_df.columns:
......
......@@ -31,7 +31,6 @@ class TestDLCHighLevel(unittest.TestCase):
def test_sensor_info_filter(self):
self.assertEqual(list(self.dlc_hl.sensor_info(['fatigue']).m), [4, 4, 10])
def test_fatigue_distribution_pct(self):
dlc, wsp, wdir = self.dlc_hl.fatigue_distribution()['12']
self.assertEqual(dlc[12], 0.975)
......@@ -46,6 +45,9 @@ class TestDLCHighLevel(unittest.TestCase):
self.assertEqual(max(wsp.keys()), 25)
self.assertEqual(wsp[4], "#1000")
def test_fatigue_distribution_empty_line(self):
self.dlc_hl.dlc_df['load']
def test_file_hour_lst(self):
f, h = self.dlc_hl.file_hour_lst()[0]
self.assertEqual(os.path.abspath(f), os.path.abspath(testfilepath + 'res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment