diff --git a/forest/oak/base.py b/forest/oak/base.py index fcb02f81..d5925613 100644 --- a/forest/oak/base.py +++ b/forest/oak/base.py @@ -528,7 +528,7 @@ def run_hourly( cadence_temp = cadence_bout[t_hours_pd == t_unique] cadence_temp = cadence_temp[cadence_temp > 0] # store hourly metrics - if math.isnan(steps_hourly[ind_to_store]): + if math.isnan(steps_hourly[ind_to_store].item()): steps_hourly[ind_to_store] = int(np.sum(cadence_temp)) walkingtime_hourly[ind_to_store] = len(cadence_temp) else: @@ -613,11 +613,11 @@ def run(study_folder: str, output_folder: str, tz_str: Optional[str] = None, frequency == Frequency.HOURLY_AND_DAILY or frequency == Frequency.HOURLY ): - freq = 'H' + freq = 'h' elif frequency == Frequency.MINUTE: - freq = 'T' + freq = 'min' else: - freq = str(frequency.value/60) + 'H' + freq = str(frequency.value/60) + 'h' days_hourly = pd.date_range(date_start, date_end+timedelta(days=1), freq=freq)[:-1] diff --git a/forest/oak/tests/test_run_hourly.py b/forest/oak/tests/test_run_hourly.py index 242b52bd..3c392655 100644 --- a/forest/oak/tests/test_run_hourly.py +++ b/forest/oak/tests/test_run_hourly.py @@ -23,7 +23,7 @@ def sample_run_input(signal_bout): t_ind_pydate = pd.date_range( start='2020-02-24 00:00:00', end='2020-02-25 23:00:00', - freq='H', + freq='h', tz='US/Eastern' ).to_pydatetime() cadence_bout = np.array(