Skip to content

Commit

Permalink
[US] switch from NON_PUBLIC to UNOFFICIAL
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius committed Mar 1, 2024
1 parent 1a7065b commit 98853c2
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 63 deletions.
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
-
Expand Down Expand Up @@ -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
-
Expand Down Expand Up @@ -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
-
Expand Down Expand Up @@ -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
-
Expand Down Expand Up @@ -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
-
Expand Down
2 changes: 1 addition & 1 deletion holidays/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/american_samoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/guam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/northern_mariana_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/puerto_rico.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions holidays/countries/united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/united_states_minor_outlying_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/united_states_virgin_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions tests/countries/test_american_samoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions tests/countries/test_guam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions tests/countries/test_northern_mariana_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions tests/countries/test_puerto_rico.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"),
Expand Down
Loading

0 comments on commit 98853c2

Please sign in to comment.