From bad7978e6fba348bbf1f290921fec0eabff8dea7 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 23 Oct 2022 15:40:56 +0200 Subject: [PATCH] small fixes --- rowers/dataroutines.py | 15 ++++++++++++++- rowers/interactiveplots.py | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/rowers/dataroutines.py b/rowers/dataroutines.py index 49fdb091..20181ada 100644 --- a/rowers/dataroutines.py +++ b/rowers/dataroutines.py @@ -1262,7 +1262,20 @@ def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True, comp try: df = pd.read_parquet(csvfilenames[0], columns=columns) rowdata, row = getrowdata(id=ids[0]) - except (OSError, ArrowInvalid, IndexError): + except (OSError, IndexError): + rowdata, row = getrowdata(id=ids[0]) + if rowdata and len(rowdata.df): # pragma: no cover + data = dataprep( + rowdata.df, id=ids[0], bands=True, otwpower=True, barchart=True) + df = pd.read_parquet(csvfilenames[0], columns=columns) + # df = dd.read_parquet(csvfilenames[0], + # column=columns,engine='pyarrow', + # ) + + # df = df.loc[:,~df.columns.duplicated()] + else: + df = pd.DataFrame() + except: rowdata, row = getrowdata(id=ids[0]) if rowdata and len(rowdata.df): # pragma: no cover data = dataprep( diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 6f8e7097..cdf5060a 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -4197,7 +4197,10 @@ def instroke_interactive_chart(df,metric, workout, spm_min, spm_max, df_plot['high'].update(df_plot.pop('high 2')) df_plot['low'].update(df_plot.pop('low 2')) - df_plot.interpolate(axis=1,inplace=True) + try: + df_plot.interpolate(axis=1,inplace=True) + except TypeError: + pass TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,crosshair' plot = Figure(plot_width=920,tools=TOOLS,