-
-
Notifications
You must be signed in to change notification settings - Fork 539
Add Tuvalu holidays #1291
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
Comments
Thank you for mentioning me to work on this issue and for providing the necessary information to get started. I appreciate your support and guidance! |
As referenced in the section on Public holidays in Tuvalu, we have the Tuvaluan name. Should I add this language as well, or should I keep it limited to |
@Prateekshit73 You're free to include them as well though I'm concerned about some missing entries (I don't see the translation for Good Friday in T 8000 uvaluan on Wikipedia for example) - if you can find the sources for them then this would be perfect 🙏 |
Here are some references, as listed below:-
Am I allowed to consider these references? |
@Prateekshit73 I checked for both Easter and "Good Friday" on Glosbe, the results are sadly empty for both of them 😔 I would recommend reaching out to Ekalesia Kelisiano Tuvalu FB page instead in this particular case. |
Thank you for your feedback, @PPsyrius! I appreciate your guidance on the references. I will reach out to the Ekalesia Kelisiano Tuvalu Facebook page to gather more information about the translations for "Good Friday" and any other missing entries. Once I have the necessary details, I’ll proceed with adding the Tuvaluan names for the holidays. If you have any other suggestions or resources, please let me know. Thanks again for your support! |
Hello @PPsyrius, I wanted to seek your guidance on handling the National Children’s event, which is on the first Monday after White Sunday, and White Sunday falling on the second Sunday of October. |
@Prateekshit73 Hi, regarding this - I would recommend implement the following code snippet: If White Sunday itself is also a Public Holiday: from holidays.calendars.gregorian import _timedelta # White Sunday.
dt = self._add_holiday_2nd_sun_of_oct(tr("White Sunday"))
# National Children's Day.
self._add_holiday(tr("National Children's Day"), _timedelta(dt, +1)) If White Sunday isn't a Public Holiday: # National Children's Day.
self._add_holiday_1_day_past_2nd_sun_of_oct(tr("National Children's Day")) |
Since it is referenced in the Public Holiday Act 2018 and later, and was not present in the Public Holiday Act 2008, should I implement it as |
@Prateekshit73 Yes, I would suggest doing a National Children's Day date change trigger for 2019 (note that the law came into effect in Nov 2018 - so it's a bit too late for that year). National Youth Day can either uses the same trigger as shown below or done separately as you see fit 🙂 # National Children's Day.
name = tr("National Children's Day")
if self._year >= 2019:
self._add_holiday_1_day_past_2nd_sun_of_oct(name)
# National Youth Day.
self._add_holidat_1st_mon_of_aug(tr("National Youth Day"))
else:
self._add_holidat_1st_mon_of_aug(name) |
Here in Wikipedia, it states that:
So, for |
@Prateekshit73 I think that's probably some copy-n-paste mistake since the German language page appears correctly, Holy Saturday and Easter Sunday were never listed as part of their public holidays list. The actual law (i.e. 2022 amendment) clearly states "Easter Monday" so we're using |
Hi @PPsyrius, I wanted to ask about the implementation of subdivision-specific holidays as stated in Tuvalu News TV that you referenced. I am a bit confused about how these subdiv_public_holidays work. def _populate_subdiv_nui_public_holidays(self):
# Nanumaga Day.
self._add_observed(self._add_holiday_apr_15(tr("Aho o te Fakavae")))
if self._year >= 2015:
# Cyclone Day.
self._add_observed(self._add_holiday_mar_22(tr("Aso o te matagi")))
# Nukufetau Day.
self._add_observed(self._add_holiday_feb_16(tr("Te Aso o Tutasi")))
def _populate_subdiv_vai_public_holidays(self):
# Cyclone Day.
self._add_observed(self._add_holiday_jan_30(tr("Aso o te matagi")))
# Cyclone Day.
self._add_observed(self._add_holiday_feb_1(tr("Aso o te matagi")))
if self._year >= 2015:
# Cyclone Day.
self._add_observed(self._add_holiday_mar_15(tr("Aso o te matagi")))
# Nanumaga Day.
self._add_observed(self._add_holiday_apr_15(tr("Aho o te Fakavae")))
def _populate_subdiv_nkl_public_holidays(self):
# Nanumaga Day.
self._add_observed(self._add_holiday_may_10(tr("Aho o te Fakavae"))) I tried to study other examples and replicate them, but the holidays they include either have different years or feature unique holidays. In our case, one subdivision has a different year, while the others vary by the date of the same holiday. Now, the problem is:
def test_nma_holidays(self):
nma_holidays = Tuvalu(subdiv="NMA", years=range(1990, 2050))
name = "Aho o te Fakavae"
self.assertHolidayName(name, nma_holidays, (f"{year}-04-15" for year in range(1990, 2050)))
self.assertNoHolidayName(name) I apologize for being so dull. |
@Prateekshit73 Unless I misunderstood the original source for Tuvalu's case, it's more like the code I provided below - none of the subdivision-specific start dates mentioned in Wikipedia affects us at all since all of them predate our own 1990 subdivisions = (
"FUN", # Funafuti.
"NMG", # Nanumaga.
"NMA", # Nanumea.
"NIT", # Niutao.
"NUI", # Nui.
"NKF", # Nukufetau.
"NKL", # Nukulaelae.
"VAI", # Vaitupu.
)
subdivisions_aliases = {
# Town/Island Councils.
"Funafuti": "FUN",
"Nanumaga": "NMG",
"Nanumea": "NMA",
"Niutao": "NIT",
"Nui": "NUI",
"Nukufetau": "NKF",
"Nukulaelae": "NKL",
"Vaitupu": "VAI",
# Ex-ISO Code Aliases.
"Nanumanga": "NMG",
} def _populate_subdiv_fun_public_holidays(self):
# Hurricane Bebe Day.
self._add_holiday_oct_21(tr("Hurricane Bebe Day"))
def _populate_subdiv_nmg_public_holidays(self):
# Aho o te Fakavae.
self._add_holiday_apr_15(tr("Aho o te Fakavae"))
def _populate_subdiv_nma_public_holidays(self):
# Te Po o Tefolaha.
self._add_holiday_jan_8(tr("Te Po o Tefolaha"))
def _populate_subdiv_nit_public_holidays(self):
# Te Aso o te Setema.
self._add_holiday_sep_17(tr("Te Aso o te Setema"))
def _populate_subdiv_nui_public_holidays(self):
# Bongin the Ieka.
self._add_holiday_feb_16(tr("Bongin the Ieka"))
def _populate_subdiv_nkf_public_holidays(self):
# Te Aso O Tutasi.
self._add_holiday_feb_11(tr("Te Aso O Tutasi"))
def _populate_subdiv_nkl_public_holidays(self):
# Aso o te Tala Lei.
self._add_holiday_may_10(tr("Aso o te Tala Lei"))
def _populate_subdiv_vai_public_holidays(self):
# Te Aso Fiafia.
self._add_holiday_nov_25(tr("Te Aso Fiafia")) If the same holiday exists on multiple subdivisions, current USA implementation method can be done as well: def _populate_subdiv_holidays(self):
# This section only matters if that country has other support categories.
if PUBLIC not in self.categories:
return None
# Martin Luther King Jr. Day
if self._year >= 1986 and self.subdiv not in {"AL", "AR", "AZ", "GA", "ID", "MS", "NH"}:
self._add_holiday_3rd_mon_of_jan("Martin Luther King Jr. Day")
# Washington's Birthday
if self._year >= 1879 and self.subdiv not in {
"AL",
"AR",
"DE",
"FL",
"GA",
"IN",
"NM",
"PR",
"VI",
}:
name = "Washington's Birthday"
if self._year >= 1971:
self._add_holiday_3rd_mon_of_feb(name)
else:
self._add_holiday_feb_22(name)
# Columbus Day
if self._year >= 1937 and (
self.subdiv is None
or self.subdiv
in {
"AS",
"AZ",
"CT",
"GA",
"ID",
"IL",
"IN",
"MA",
"MD",
"MO",
"MT",
"NJ",
"NY",
"OH",
"PA",
"UT",
"WV",
}
):
name = "Columbus Day"
if self._year >= 1971:
self._add_holiday_2nd_mon_of_oct(name)
else:
self._add_columbus_day(name)
super()._populate_subdiv_holidays() Your test case looks pretty much perfect here, though for holidays observed by multiple subdivisions in future implementations here's some examples from current Germany's test case: def test_heilige_drei_koenige(self):
name = "Heilige Drei Könige"
self.assertNoHolidayName(name)
for subdiv, holidays in self.subdiv_holidays.items():
if subdiv in {"BW", "BY", "ST"}:
self.assertHolidayName(
name, holidays, (f"{year}-01-06" for year in range(1991, 2050))
)
else:
self.assertNoHoliday(holidays, (f"{year}-01-06" for year in range(1991, 2050)))
self.assertNoHolidayName(name, holidays) |
I think I am done with the code. Should I open the pull request? |
@Prateekshit73 yes, you're free to do so 🙏 |
I need help. I tried this method :- def test_the_day_of_the_bombing(self):
fun_holidays = Tuvalu(subdiv="FUN", years=range(1990, 2050))
name = "Te Aso o te Paula"
dt = (
"2005-04-25",
"2006-04-24",
"2016-04-25",
"2017-04-24",
"2022-04-25",
)
for subdiv, holidays in self.subdiv_holidays.items():
if subdiv == "FUN":
self.assertHolidayName(
name, fun_holidays, (f"{year}-04-23" for year in range(1990, 2050))
)
self.assertHolidayName(f"{name} (fakamatakuga)", dt)
self.assertNoNonObservedHoliday(dt) I encountered this error :- _____________________________________________________________________ TestTuvalu.test_the_day_of_the_bombing ______________________________________________________________________
self = <tests.countries.test_tuvalu.TestTuvalu testMethod=test_the_day_of_the_bombing>
def test_the_day_of_the_bombing(self):
fun_holidays = Tuvalu(subdiv="FUN", years=range(1990, 2050))
name = "Te Aso o te Paula"
dt = (
"2005-04-25",
"2006-04-24",
"2016-04-25",
"2017-04-24",
"2022-04-25",
)
for subdiv, holidays in self.subdiv_holidays.items():
if subdiv == "FUN":
self.assertHolidayName(
name, fun_holidays, (f"{year}-04-23" for year in range(1990, 2050))
)
> self.assertHolidayName(f"{name} (fakamatakuga)", dt)
tests\countries\test_tuvalu.py:281:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\common.py:200: in assertHolidayName
self._assertHolidayName(name, "holidays", *args)
tests\common.py:192: in _assertHolidayName
self.assertIn(name, holidays.get_list(dt), dt)
E AssertionError: 'Te Aso o te Paula (fakamatakuga)' not found in [] : 2005-04-25
But Snapshot says :-
|
You don't have |
Links:
The text was updated successfully, but these errors were encountered: