Private
Public Access
1
0

hotfix - check for nan in dataprep windowsize

f could get value NaN. Added is not np.isinf()
This commit is contained in:
Sander Roosendaal
2017-10-31 07:48:41 +01:00
parent cd5daedb39
commit 0949b3cec9

View File

@@ -1,23 +1,26 @@
# All the data preparation, data cleaning and data mangling should
# be defined here
from rowers.models import Workout, User, Rower, StrokeData
from rowers.models import Workout, StrokeData,Team
import pytz
from rowingdata import rowingdata as rrdata
from rowers.tasks import handle_sendemail_unrecognized
from rowers.tasks import handle_zip_file
import pytz
from rowingdata import rower as rrower
from rowingdata import main as rmain
from rowingdata import get_file_type, get_empower_rigging
from rowers.tasks import handle_sendemail_unrecognized
from rowers.tasks import handle_zip_file
from pandas import DataFrame, Series
from pytz import timezone as tz, utc
from django.utils import timezone
from time import strftime, strptime, mktime, time, daylight
import arrow
from django.utils.timezone import get_current_timezone
from time import strftime
import arrow
thetimezone = get_current_timezone()
from rowingdata import (
TCXParser, RowProParser, ErgDataParser,
@@ -30,7 +33,6 @@ from rowingdata import (
summarydata, get_file_type,
)
from rowers.models import Team
from rowers.metrics import axes
from async_messages import messages as a_messages
import os
@@ -52,7 +54,6 @@ import sys
import utils
import datautils
from utils import lbstoN
from scipy.interpolate import griddata
from timezonefinder import TimezoneFinder
@@ -1704,7 +1705,7 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
rhythm = 0.0 * forceratio
f = rowdatadf['TimeStamp (sec)'].diff().mean()
if f != 0:
if f != 0 and not np.isinf(f):
windowsize = 2 * (int(10. / (f))) + 1
else:
windowsize = 1