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

Add Vanuatu holidays #1423

Merged
merged 3 commits into from
Aug 15, 2023
Merged

Add Vanuatu holidays #1423

merged 3 commits into from
Aug 15, 2023

Conversation

Strategos1
Copy link
Contributor

Proposed change

Your PR description goes here.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new python-holidays functionality in general)

Checklist

  • I've followed the contributing guidelines
  • This PR is filed against beta branch of the repository
  • This PR doesn't contain any merge conflicts and has clean commit history
  • The code style looks good: make pre-commit
  • All tests pass locally: make test, make tox (we strongly encourage adding tests to your code)
  • The related documentation has been added/updated (check off the box for free if no updates is required)

@coveralls
Copy link

coveralls commented Aug 10, 2023

Pull Request Test Coverage Report for Build 5849122162

  • 34 of 34 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 5788118002: 0.0%
Covered Lines: 9143
Relevant Lines: 9143

💛 - Coveralls

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Strategos1 , thank you for adding new countries to Python Holidays! Please look at suggestions below.

Comment on lines 63 to 65
if year >= 1981:
# Independence Day
self._add_holiday("Independence Day", JUL, 30)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if year >= 1981:
# Independence Day
self._add_holiday("Independence Day", JUL, 30)
# Independence Day
self._add_holiday("Independence Day", JUL, 30)

As we have no holidays until 1981.

self._add_christmas_day("Christmas Day")

# Family day
self._add_holiday("Family Day", DEC, 26)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self._add_holiday("Family Day", DEC, 26)
self._add_christmas_day_two("Family Day")

# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from holidays.constants import FEB, MAR, JUL, OCT, NOV, DEC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from holidays.constants import FEB, MAR, JUL, OCT, NOV, DEC
from holidays.calendars.gregorian import FEB, MAR, JUL, OCT, NOV

Comment on lines 27 to 33
def test_fater_lina_day(self):
name = "Father Lini Day"
self.assertHolidayName(name, (f"{year}-2-21" for year in range(1991, 2050)))
self.assertNoHolidayName(name, Vanuatu(years=range(1981, 1991)))
self.assertNoHoliday(
f"{year}-2-21" for year in set(range(1981, 1991)).difference({1982, 1984, 2085})
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_fater_lina_day(self):
name = "Father Lini Day"
self.assertHolidayName(name, (f"{year}-2-21" for year in range(1991, 2050)))
self.assertNoHolidayName(name, Vanuatu(years=range(1981, 1991)))
self.assertNoHoliday(
f"{year}-2-21" for year in set(range(1981, 1991)).difference({1982, 1984, 2085})
)
def test_fater_lini_day(self):
name = "Father Lini Day"
self.assertHolidayName(name, (f"{year}-02-21" for year in range(1991, 2050)))
self.assertNoHolidayName(name, Vanuatu(years=range(1981, 1991)))
self.assertNoHoliday(f"{year}-02-21" for year in range(1981, 1991))

I don't see any reasons for exceptions for 1982, 1984.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied a code from another country and forgot to change it. Sorry

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, the code is clean and tested. If no comments regarding the calendar correctness I believe it's ready for merging into beta.

Thank you @Strategos1 for such a great contribution! Great work!

tests/countries/test_vanuatu.py Outdated Show resolved Hide resolved
@arkid15r arkid15r added the ready for beta Ready to merge on beta branch label Aug 11, 2023
Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@arkid15r arkid15r merged commit a64a1e7 into vacanza:beta Aug 15, 2023
22 checks passed
@arkid15r
Copy link
Collaborator

Merged into beta, thanks for extending the list of the supported countries 👍

@arkid15r arkid15r removed the ready for beta Ready to merge on beta branch label Aug 15, 2023
This was referenced Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants