def test_parse_data_column_info(self): header_s = 'This is an header' df = pd.DataFrame({'col1': [1, 2, 3], 'col2': [1, 2, 3], 'col3': [1, 2, 3]}) data_s = '\n1;1;1\n2;2;2\n3;3;3' sep = ';' df_parsed = bore.parse_data_column_info(header_s, data_s, sep, 3, columns_info=['col1', 'col2', 'col3']) assert_frame_equal(df_parsed, df)
def test_data_soil_quantified(self): lst = [[0, 0.05, 0.95, 0, 0, 0], [0, 0.05, 0.95, 0, 0, 0]] df = pd.DataFrame( lst, columns=["Gravel", "Sand", "Clay", "Loam", "Peat", "Silt"], dtype=float) data_s = [["'Kz'", "''"], ["'Kz1'", "''"]] df_parsed = ParseBORE.data_soil_quantified(data_s) assert_frame_equal(df_parsed, df)
def test_data_soil_quantified(self): lst = [[0, 0.05, 0.95, 0, 0, 0], [0, 0.05, 0.95, 0, 0, 0]] df = pd.DataFrame( lst, columns=['Gravel', 'Sand', 'Clay', 'Loam', 'Peat', 'Silt'], dtype=float) data_s = [["'Kz'", "''"], ["'Kz1'", "''"]] df_parsed = ParseBORE.data_soil_quantified(data_s) assert_frame_equal(df_parsed, df)
def test_parse_data_soil_type(self): df = pd.DataFrame({ 'Soil_type': [ 'clay 100% with sand', 'clay 95% with sand 5%', 'clay 90% with sand 10%' ] }) data_s = [["'Kz'", "''"], ["'Kz1'", "''"], ["'Kz2'", "''"]] df_parsed = ParseBORE.parse_data_soil_type(pd.DataFrame({}), data_s) assert_frame_equal(df_parsed, df)
def test_parse_data_column_info(self): header_s = "This is an header" df = pd.DataFrame({ "col1": [1, 2, 3], "col2": [1, 2, 3], "col3": [1, 2, 3] }) data_s = "\n1;1;1\n2;2;2\n3;3;3" sep = ";" df_parsed = ParseBORE.parse_data_column_info( header_s, data_s, sep, 3, columns_info=["col1", "col2", "col3"]) assert_frame_equal(df_parsed, df)
def test_parse_add_info_as_string(self): df = pd.DataFrame({ 'additional_info': [ 'spoor schelpmateriaal <1%|', 'dark olive-red|', 'keileem|Formatie van Drente|' ] }) data_s = [["'Kz'", "'SCH1'", "''"], ["'Kz1'", "'DO TOL RO'", "''"], ["'Kz2'", "'KEL DR'", "''"]] df_parsed = ParseBORE.parse_add_info_as_string(pd.DataFrame({}), data_s) assert_frame_equal(df_parsed, df)
def test_parse_add_info_as_string(self): df = pd.DataFrame({ "remarks": [ "1) spoor schelpmateriaal <1% ", "1) dark olive-red ", "1) keileem Formatie van Drente ", ] }) data_s = [ ["'Kz'", "'SCH1'", "''"], ["'Kz1'", "'DO TOL RO'", "''"], ["'Kz2'", "'KEL DR'", "''"], ] df_parsed = ParseBORE.parse_add_info_as_string(pd.DataFrame({}), data_s) assert_frame_equal(df_parsed, df)
def test_parse_data_soil_code(self): df = pd.DataFrame({"Soil_code": ["Kz", "Kz1", "Kz2"]}) data_s = [["'Kz'", "''"], ["'Kz1'", "''"], ["'Kz2'", "''"]] df_parsed = ParseBORE.parse_data_soil_code(pd.DataFrame({}), data_s) assert_frame_equal(df_parsed, df)
def test_parse_data_soil_code(self): df = pd.DataFrame({'Soil_code': ['Kz', 'Kz1', 'Kz2']}) data_s = [["'Kz'", "''"], ["'Kz1'", "''"], ["'Kz2'", "''"]] df_parsed = bore.parse_data_soil_code(data_s) assert_frame_equal(df_parsed, df)