Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional frequency names #227

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion forest/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions forest/jasmine/traj2stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1600,7 +1600,7 @@ def gps_stats_main(
"""

# no minutely analysis on GPS data
if frequency == Frequency.MINUTELY:
if frequency == Frequency.MINUTE:
raise ValueError("Frequency cannot be minutely.")

os.makedirs(output_folder, exist_ok=True)
Expand Down
4 changes: 2 additions & 2 deletions forest/oak/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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')
Expand Down