Skip to content

Commit

Permalink
Merge branch 'develop' into beiwe-taskrunner
Browse files Browse the repository at this point in the history
hackdna authored Dec 12, 2023
2 parents 6f3b70c + 416cdef commit f8390ab
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion forest/constants.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@

class Frequency(Enum):
"""This class enumerates possible frequencies for summary data."""
MINUTELY = 1
MINUTE = 1
HOURLY = 60
THREE_HOURLY = 3 * 60
SIX_HOURLY = 6 * 60
4 changes: 2 additions & 2 deletions forest/jasmine/traj2stats.py
Original file line number Diff line number Diff line change
@@ -1125,7 +1125,7 @@ def gps_summaries(
ValueError: Frequency is not valid
"""

if frequency in [Frequency.HOURLY_AND_DAILY, Frequency.MINUTELY]:
if frequency in [Frequency.HOURLY_AND_DAILY, Frequency.MINUTE]:
raise ValueError(f"Frequency cannot be {frequency.name.lower()}.")

if frequency != Frequency.DAILY:
@@ -1600,7 +1600,7 @@ def gps_stats_main(
ValueError: Frequency is not valid
"""
# no minutely analysis on GPS data
if frequency == Frequency.MINUTELY:
if frequency == Frequency.MINUTE:
raise ValueError("Frequency cannot be minutely.")

if parameters is None:
4 changes: 2 additions & 2 deletions forest/oak/base.py
Original file line number Diff line number Diff line change
@@ -602,7 +602,7 @@ def run(study_folder: str, output_folder: str, tz_str: Optional[str] = None,
or frequency == Frequency.HOURLY
):
freq = 'H'
elif frequency == Frequency.MINUTELY:
elif frequency == Frequency.MINUTE:
freq = 'T'
else:
freq = str(frequency.value/60) + 'H'
@@ -653,7 +653,7 @@ def run(study_folder: str, output_folder: str, tz_str: Optional[str] = None,
]
# transform t to full hours
t_series = pd.Series(t_datetime)
if frequency == Frequency.MINUTELY:
if frequency == Frequency.MINUTE:
t_hours_pd = t_series.dt.floor('T')
else:
t_hours_pd = t_series.dt.floor('H')

0 comments on commit f8390ab

Please sign in to comment.