"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "python/scripts/generate_holidays_file.py" between
prophet-1.0.tar.gz and prophet-1.1.tar.gz

About: Prophet is a tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

generate_holidays_file.py  (prophet-1.0):generate_holidays_file.py  (prophet-1.1)
skipping to change at line 62 skipping to change at line 62
country_set1 = {name for name in list(zip(*class_list1))[0] if len(name) == 2} country_set1 = {name for name in list(zip(*class_list1))[0] if len(name) == 2}
country_set.update(country_set1) country_set.update(country_set1)
country_set -= class_to_exclude country_set -= class_to_exclude
for country in country_set: for country in country_set:
df = make_holidays_df(year_list=year_list, country=country) df = make_holidays_df(year_list=year_list, country=country)
df['country'] = country df['country'] = country
all_holidays.append(df) all_holidays.append(df)
generated_holidays = pd.concat(all_holidays, axis=0, ignore_index=True) generated_holidays = pd.concat(all_holidays, axis=0, ignore_index=True)
generated_holidays['year'] = generated_holidays.ds.apply(lambda x: x.year) generated_holidays['year'] = generated_holidays.ds.dt.year
generated_holidays.sort_values(['country', 'ds', 'holiday'], inplace=True) generated_holidays.sort_values(['country', 'ds', 'holiday'], inplace=True)
# Convert to ASCII, and drop holidays that fail to convert # Convert to ASCII, and drop holidays that fail to convert
generated_holidays['holiday'] = generated_holidays['holiday'].apply(utf8_to_ ascii) generated_holidays['holiday'] = generated_holidays['holiday'].apply(utf8_to_ ascii)
failed_countries = generated_holidays.loc[generated_holidays['holiday'] == '
FAILED_TO_PARSE', 'country'].unique()
if failed_countries:
print("Failed to convert UTF-8 holidays for:")
print('\n'.join(failed_countries))
assert 'FAILED_TO_PARSE' not in generated_holidays['holiday'].unique() assert 'FAILED_TO_PARSE' not in generated_holidays['holiday'].unique()
generated_holidays.to_csv("../R/data-raw/generated_holidays.csv", index=Fals e) generated_holidays.to_csv("../R/data-raw/generated_holidays.csv", index=Fals e)
if __name__ == "__main__": if __name__ == "__main__":
# execute only if run as a script # execute only if run as a script
generate_holidays_file() generate_holidays_file()
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)