From 98853c219c0f50982471c60a0f6897e38f7071d0 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:28:45 +0700 Subject: [PATCH] [US] switch from `NON_PUBLIC` to `UNOFFICIAL` --- README.rst | 16 ++++++++-------- holidays/constants.py | 2 +- holidays/countries/american_samoa.py | 8 ++++---- holidays/countries/guam.py | 8 ++++---- holidays/countries/northern_mariana_islands.py | 8 ++++---- holidays/countries/puerto_rico.py | 8 ++++---- holidays/countries/united_states.py | 6 +++--- .../united_states_minor_outlying_islands.py | 8 ++++---- .../countries/united_states_virgin_islands.py | 8 ++++---- tests/countries/test_american_samoa.py | 6 +++--- tests/countries/test_guam.py | 6 +++--- .../countries/test_northern_mariana_islands.py | 6 +++--- tests/countries/test_puerto_rico.py | 6 +++--- tests/countries/test_united_states.py | 18 +++++++++--------- ...est_united_states_minor_outlying_islands.py | 6 +++--- .../test_united_states_virgin_islands.py | 6 +++--- 16 files changed, 63 insertions(+), 63 deletions(-) diff --git a/README.rst b/README.rst index 76ef20400..279072e77 100644 --- a/README.rst +++ b/README.rst @@ -190,7 +190,7 @@ All other default values are highlighted with bold: - AS - Can also be loaded as country US, subdivision AS - - - NON_PUBLIC + - UNOFFICIAL * - Andorra - AD - Parishes: 02, 03, 04, 05, 06, 07, 08 @@ -455,7 +455,7 @@ All other default values are highlighted with bold: - GU - Can also be loaded as country US, subdivision GU - - - NON_PUBLIC + - UNOFFICIAL * - Guatemala - GT - @@ -665,7 +665,7 @@ All other default values are highlighted with bold: - MP - Can also be loaded as country US, subdivision MP - - - NON_PUBLIC + - UNOFFICIAL * - North Macedonia - MK - @@ -720,7 +720,7 @@ All other default values are highlighted with bold: - PR - Can also be loaded as country US, subdivision PR - - - NON_PUBLIC + - UNOFFICIAL * - Romania - RO - @@ -840,17 +840,17 @@ All other default values are highlighted with bold: - UM - Can also be loaded as country US, subdivision UM - - - NON_PUBLIC + - UNOFFICIAL * - United States of America (the) - US - States and territories: AK, AL, AR, AS, AZ, CA, CO, CT, DC, DE, FL, GA, GU, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MP, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX, UM, UT, VA, VI, VT, WA, WI, WV, WY - - - NON_PUBLIC + - UNOFFICIAL * - United States Virgin Islands (the) - - See Virgin Islands (U.S.) - - - NON_PUBLIC + - UNOFFICIAL * - Uruguay - UY - @@ -885,7 +885,7 @@ All other default values are highlighted with bold: - VI - Can also be loaded as country US, subdivision VI - - - NON_PUBLIC + - UNOFFICIAL * - Zambia - ZM - diff --git a/holidays/constants.py b/holidays/constants.py index ec2e0adba..f8e40d1d1 100644 --- a/holidays/constants.py +++ b/holidays/constants.py @@ -41,10 +41,10 @@ BANK = "bank" GOVERNMENT = "government" HALF_DAY = "half_day" -NON_PUBLIC = "non_public" OPTIONAL = "optional" PUBLIC = "public" SCHOOL = "school" +UNOFFICIAL = "unofficial" WORKDAY = "workday" CHINESE = "chinese" diff --git a/holidays/countries/american_samoa.py b/holidays/countries/american_samoa.py index 20613cb1a..56e4df6f6 100644 --- a/holidays/countries/american_samoa.py +++ b/holidays/countries/american_samoa.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysAS(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "AS" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "AS" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "AS" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class AS(HolidaysAS): diff --git a/holidays/countries/guam.py b/holidays/countries/guam.py index 9efd0cbb0..028157d79 100644 --- a/holidays/countries/guam.py +++ b/holidays/countries/guam.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysGU(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "GU" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "GU" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "GU" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class GU(HolidaysGU): diff --git a/holidays/countries/northern_mariana_islands.py b/holidays/countries/northern_mariana_islands.py index ded5d0fc9..88efb596c 100644 --- a/holidays/countries/northern_mariana_islands.py +++ b/holidays/countries/northern_mariana_islands.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysMP(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "MP" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "MP" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "MP" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class MP(HolidaysMP): diff --git a/holidays/countries/puerto_rico.py b/holidays/countries/puerto_rico.py index 31eb14f4b..f05c9de6d 100644 --- a/holidays/countries/puerto_rico.py +++ b/holidays/countries/puerto_rico.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysPR(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "PR" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "PR" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "PR" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class PR(HolidaysPR): diff --git a/holidays/countries/united_states.py b/holidays/countries/united_states.py index 45c36383c..bf8bc927e 100644 --- a/holidays/countries/united_states.py +++ b/holidays/countries/united_states.py @@ -12,7 +12,7 @@ from typing import Tuple, Union from holidays.calendars.gregorian import DEC -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.groups import ChristianHolidays, InternationalHolidays from holidays.observed_holiday_base import ( ObservedHolidayBase, @@ -43,7 +43,7 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays """ country = "US" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) observed_label = "%s (observed)" subdivisions: Union[Tuple[()], Tuple[str, ...]] = ( "AK", # Alaska. @@ -934,7 +934,7 @@ def _populate_subdiv_wv_public_holidays(self): def _populate_subdiv_wy_public_holidays(self): pass - def _populate_non_public_holidays(self): + def _populate_unofficial_holidays(self): # Very common celebrated cultural days, but no official observance. # Due to its nature, no in-lieus are observed. diff --git a/holidays/countries/united_states_minor_outlying_islands.py b/holidays/countries/united_states_minor_outlying_islands.py index fc0137461..19173f5f4 100644 --- a/holidays/countries/united_states_minor_outlying_islands.py +++ b/holidays/countries/united_states_minor_outlying_islands.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysUM(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "UM" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "UM" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "UM" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class UM(HolidaysUM): diff --git a/holidays/countries/united_states_virgin_islands.py b/holidays/countries/united_states_virgin_islands.py index 9bf0ccf5b..ff1e6aa45 100644 --- a/holidays/countries/united_states_virgin_islands.py +++ b/holidays/countries/united_states_virgin_islands.py @@ -9,7 +9,7 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -from holidays.constants import NON_PUBLIC, PUBLIC +from holidays.constants import PUBLIC, UNOFFICIAL from holidays.countries.united_states import US @@ -19,16 +19,16 @@ class HolidaysVI(US): # https://en.wikipedia.org/wiki/ISO_3166-2:US#Subdivisions_included_in_ISO_3166-1 country = "VI" - supported_categories = (NON_PUBLIC, PUBLIC) + supported_categories = (PUBLIC, UNOFFICIAL) subdivisions = () # Override US subdivisions. def _populate_public_holidays(self) -> None: self.subdiv = "VI" super()._populate_public_holidays() - def _populate_non_public_holidays(self) -> None: + def _populate_unofficial_holidays(self) -> None: self.subdiv = "VI" - super()._populate_non_public_holidays() + super()._populate_unofficial_holidays() class VI(HolidaysVI): diff --git a/tests/countries/test_american_samoa.py b/tests/countries/test_american_samoa.py index 95fbe46e3..7aa0b805e 100644 --- a/tests/countries/test_american_samoa.py +++ b/tests/countries/test_american_samoa.py @@ -13,7 +13,7 @@ from unittest import TestCase from holidays.calendars.gregorian import DEC -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.american_samoa import HolidaysAS, AS, ASM from tests.common import CommonCountryTests @@ -31,9 +31,9 @@ def test_as_only(self): subdivision is specified.""" self.assertIn("Christmas Eve (observed)", self.holidays.get_list(date(2017, DEC, 22))) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysAS(categories=NON_PUBLIC, years=2024), + HolidaysAS(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"), diff --git a/tests/countries/test_guam.py b/tests/countries/test_guam.py index 12841a999..adb89a067 100644 --- a/tests/countries/test_guam.py +++ b/tests/countries/test_guam.py @@ -13,7 +13,7 @@ from unittest import TestCase from holidays.calendars.gregorian import MAR -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.guam import HolidaysGU, GU, GUM from tests.common import CommonCountryTests @@ -31,9 +31,9 @@ def test_gu_only(self): subdivision is specified.""" self.assertIn("Guam Discovery Day", self.holidays.get_list(date(2016, MAR, 7))) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysGU(categories=NON_PUBLIC, years=2024), + HolidaysGU(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"), diff --git a/tests/countries/test_northern_mariana_islands.py b/tests/countries/test_northern_mariana_islands.py index 46a6f3300..204cca21a 100644 --- a/tests/countries/test_northern_mariana_islands.py +++ b/tests/countries/test_northern_mariana_islands.py @@ -13,7 +13,7 @@ from unittest import TestCase from holidays.calendars.gregorian import MAR -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.northern_mariana_islands import HolidaysMP, MP, MNP from tests.common import CommonCountryTests @@ -31,9 +31,9 @@ def test_mp_only(self): subdivision is specified.""" self.assertIn("Commonwealth Covenant Day", self.holidays.get_list(date(2022, MAR, 24))) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysMP(categories=NON_PUBLIC, years=2024), + HolidaysMP(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"), diff --git a/tests/countries/test_puerto_rico.py b/tests/countries/test_puerto_rico.py index 1abc60543..ba37d4541 100644 --- a/tests/countries/test_puerto_rico.py +++ b/tests/countries/test_puerto_rico.py @@ -13,7 +13,7 @@ from unittest import TestCase from holidays.calendars.gregorian import NOV -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.puerto_rico import HolidaysPR, PR, PRI from tests.common import CommonCountryTests @@ -31,9 +31,9 @@ def test_pr_only(self): subdivision is specified.""" self.assertIn("Discovery Day (observed)", self.holidays.get_list(date(2017, NOV, 20))) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysPR(categories=NON_PUBLIC, years=2024), + HolidaysPR(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"), diff --git a/tests/countries/test_united_states.py b/tests/countries/test_united_states.py index 7cafccec3..345df0faf 100644 --- a/tests/countries/test_united_states.py +++ b/tests/countries/test_united_states.py @@ -11,7 +11,7 @@ from unittest import TestCase -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.united_states import UnitedStates, US, USA from tests.common import CommonCountryTests @@ -1597,21 +1597,21 @@ def test_election_day(self): ) subdiv_us_territories = {"AS", "GU", "MP", "PR", "UM", "VI"} for subdiv in set(UnitedStates.subdivisions) - subdiv_us_territories: - self.assertNoHolidayName(name, UnitedStates(categories=NON_PUBLIC), 1844, 1847) + self.assertNoHolidayName(name, UnitedStates(categories=UNOFFICIAL), 1844, 1847) self.assertHolidayName( name, - UnitedStates(categories=NON_PUBLIC), + UnitedStates(categories=UNOFFICIAL), dt, ) for subdiv in subdiv_us_territories: - self.assertNoHolidayName(name, UnitedStates(categories=NON_PUBLIC), range(1865, 2050)) + self.assertNoHolidayName(name, UnitedStates(categories=UNOFFICIAL), range(1865, 2050)) def test_valentines_day(self): name = "Valentine's Day" - self.assertNoHolidayName(name, UnitedStates(categories=NON_PUBLIC), 1846) + self.assertNoHolidayName(name, UnitedStates(categories=UNOFFICIAL), 1846) self.assertHolidayName( name, - UnitedStates(categories=NON_PUBLIC), + UnitedStates(categories=UNOFFICIAL), (f"{year}-02-14" for year in range(1865, 2050)), ) @@ -1619,7 +1619,7 @@ def test_st_patricks_day(self): name = "St. Patrick's Day" self.assertHolidayName( name, - UnitedStates(categories=NON_PUBLIC), + UnitedStates(categories=UNOFFICIAL), (f"{year}-03-17" for year in range(1865, 2050)), ) @@ -1627,7 +1627,7 @@ def test_halloween(self): name = "Halloween" self.assertHolidayName( name, - UnitedStates(categories=NON_PUBLIC), + UnitedStates(categories=UNOFFICIAL), (f"{year}-10-31" for year in range(1865, 2050)), ) @@ -1635,7 +1635,7 @@ def test_groundhog_day(self): name = "Groundhog Day" self.assertHolidayName( name, - UnitedStates(categories=NON_PUBLIC), + UnitedStates(categories=UNOFFICIAL), (f"{year}-02-02" for year in range(1886, 2050)), ) diff --git a/tests/countries/test_united_states_minor_outlying_islands.py b/tests/countries/test_united_states_minor_outlying_islands.py index 98635d7c0..1370e7c0b 100644 --- a/tests/countries/test_united_states_minor_outlying_islands.py +++ b/tests/countries/test_united_states_minor_outlying_islands.py @@ -11,7 +11,7 @@ from unittest import TestCase -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.united_states_minor_outlying_islands import HolidaysUM, UM, UMI from tests.common import CommonCountryTests @@ -27,9 +27,9 @@ def test_country_aliases(self): def test_common(self): self.assertIn("Christmas Day", self.holidays["2022-12-25"]) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysUM(categories=NON_PUBLIC, years=2024), + HolidaysUM(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"), diff --git a/tests/countries/test_united_states_virgin_islands.py b/tests/countries/test_united_states_virgin_islands.py index 71a50a42c..d1957e062 100644 --- a/tests/countries/test_united_states_virgin_islands.py +++ b/tests/countries/test_united_states_virgin_islands.py @@ -13,7 +13,7 @@ from unittest import TestCase from holidays.calendars.gregorian import MAR -from holidays.constants import NON_PUBLIC +from holidays.constants import UNOFFICIAL from holidays.countries.united_states_virgin_islands import HolidaysVI, VI, VIR from tests.common import CommonCountryTests @@ -31,9 +31,9 @@ def test_vi_only(self): subdivision is specified.""" self.assertIn("Transfer Day", self.holidays.get_list(date(2020, MAR, 31))) - def test_non_public_holidays(self): + def test_unofficial_holidays(self): self.assertHolidays( - HolidaysVI(categories=NON_PUBLIC, years=2024), + HolidaysVI(categories=UNOFFICIAL, years=2024), ("2024-02-14", "Valentine's Day"), ("2024-03-17", "St. Patrick's Day"), ("2024-10-31", "Halloween"),