tested
This commit is contained in:
@@ -176,6 +176,7 @@ columndict = {
|
||||
'slip': 'slip',
|
||||
'workoutstate': ' WorkoutState',
|
||||
'cumdist': 'cum_dist',
|
||||
'check_factor': 'check_factor',
|
||||
}
|
||||
|
||||
|
||||
@@ -1599,6 +1600,10 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
||||
|
||||
try:
|
||||
datadf = pl.concat(data).select(columns)
|
||||
except ColumnNotFoundError:
|
||||
datadf = pl.concat(data)
|
||||
existing_columns = [col for col in columns if col in datadf.columns]
|
||||
datadf = datadf.select(existing_columns)
|
||||
except (ShapeError, SchemaError):
|
||||
data = [
|
||||
df.select(columns)
|
||||
@@ -2302,6 +2307,16 @@ def dataplep(rowdatadf, id=0, inboard=0.88, forceunit='lbs', bands=True, barchar
|
||||
hr_bottom = 0.0*df[' HRCur (bpm)'],
|
||||
)
|
||||
|
||||
|
||||
if 'check_factor' not in df.columns:
|
||||
data = data.with_columns(
|
||||
check_factor = pl.lit(0.0),
|
||||
)
|
||||
else:
|
||||
data = data.with_columns(
|
||||
check_factor = df['check_factor'],
|
||||
)
|
||||
|
||||
if 'wash' not in df.columns:
|
||||
data = data.with_columns(
|
||||
wash = pl.lit(0.0),
|
||||
|
||||
@@ -1478,15 +1478,18 @@ class FusionMetricChoiceForm(ModelForm):
|
||||
value in self.fields['columns'].choices}
|
||||
|
||||
for label in labeldict:
|
||||
if df.loc[:, label].std() == 0:
|
||||
try:
|
||||
formaxlabels2.pop(label)
|
||||
except KeyError: # pragma: no cover
|
||||
pass
|
||||
try:
|
||||
if df.loc[:, label].std() == 0:
|
||||
try:
|
||||
formaxlabels2.pop(label)
|
||||
except KeyError: # pragma: no cover
|
||||
pass
|
||||
except KeyError: # pragma: no cover
|
||||
formaxlabels2.pop(label)
|
||||
|
||||
metricchoices = list(
|
||||
sorted(formaxlabels2.items(), key=lambda x: x[1]))
|
||||
self.fields['columns'].choices = metricchoices
|
||||
metricchoices = list(
|
||||
sorted(formaxlabels2.items(), key=lambda x: x[1]))
|
||||
self.fields['columns'].choices = metricchoices
|
||||
|
||||
|
||||
class PlannedSessionSelectForm(forms.Form):
|
||||
|
||||
@@ -1841,6 +1841,8 @@ def interactive_flex_chart2(id, r, promember=0,
|
||||
rowdata[column], 5))
|
||||
except KeyError:
|
||||
pass
|
||||
except ColumnNotFoundError:
|
||||
pass
|
||||
|
||||
if len(rowdata) < 2:
|
||||
if promember:
|
||||
@@ -1938,10 +1940,10 @@ def interactive_flex_chart2(id, r, promember=0,
|
||||
rowdata = rowdata.with_columns((pl.lit(axlabels[yparam2])).alias("yname2"))
|
||||
except (KeyError, ColumnNotFoundError): # pragma: no cover
|
||||
rowdata = rowdata.with_columns((pl.lit(yparam2)).alias("yname2"))
|
||||
|
||||
else: # pragma: no cover
|
||||
rowdata = rowdata.with_columns((pl.col("yname1")).alias("yname2"))
|
||||
|
||||
|
||||
def func(x, a, b):
|
||||
return a*x+b
|
||||
|
||||
|
||||
@@ -305,6 +305,19 @@ rowingmetrics = (
|
||||
'type': 'pro',
|
||||
'group': 'stroke'}),
|
||||
|
||||
('check_factor', {
|
||||
'numtype': 'float',
|
||||
'null': True,
|
||||
'verbose_name': 'Check Factor',
|
||||
'ax_min': 0,
|
||||
'ax_max': 100,
|
||||
'default': 0,
|
||||
'sigfigs': 1,
|
||||
'maysmooth': True,
|
||||
'mode': 'water',
|
||||
'type': 'pro',
|
||||
'group': 'stroke'}),
|
||||
|
||||
|
||||
('effectiveangle', {
|
||||
'numtype': 'float',
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user