Skip to content

Commit

Permalink
Make frequency check case-insensitive (#159)
Browse files Browse the repository at this point in the history
* Make frequency check case-insensitive

* Linting
  • Loading branch information
NoraLoose authored Sep 27, 2024
1 parent 2d400fa commit 0fb7138
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions roms_tools/setup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,12 @@ def group_dataset(ds, filepath):
if len(ds["abs_time"]) > 2:
# Determine the frequency of the data
abs_time_freq = pd.infer_freq(ds["abs_time"].to_index())

if abs_time_freq in ["D", "H", "T", "S"]: # Daily or higher frequency
if abs_time_freq.lower() in [
"d",
"h",
"t",
"s",
]: # Daily or higher frequency
dataset_list, output_filenames = group_by_month(ds, filepath)
else:
dataset_list, output_filenames = group_by_year(ds, filepath)
Expand Down

0 comments on commit 0fb7138

Please sign in to comment.