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

New agreed public holiday in Russia #578

Closed
MichalChromcak opened this issue Oct 29, 2020 · 10 comments · Fixed by #601
Closed

New agreed public holiday in Russia #578

MichalChromcak opened this issue Oct 29, 2020 · 10 comments · Fixed by #601

Comments

@MichalChromcak
Copy link

Dear workalendar team,

We were notified, that recently, the Russian government agreed on the occupational calendar for 2021, which brings additional logic to some of the holidays.

Year 2021

Is it possible to adjust the holidays for Russia since 2021 accordingly?

The current result:

from workalendar.europe import Russia
Russia().holidays(2021)
[(datetime.date(2021, 1, 1), 'New year'),
 (datetime.date(2021, 1, 2), 'Day After New Year'),
 (datetime.date(2021, 1, 7), 'Christmas'),
 (datetime.date(2021, 2, 23), 'Defendence of the Fatherland'),
 (datetime.date(2021, 3, 8), "International Women's Day"),
 (datetime.date(2021, 5, 1), 'Labour Day'),
 (datetime.date(2021, 5, 9), 'Victory Day'),
 (datetime.date(2021, 6, 12), 'National Day'),
 (datetime.date(2021, 11, 4), 'Day of Unity')]

The expected result:
Note: Saturday 2020-02-20 becomes a working day

