Skip to content

Commit

Permalink
Fix holiday test and update version (#1431)
Browse files Browse the repository at this point in the history
* updated holidays

* removed testing of length of names
  • Loading branch information
leoniewgnr authored Sep 28, 2023
1 parent 50d5e41 commit 1aa9f37
Show file tree
Hide file tree
Showing 6 changed files with 889 additions and 907 deletions.
2 changes: 1 addition & 1 deletion neuralprophet/forecaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def add_country_holidays(
and create the corresponding configs such as lower, upper windows and the regularization
parameters
Holidays can only be added for a single country. Calling the function
Holidays can only be added for a single country or country list. Calling the function
multiple times will override already added country holidays.
Parameters
Expand Down
9 changes: 5 additions & 4 deletions neuralprophet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,13 @@ def get_holidays_from_country(country: Union[str, Iterable[str]], df=None):
if isinstance(country, str):
country = [country]

holidays = {}
unique_holidays = {}
for single_country in country:
holidays_country = get_country_holidays(single_country, years)
# only add holiday if it is not already in the dict
holidays.update(holidays_country)
holiday_names = holidays.values()
for date, name in holidays_country.items():
if date not in unique_holidays:
unique_holidays[date] = name
holiday_names = unique_holidays.values()
return set(holiday_names)


Expand Down
Loading

0 comments on commit 1aa9f37

Please sign in to comment.