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

Caching for observational islamic calendar #4770

Merged
merged 9 commits into from
Apr 5, 2024

Conversation

Manishearth
Copy link
Member

@Manishearth Manishearth commented Apr 2, 2024

Progress on #3933

Doing the other three should be easy after this.

sffc
sffc previously approved these changes Apr 5, 2024

/// Marker type for Saudi islamic calendar, for use with [`IslamicBasedMarker`]
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
pub struct SaudiIslamicMarker;
Copy link
Member

Choose a reason for hiding this comment

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

question: why Saudi instead of UmmAlQura?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what the book calls this code; I'm using book names here.

@@ -17,22 +17,129 @@ const CAIRO: Location = Location {
zone: (1_f64 / 12_f64),
};

/// Common abstraction over islamic-style calendars
pub trait IslamicBasedMarker {
Copy link
Member

Choose a reason for hiding this comment

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

Thought: This crate isn't really public-facing so API doesn't matter too much, but if this were ICU4X I would probably make the trait contain only the three items that are reasonably implementable, and the things that are not implementable/overridable should go into another struct that has the trait as a generic.

pub struct IslamicCacheCalculator<M> { ... }

impl<M: IslamicBasedMarker> IslamicBasedMarker<M> { ... }

Copy link
Member Author

@Manishearth Manishearth Apr 5, 2024

Choose a reason for hiding this comment

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

I intend for some of these to be overridden in the long run for performance (it's just annoying to do now)

components/calendar/src/provider/islamic.rs Outdated Show resolved Hide resolved
components/calendar/src/islamic.rs Outdated Show resolved Hide resolved
components/calendar/src/islamic.rs Outdated Show resolved Hide resolved
@Manishearth Manishearth changed the title WIP islamic caching Caching for observational islamic calendar Apr 5, 2024
@Manishearth Manishearth marked this pull request as ready for review April 5, 2024 22:15
@Manishearth Manishearth merged commit 4044096 into unicode-org:main Apr 5, 2024
30 checks passed
@Manishearth Manishearth deleted the islamic-caching branch April 5, 2024 22:48
Manishearth added a commit that referenced this pull request Apr 19, 2024
)

Fixes #3933

Uses work from #4770 on the
remaining 3 calendars


عید مبارک!!
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.

2 participants