Implementation of `_IslamicMabimsLunar` for Improved Islamic Holiday Calculations among ASEAN countries
From a discussion in #2332
Our default Islamic calendar implementation (Saudi Arabia's Umm al-Qura) has the 2025 Eid'l Fitr estimated date as
MAR, 30, unlike the Philippines-based tentative date ofMAR, 31- which is why I want to get this fix out before the next release cycle.Long term-wise we might want to consider pre-filling ASEAN countries Islamic holiday data though since their tentative date is often very different from Arab Gulf states.
Brunei Darussalam, Malaysia, Singapore, and Indonesia started the adoption of the
New MABIMS Crescent Visibility Criteriaback in 2024 to better unify their holidays arrangements. I think we can probably use data from https://accuhijri.github.io/ as a separateislamic_mabimscalendar.Edit: additional info here https://www.muslim.sg/articles/ramadan-countdown-unity-in-diversity
Brunei Darussalam, Malaysia, and Indonesia have used the New MABIMS Crescent Visibility Criteria since 2021 as a reference for tentative date announcements, while the actual dates are still determined by "Ru'yah" (observation). In contrast, due to Singapore's weather conditions, the country has relied exclusively on "Hisāb" (astronomical calculations) since 1974, with Islamic dates observed strictly based on these calculations.
For practical reasons, the new _IslamicMabimsLunar calendar will primarily follow Singapore’s method of observance. Future dates will be calculated using AccuHijri, supplemented with historical data before 2025 whenever possible.
excerpted from Navigating Tradition and Science: SINGAPORE’S APPROACH IN DETERMINING THE HIJRI CALENDAR
Although the Philippines is not a member of MABIMS, the country could still benefit from the new _IslamicMabimsLunar calculation as well as it's closer to their actual observance than Saudi Arabia's Umm al-Qura in the default _IslamicLunar
Country Holidays Affected:
- Brunei Darussalam
- Indonesia
- Malaysia
- (the) Philippines
- Singapore
Can I work on this? Please assign
Can I work on this? Please assign
Sure
@PPsyrius Can I use ephem python library (It's good for performing high-precision astronomy computations) https://pypi.org/project/ephem/, instead of AccuHijri, https://accuhijri.github.io/
Why do you want to use a general-purpose astronomical library instead of a specialized one, which is focused on the needed tasks?
I understand using AccuHijri is simpler because all you have to do is to input year and month. But it depends on other libraries e.g., numpy, which can break over time. In contrast, ephem has zero dependencies. I think it's more mature and stable. All you have to do is to calculate how high is the moon at sunset.
Here: https://github.com/accuhijri/ahc/blob/main/requirements.txt AccuHijri uses skyfield=1.45, using any other version will cause the library to break.
So, you want to implement the calculation yourself? Okay, you can go that way. But from https://rhodesmill.org/pyephem/ :
The Skyfield astronomy library should be preferred over PyEphem for new projects. Its modern design encourages better Python code, and uses NumPy to accelerate its calculations.
My work so far:
- Created the class _IslamicMabimsLunar ( uses astronomical calculations instead of a fixed tabular calendar for sighting of new moon.)
- Add ephem to the dependencies.
- Implemented it for Singapore, Malaysia and Brunei.
Hello @PPsyrius I submitted a PR to fix this issue one week ago. Why didn't it pass the review yet. https://github.com/vacanza/holidays/pull/3542
can i work on this ?
@akshiDhi, sure, why not.