tested
This commit is contained in:
@@ -176,6 +176,7 @@ columndict = {
|
|||||||
'slip': 'slip',
|
'slip': 'slip',
|
||||||
'workoutstate': ' WorkoutState',
|
'workoutstate': ' WorkoutState',
|
||||||
'cumdist': 'cum_dist',
|
'cumdist': 'cum_dist',
|
||||||
|
'check_factor': 'check_factor',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1599,6 +1600,10 @@ def read_data(columns, ids=[], doclean=True, workstrokesonly=True, debug=False,
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
datadf = pl.concat(data).select(columns)
|
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):
|
except (ShapeError, SchemaError):
|
||||||
data = [
|
data = [
|
||||||
df.select(columns)
|
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)'],
|
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:
|
if 'wash' not in df.columns:
|
||||||
data = data.with_columns(
|
data = data.with_columns(
|
||||||
wash = pl.lit(0.0),
|
wash = pl.lit(0.0),
|
||||||
|
|||||||
@@ -1478,15 +1478,18 @@ class FusionMetricChoiceForm(ModelForm):
|
|||||||
value in self.fields['columns'].choices}
|
value in self.fields['columns'].choices}
|
||||||
|
|
||||||
for label in labeldict:
|
for label in labeldict:
|
||||||
if df.loc[:, label].std() == 0:
|
try:
|
||||||
try:
|
if df.loc[:, label].std() == 0:
|
||||||
formaxlabels2.pop(label)
|
try:
|
||||||
except KeyError: # pragma: no cover
|
formaxlabels2.pop(label)
|
||||||
pass
|
except KeyError: # pragma: no cover
|
||||||
|
pass
|
||||||
|
except KeyError: # pragma: no cover
|
||||||
|
formaxlabels2.pop(label)
|
||||||
|
|
||||||
metricchoices = list(
|
metricchoices = list(
|
||||||
sorted(formaxlabels2.items(), key=lambda x: x[1]))
|
sorted(formaxlabels2.items(), key=lambda x: x[1]))
|
||||||
self.fields['columns'].choices = metricchoices
|
self.fields['columns'].choices = metricchoices
|
||||||
|
|
||||||
|
|
||||||
class PlannedSessionSelectForm(forms.Form):
|
class PlannedSessionSelectForm(forms.Form):
|
||||||
|
|||||||
@@ -1841,6 +1841,8 @@ def interactive_flex_chart2(id, r, promember=0,
|
|||||||
rowdata[column], 5))
|
rowdata[column], 5))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
except ColumnNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
if len(rowdata) < 2:
|
if len(rowdata) < 2:
|
||||||
if promember:
|
if promember:
|
||||||
@@ -1938,10 +1940,10 @@ def interactive_flex_chart2(id, r, promember=0,
|
|||||||
rowdata = rowdata.with_columns((pl.lit(axlabels[yparam2])).alias("yname2"))
|
rowdata = rowdata.with_columns((pl.lit(axlabels[yparam2])).alias("yname2"))
|
||||||
except (KeyError, ColumnNotFoundError): # pragma: no cover
|
except (KeyError, ColumnNotFoundError): # pragma: no cover
|
||||||
rowdata = rowdata.with_columns((pl.lit(yparam2)).alias("yname2"))
|
rowdata = rowdata.with_columns((pl.lit(yparam2)).alias("yname2"))
|
||||||
|
|
||||||
else: # pragma: no cover
|
else: # pragma: no cover
|
||||||
rowdata = rowdata.with_columns((pl.col("yname1")).alias("yname2"))
|
rowdata = rowdata.with_columns((pl.col("yname1")).alias("yname2"))
|
||||||
|
|
||||||
|
|
||||||
def func(x, a, b):
|
def func(x, a, b):
|
||||||
return a*x+b
|
return a*x+b
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,19 @@ rowingmetrics = (
|
|||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'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', {
|
('effectiveangle', {
|
||||||
'numtype': 'float',
|
'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