def readfile(huc12, filename): """Make me a df please""" df = read_yld(filename) if df.empty: return None df['huc12'] = huc12 df['fpath'] = filename.split("/")[-1].split("_")[-1].split(".")[0] return df
def readfile(huc12, filename): """Make me a df please""" df = read_yld(filename) if df.empty: return None df["huc12"] = huc12 df["fpath"] = filename.split("/")[-1].split("_")[-1].split(".")[0] return df
def readfile(huc12, filename): """Make me a df please""" df = read_yld(filename) if len(df.index) == 0: return None df['huc12'] = huc12 df['fpath'] = filename.split("/")[-1].split("_")[-1].split(".")[0] return df
def test_yld(): """Read a slope file""" df = dep.read_yld(get_path('yld.txt')) assert len(df.index) == 10 assert abs(df['yield_kgm2'].max() - 0.93) < 0.01
def test_yld(self): """Read a slope file""" df = dep.read_yld(get_path('yld.txt')) self.assertEquals(len(df.index), 10) self.assertAlmostEquals(df['yield_kgm2'].max(), 0.93, 2)
def test_yld(): """Read a slope file""" df = dep.read_yld(get_path('yld.txt')) assert len(df.index) == 10 assert abs(df['yield_kgm2'].max() - 0.93) < 0.01