python-zmanim
python-zmanim copied to clipboard
Implement ComplexZmanimCalendar
Are there any plans to port over the ComplexZmanimCalendar class from KosherJava? Or is it already implemented elsewhere?
I have no plans to do this at this time. Every method of the Complex calculations can be performed using the overloaded ZmanimCalendar methods, and I didn't want the responsibility of keeping the code in sync as new opinions are being continuously added to the Complex class.
Can you give an example of how I would be able to do it with the ZmanimCalendar methods?
Do you have a specific zman and opinion you'd like an example for, or would any suffice?
Any
Here's how 5 (randomly selected) calculations may be implemented:
class ComplexZmanimCalendar(ZmanimCalendar):
def misheyakir11Point5Degrees(self):
return self.alos({'degrees': 11.5})
def sofZmanShmaMGA19Point8Degrees(self):
day_start = self.alos({'degrees': 19.8})
day_end = self.tzais({'degrees': 19.8})
return self.sof_zman_shema(day_start, day_end)
def tzaisAteretTorah(self):
return self.tzais({'offset': 40})
def bainHasmashosRT13Point5MinutesBefore7Point083Degrees(self):
timeOffset = -13.5
degreeOffset = 7 + (5.0 / 60)
return self.tzais({'degrees': degreeOffset, 'offset': timeOffset})
def tzais120Zmanis(self):
return self.tzais({'zmanis_offset': 120})
@plonibarploni can I assume this has been resolved?
Yes, but it would be nice if this was included in a readme or wiki page. Thanks
@pinnymz I know that this issue is all but resolved, however, I felt like I should say that just because it is easy to create all the methods in the ComplexZmanimCalendar class, it shouldn't mean that you can't create a bunch of convenience methods for your users. It's not like there are all new zmanim opinions popping up everyday.
I feel like someone who wants to use your repo, wouldn't want to have to keep a separate python file that implements the proper methods wherever he goes to use Python and this repo.
I know it might be a lot of work, but I believe that it would be a very good idea to implement the ComplexZmanimCalendar class to the best of your ability. The result being that someone who wants to use your repo, can just install it and use the bainHasmashosRT13Point5MinutesBefore7Point083Degrees() method right away for example.
In the end, it is your repository, so do what you want. However, I felt like I should give the idea a push. Kol Tuv!