From 96fc5282662692f8591c1bb6800fadd09ac35ecd Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Tue, 1 Aug 2023 09:32:12 +0000 Subject: [PATCH] Adjust echem subsampling --- pydatalab/pydatalab/blocks/echem_block.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pydatalab/pydatalab/blocks/echem_block.py b/pydatalab/pydatalab/blocks/echem_block.py index cc23eddc5..0e6ace7dd 100644 --- a/pydatalab/pydatalab/blocks/echem_block.py +++ b/pydatalab/pydatalab/blocks/echem_block.py @@ -352,8 +352,9 @@ def plot_cycle(self): use_normalized_capacity=bool(characteristic_mass_g), ) - # Reduce df size to 100 points per cycle by default - df = reduce_echem_cycle_sampling(df, num_samples=100) + # Reduce df size to 100 points per cycle by default if there are more than a 100k points + if len(df) > 1e5: + df = reduce_echem_cycle_sampling(df, num_samples=100) layout = bokeh_plots.double_axes_echem_plot( df, cycle_summary=cycle_summary_df, mode=mode, normalized=bool(characteristic_mass_g)