• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

unicode-org / icu4x / 7348597232
73%

Build:
DEFAULT BRANCH: main
Ran 28 Dec 2023 02:51PM UTC
Jobs 1
Files 888
Run time 52s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Dec 2023 02:34PM UTC coverage: 72.9% (+0.03%) from 72.873%
7348597232

push

github

web-flow
Basic Keviyah module for Hebrew Calendar (#4500)

Part of https://github.com/unicode-org/icu4x/issues/3933

This implements a module that contains efficient Hebrew calendrical
calculations using the [Four
Gates](https://en.wikipedia.org/wiki/Hebrew_calendar#The_four_gates)
method. It is more efficient than the book code (which is a good
demonstration of some algorithms but has not been mathematically
simplified, or cached in any way) and works off of the intermediate
notion of Keviyah, which is a cacheable quantity that characterizes the
type of year.


This doesn't yet plug this code into `icu_calendar`, but it does test
that it has exactly the same behavior as the book code.

I do link the sources, but I _hope_ that all the math here is explained
adequately in the comments. The sources should only need to be consulted
for the actual values of the constants. **Please let me know if this is
not the case and I'll document further**.



A thing I'm not yet sure on (which doesn't block this PR) is what should
*actually* be cached in the `icu_calendar::Hebrew` YearInfo. We
basically have two options:

- Cache just the keviyah, or perhaps YearType/StartOfYear/`is_leap`.
This is quite compact, but conversion to ISO will require computation of
the molad. `molad_details` is not a *particularly* expensive method to
call; but it's not completely cheap.
- Cache the keviyah *and* the `weeks_since_beharad`. This has danger of
blowing the bounds of an i64, though we can probably optimize it by
instead storing the RataDie of the beginning of the week, stuffing the
index of the Keviyah in the `%7` of the value, and calculating `is_leap`
from the year.

The implementation of this module makes it rather straightforward to hop
between either strategy, so it's not a big deal yet. We can benchmark
once we implement this.

129 of 153 new or added lines in 1 file covered. (84.31%)

2 existing lines in 2 files now uncovered.

46447 of 63713 relevant lines covered (72.9%)

271559.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7348597232.1 28 Dec 2023 02:51PM UTC 0
72.9
GitHub Action Run
Source Files on build 7348597232
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #7348597232
  • afb78ddd on github
  • Prev Build on main (#7346085655)
  • Next Build on main (#7354187311)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc