diff --git a/.gitignore b/.gitignore index 0dc8c5c9..08de68fa 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ conftest.py # temporary test files /rowers/tests/testdata/temp /rowers/tests/testdata/testdata.csv.gz +rowers/tests/testdata/testdata.csv.gz /rowers/tests/testdata/testdata.tcx diff --git a/rowers/management/commands/processalerts.py b/rowers/management/commands/processalerts.py index 08e39bcc..febfe20f 100644 --- a/rowers/management/commands/processalerts.py +++ b/rowers/management/commands/processalerts.py @@ -38,7 +38,7 @@ class Command(BaseCommand): else: testing = False - todaysalerts = Alert.objects.filter(next_run__lte = datetime.date.today(),emailalert=True) + todaysalerts = Alert.objects.filter(next_run__lt = datetime.date.today(),emailalert=True) for alert in todaysalerts: stats = alerts.alert_get_stats(alert) diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index f2af5b3c..0ea6ab5c 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -529,9 +529,14 @@ def add_workout_from_data(user,importid,data,strokedata, try: latcoord = strokedata.loc[:,'lat'] loncoord = strokedata.loc[:,'lon'] + if latcoord.std() == 0 and loncoord.std() == 0 and workouttype == 'water': + workouttype = 'rower' except: latcoord = np.zeros(nr_rows) loncoord = np.zeros(nr_rows) + if workouttype == 'water': + workouttype = 'rower' + try: @@ -747,12 +752,18 @@ def handle_strava_import_stroke_data(title, try: lat = coords[:,0] lon = coords[:,1] + if lat.std() == 0 and lon.std() == 0 and workouttype == 'water': + workouttype = 'rower' except IndexError: lat = np.zeros(len(t)) lon = np.zeros(len(t)) + if workouttype == 'water': + workouttype = 'rower' else: lat = np.zeros(len(t)) lon = np.zeros(len(t)) + if workouttype == 'water': + workouttype = 'rower' strokelength = velo*60./(spm) strokelength[np.isinf(strokelength)] = 0.0 diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz deleted file mode 100644 index e21c31ab..00000000 Binary files a/rowers/tests/testdata/testdata.csv.gz and /dev/null differ