Rename kwargs and add tests
This commit is contained in:
+99
-42
@@ -312,6 +312,63 @@ data_stream_flag_size = [
|
||||
["ALL STATES", "513.38", "436.02", "-", "25.57", "51.06", "14.18", "-", "8.21", "11.83", "11.08"]
|
||||
]
|
||||
|
||||
data_stream_strip_text = [
|
||||
["V i n s a u Ve r r e", ""],
|
||||
["Les Blancs", "12.5CL"],
|
||||
["A.O.P Côtes du Rhône", ""],
|
||||
["Domaine de la Guicharde « Autour de la chapelle » 2016", "8 €"],
|
||||
["A.O.P Vacqueyras", ""],
|
||||
["Domaine de Montvac « Melodine » 2016", "10 €"],
|
||||
["A.O.P Châteauneuf du Pape", ""],
|
||||
["Domaine de Beaurenard 2017", "13 €"],
|
||||
["A.O.P Côteaux du Languedoc", ""],
|
||||
["Villa Tempora « Un temps pour elle » 2014", "9 €"],
|
||||
["A.O.P Côtes de Provence", ""],
|
||||
["Château Grand Boise 2017", "9 €"],
|
||||
["Les Rosés", "12,5 CL"],
|
||||
["A.O.P Côtes du Rhône", ""],
|
||||
["Domaine de la Florane « A fleur de Pampre » 2016", "8 €"],
|
||||
["Famille Coulon (Domaine Beaurenard) Biotifulfox 2017", "8 €"],
|
||||
["A.O.P Vacqueyras", ""],
|
||||
["Domaine de Montvac 2017", "9 €"],
|
||||
["A.O.P Languedoc", ""],
|
||||
["Domaine de Joncas « Nébla » 2015", "8 €"],
|
||||
["Villa Tempora « L’arroseur arrosé » 2015", "9 €"],
|
||||
["A.O.P Côtes de Provence", ""],
|
||||
["Château Grand Boise « Sainte Victoire » 2017", "9 €"],
|
||||
["Château Léoube 2016", "10 €"]
|
||||
]
|
||||
|
||||
data_stream_edge_tol = [
|
||||
["Key figures", ""],
|
||||
["", "2016"],
|
||||
["(all amounts in EUR)", ""],
|
||||
["C\nlass A", ""],
|
||||
["N\net Asset Value at 31 December", "5,111,372"],
|
||||
["N\number of outstanding units at 31 December", "49,136"],
|
||||
["N\net Asset Value per unit at 31 December", "104.03"],
|
||||
["C\nlass B", ""],
|
||||
["N\net Asset Value at 31 December", "49,144,825"],
|
||||
["N\number of outstanding units at 31 December", "471,555"],
|
||||
["N\net Asset Value per unit at 31 December", "104.22"],
|
||||
["T\notal for the Fund", ""],
|
||||
["N\net Asset Value at 31 December", "54,256,197"],
|
||||
["N\number of outstanding units at 31 December", "520,691"],
|
||||
["I\nnvestment result", ""],
|
||||
["Direct result", "-"],
|
||||
["Revaluation", "2,076,667"],
|
||||
["Costs", "(106,870)"],
|
||||
["T\notal investment result for the period1", "1,969,797"],
|
||||
["I\nnvestment result per unit2", ""],
|
||||
["Direct result", "-"],
|
||||
["Revaluation", "3.99"],
|
||||
["Costs", "(0.21)"],
|
||||
["T\notal investment result per unit", "3.78"],
|
||||
["1 The results cover the period from inception of the Fund at 8 April 2016 through 31 December 2016.", ""],
|
||||
["2 The result per unit is calculated using the total number of outstanding unit as per the end of the", ""],
|
||||
["period.", ""]
|
||||
]
|
||||
|
||||
data_lattice = [
|
||||
["Cycle \nName", "KI \n(1/km)", "Distance \n(mi)", "Percent Fuel Savings", "", "", ""],
|
||||
["", "", "", "Improved \nSpeed", "Decreased \nAccel", "Eliminate \nStops", "Decreased \nIdle"],
|
||||
@@ -485,49 +542,49 @@ data_lattice_shift_text_right_bottom = [
|
||||
]
|
||||
|
||||
data_arabic = [
|
||||
['ً\n\xa0\nﺎﺒﺣﺮﻣ', 'ﻥﺎﻄﻠﺳ\xa0ﻲﻤﺳﺍ'],
|
||||
['ﻝﺎﻤﺸﻟﺍ\xa0ﺎﻨﻴﻟﻭﺭﺎﻛ\xa0ﺔﻳﻻﻭ\xa0ﻦﻣ\xa0ﺎﻧﺍ', '؟ﺖﻧﺍ\xa0ﻦﻳﺍ\xa0ﻦﻣ'],
|
||||
['1234', 'ﻂﻄﻗ\xa047\xa0ﻱﺪﻨﻋ'],
|
||||
['؟ﻙﺎﺒﺷ\xa0ﺖﻧﺍ\xa0ﻞﻫ', 'ﺔﻳﺰﻴﻠﺠﻧﻻﺍ\xa0ﻲﻓ\xa0Jeremy\xa0ﻲﻤﺳﺍ'],
|
||||
['Jeremy\xa0is\xa0ﻲﻣﺮﺟ\xa0in\xa0Arabic', '']
|
||||
["ً\n\xa0\nﺎﺒﺣﺮﻣ", "ﻥﺎﻄﻠﺳ\xa0ﻲﻤﺳﺍ"],
|
||||
["ﻝﺎﻤﺸﻟﺍ\xa0ﺎﻨﻴﻟﻭﺭﺎﻛ\xa0ﺔﻳﻻﻭ\xa0ﻦﻣ\xa0ﺎﻧﺍ", "؟ﺖﻧﺍ\xa0ﻦﻳﺍ\xa0ﻦﻣ"],
|
||||
["1234", "ﻂﻄﻗ\xa047\xa0ﻱﺪﻨﻋ"],
|
||||
["؟ﻙﺎﺒﺷ\xa0ﺖﻧﺍ\xa0ﻞﻫ", "ﺔﻳﺰﻴﻠﺠﻧﻻﺍ\xa0ﻲﻓ\xa0Jeremy\xa0ﻲﻤﺳﺍ"],
|
||||
["Jeremy\xa0is\xa0ﻲﻣﺮﺟ\xa0in\xa0Arabic", ""]
|
||||
]
|
||||
|
||||
data_stream_layout_kwargs = [
|
||||
['V i n s a u Ve r r e', ''],
|
||||
['Les Blancs', '12.5CL'],
|
||||
['A.O.P Côtes du Rhône', ''],
|
||||
['Domaine de la Guicharde « Autour de la chapelle » 2016', '8 €'],
|
||||
['A.O.P Vacqueyras', ''],
|
||||
['Domaine de Montvac « Melodine » 2016', '10 €'],
|
||||
['A.O.P Châteauneuf du Pape', ''],
|
||||
['Domaine de Beaurenard 2017', '13 €'],
|
||||
['A.O.P Côteaux du Languedoc', ''],
|
||||
['Villa Tempora « Un temps pour elle » 2014', '9 €'],
|
||||
['A.O.P Côtes de Provence', ''],
|
||||
['Château Grand Boise 2017', '9 €'],
|
||||
['Les Rosés', '12,5 CL'],
|
||||
['A.O.P Côtes du Rhône', ''],
|
||||
['Domaine de la Florane « A fleur de Pampre » 2016', '8 €'],
|
||||
['Famille Coulon (Domaine Beaurenard) Biotifulfox 2017', '8 €'],
|
||||
['A.O.P Vacqueyras', ''],
|
||||
['Domaine de Montvac 2017', '9 €'],
|
||||
['A.O.P Languedoc', ''],
|
||||
['Domaine de Joncas « Nébla » 2015', '8 €'],
|
||||
['Villa Tempora « L’arroseur arrosé » 2015', '9 €'],
|
||||
['A.O.P Côtes de Provence', ''],
|
||||
['Château Grand Boise « Sainte Victoire » 2017', '9 €'],
|
||||
['Château Léoube 2016', '10 €'],
|
||||
['Les Rouges', '12,CL'],
|
||||
['A.O.P Côtes du Rhône', ''],
|
||||
['Domaine de Dionysos « La Cigalette »', '8 €'],
|
||||
['Château Saint Estève d’Uchaux « Grande Réserve » 2014', '9 €'],
|
||||
['Domaine de la Guicharde « Cuvée Massillan » 2016', '9 €'],
|
||||
['Domaine de la Florane « Terre Pourpre » 2014', '10 €'],
|
||||
['L’Oratoire St Martin « Réserve des Seigneurs » 2015', '11 €'],
|
||||
['A.O.P Saint Joseph', ''],
|
||||
['Domaine Monier Perréol « Châtelet » 2015', '13 €'],
|
||||
['A.O.P Châteauneuf du Pape', ''],
|
||||
['Domaine de Beaurenard 2011', '15 €'],
|
||||
['A.O.P Cornas', ''],
|
||||
['Domaine Lionnet « Terre Brûlée » 2012', '15 €']
|
||||
["V i n s a u Ve r r e", ""],
|
||||
["Les Blancs", "12.5CL"],
|
||||
["A.O.P Côtes du Rhône", ""],
|
||||
["Domaine de la Guicharde « Autour de la chapelle » 2016", "8 €"],
|
||||
["A.O.P Vacqueyras", ""],
|
||||
["Domaine de Montvac « Melodine » 2016", "10 €"],
|
||||
["A.O.P Châteauneuf du Pape", ""],
|
||||
["Domaine de Beaurenard 2017", "13 €"],
|
||||
["A.O.P Côteaux du Languedoc", ""],
|
||||
["Villa Tempora « Un temps pour elle » 2014", "9 €"],
|
||||
["A.O.P Côtes de Provence", ""],
|
||||
["Château Grand Boise 2017", "9 €"],
|
||||
["Les Rosés", "12,5 CL"],
|
||||
["A.O.P Côtes du Rhône", ""],
|
||||
["Domaine de la Florane « A fleur de Pampre » 2016", "8 €"],
|
||||
["Famille Coulon (Domaine Beaurenard) Biotifulfox 2017", "8 €"],
|
||||
["A.O.P Vacqueyras", ""],
|
||||
["Domaine de Montvac 2017", "9 €"],
|
||||
["A.O.P Languedoc", ""],
|
||||
["Domaine de Joncas « Nébla » 2015", "8 €"],
|
||||
["Villa Tempora « L’arroseur arrosé » 2015", "9 €"],
|
||||
["A.O.P Côtes de Provence", ""],
|
||||
["Château Grand Boise « Sainte Victoire » 2017", "9 €"],
|
||||
["Château Léoube 2016", "10 €"],
|
||||
["Les Rouges", "12,CL"],
|
||||
["A.O.P Côtes du Rhône", ""],
|
||||
["Domaine de Dionysos « La Cigalette »", "8 €"],
|
||||
["Château Saint Estève d’Uchaux « Grande Réserve » 2014", "9 €"],
|
||||
["Domaine de la Guicharde « Cuvée Massillan » 2016", "9 €"],
|
||||
["Domaine de la Florane « Terre Pourpre » 2014", "10 €"],
|
||||
["L’Oratoire St Martin « Réserve des Seigneurs » 2015", "11 €"],
|
||||
["A.O.P Saint Joseph", ""],
|
||||
["Domaine Monier Perréol « Châtelet » 2015", "13 €"],
|
||||
["A.O.P Châteauneuf du Pape", ""],
|
||||
["Domaine de Beaurenard 2011", "15 €"],
|
||||
["A.O.P Cornas", ""],
|
||||
["Domaine Lionnet « Terre Brûlée » 2012", "15 €"]
|
||||
]
|
||||
|
||||
Executable
BIN
Binary file not shown.
+17
-1
@@ -81,7 +81,7 @@ def test_stream_columns():
|
||||
|
||||
filename = os.path.join(testdir, "mexican_towns.pdf")
|
||||
tables = camelot.read_pdf(
|
||||
filename, flavor="stream", columns=["67,180,230,425,475"], row_close_tol=10)
|
||||
filename, flavor="stream", columns=["67,180,230,425,475"], row_tol=10)
|
||||
assert df.equals(tables[0].df)
|
||||
|
||||
|
||||
@@ -102,6 +102,22 @@ def test_stream_flag_size():
|
||||
assert df.equals(tables[0].df)
|
||||
|
||||
|
||||
def test_stream_strip_text():
|
||||
df = pd.DataFrame(data_stream_strip_text)
|
||||
|
||||
filename = os.path.join(testdir, "detect_vertical_false.pdf")
|
||||
tables = camelot.read_pdf(filename, flavor="stream", strip_text="\n")
|
||||
assert df.equals(tables[0].df)
|
||||
|
||||
|
||||
def test_stream_edge_tol():
|
||||
df = pd.DataFrame(data_stream_edge_tol)
|
||||
|
||||
filename = os.path.join(testdir, "edge_tolerance.pdf")
|
||||
tables = camelot.read_pdf(filename, flavor="stream", edge_tol=500)
|
||||
assert df.equals(tables[0].df)
|
||||
|
||||
|
||||
def test_stream_layout_kwargs():
|
||||
df = pd.DataFrame(data_stream_layout_kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user