from workalendar.europe import Russia
Russia().holidays(2021)
[(datetime.date(2021, 1, 1, "New Year"),
(datetime.date(2021, 1, 2, "Day After New Year"),
(datetime.date(2021, 1, 3, "Another Day After New Year"),
(datetime.date(2021, 1, 4, "Third Day after New Year"),
(datetime.date(2021, 1, 5, "Fourth Day after New Year"),
(datetime.date(2021, 1, 6, "Fifth Day after New Year"),
(datetime.date(2021, 1, 7, "Christmas"),
(datetime.date(2021, 1, 8, "Day After Christmas"),
#(datetime.date(2021, 2,20, "working day, Saturday"),
(datetime.date(2021, 2, 22, "Day Before Defendence of the Fatherland"),
(datetime.date(2021, 2, 23, "Defendence of the Fatherland"),
(datetime.date(2021, 3, 8, "International Women's Day"),
(datetime.date(2021, 5, 1, "International Workers' Day"),
(datetime.date(2021, 5, 3, "Compensation holiday because International Workers' Day was Saturday"),
(datetime.date(2021, 5, 9, "Victory Day"),
(datetime.date(2021, 5, 10, "Compensation holiday because Victory Day was Sunday"),
(datetime.date(2021, 6, 12, "National Day"),
(datetime.date(2021, 6, 14, "Compensation holiday because National Day was Saturday"),
(datetime.date(2021, 11, 4, "Day of Unity"),
(datetime.date(2021, 11, 5, "Day After Day of Unity"), #just because it is a bridge Friday
(datetime.date(2021, 12, 31, "31st December")]

Past years

Could you also fix the past years (e.g. the year 2020 having some missing holidays)? Even though this is past information, it is relevant for the machine learning models during the fitting time.

Related sources

http://www.consultant.ru/law/ref/calendar/proizvodstvennye/2021/
https://www.timeanddate.com/calendar/custom.html?year=2021&country=20&cols=3&hol=1&df=1

@brunobord
Copy link
Member

Hello!

Could you also fix the past years (e.g. the year 2020 having some missing holidays)?

That's perfectly doable, yes. But to make things a bit clearer: what was the starting point of these changes in the Russia calendar? was it only for 2020 and 2021+, or did it start earlier?

@brunobord
Copy link
Member

One more question: are all those "new" days public holidays (i.e. days when employees don't work at all?)

@MichalChromcak
Copy link
Author

@brunobord Explained by my Russian colleague, there is the following process in place for several (decades) years
Every Autumn (not sure about the exact date), the government agrees on the next year's non-working days around public holidays and thus define the calendar for the upcoming year (here still classified as official holidays)

Regarding when people are working, that can indeed become tricky - for example, there were some COVID-19 days (see April) in 2020, but some people had an exception and could work - yet the pragmatic approach I would consider is to keep all of them as non-working in case, there is a need to do so (personal opinion).

@brunobord brunobord added this to Done in Workalendar Nov 13, 2020
@brunobord brunobord moved this from Done to Working in Workalendar Nov 13, 2020
brunobord added a commit that referenced this issue Nov 13, 2020
The days between 2-5 have become a week off since 2005 (related to #578)
brunobord added a commit that referenced this issue Nov 13, 2020
The days between 2-5 have become a week off since 2005 (related to #578)
@brunobord
Copy link
Member

Started to work on the Russia calendar. I've splitted the various issues into several smaller chunks, but my main goal is to try to reach the smartest precision I can get to. I'm not sure it's going to be perfect, but I'll try my best ;o)

@brunobord
Copy link
Member

There's an issue I've discovered with Russia including Dec 25th as a holiday while it shouldn't.
Related to #530 ; need to fix this.

@brunobord
Copy link
Member

I (allegedly) think I've fixed the 2020 holiday mistakes... Switching to 2021, I hope I'll be able to release a new version on time for the New Year's Day!

brunobord added a commit that referenced this issue Nov 27, 2020
brunobord added a commit that referenced this issue Dec 10, 2020
brunobord added a commit that referenced this issue Dec 10, 2020
Workalendar automation moved this from Working to Done Dec 10, 2020
@brunobord
Copy link
Member

version 14.1.0 ships 2021 Russia calendar, hopefully.
I've tried to mix from various sources to make it as complete as possible.

Happy upgrading!

@MichalChromcak
Copy link
Author

Hi @brunobord Many thanks for the implementation!

Looking at the output of the following code - it misses the holidays from elif year==2021 part. Could you have a look on that?

# conda install -c conda-forge workalendar=14.0
from workalendar.europe import Russia
cal = Russia()
cal.holidays(2021)
[(datetime.date(2021, 1, 1), 'New year'),
 (datetime.date(2021, 1, 2), 'Day After New Year'),
 (datetime.date(2021, 1, 3), 'Third Day after New Year'),
 (datetime.date(2021, 1, 4), 'Fourth Day after New Year'),
 (datetime.date(2021, 1, 5), 'Fifth Day after New Year'),
 (datetime.date(2021, 1, 6), 'Sixth Day after New Year'),
 (datetime.date(2021, 1, 7), 'Christmas'),
 (datetime.date(2021, 1, 8), 'Eighth Day after New Year'),
 (datetime.date(2021, 2, 23), 'Defendence of the Fatherland'),
 (datetime.date(2021, 3, 8), "International Women's Day"),
 (datetime.date(2021, 5, 1), 'Labour Day'),
 (datetime.date(2021, 5, 3), 'Labour Day shift'),
 (datetime.date(2021, 5, 9), 'Victory Day'),
 (datetime.date(2021, 5, 10), 'Victory Day shift'),
 (datetime.date(2021, 6, 12), 'National Day'),
 (datetime.date(2021, 6, 14), 'National Day shift'),
 (datetime.date(2021, 11, 4), 'Day of Unity')]

https://github.com/peopledoc/workalendar/blob/692122479e47238600fc241106e84980fe41d478/workalendar/europe/russia.py#L70-L75

@brunobord brunobord reopened this Dec 18, 2020
Workalendar automation moved this from Done to Warming up Dec 18, 2020
@brunobord
Copy link
Member

brunobord commented Dec 18, 2020

# conda install -c conda-forge workalendar=14.0

I see you are using the 14.0 release, but the 2021 fixes are in the 14.1.0 instead. Could you please retry with this one and confirm this issue is fixed?

@MichalChromcak
Copy link
Author

@brunobord Ah sorry, you're right - it works, my bad. Thanks for pointing it out.

Workalendar automation moved this from Warming up to Done Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Workalendar
  
Done/Closed/Published
Development

Successfully merging a pull request may close this issue.

2 participants