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

Implement ComplexZmanimCalendar #5

Open
ghost opened this issue Feb 10, 2019 · 8 comments
Open

Implement ComplexZmanimCalendar #5

ghost opened this issue Feb 10, 2019 · 8 comments

Comments

@ghost
Copy link

ghost commented Feb 10, 2019

Are there any plans to port over the ComplexZmanimCalendar class from KosherJava? Or is it already implemented elsewhere?

@pinnymz
Copy link
Owner

pinnymz commented Feb 10, 2019

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.

@ghost
Copy link
Author

ghost commented Feb 10, 2019

Can you give an example of how I would be able to do it with the ZmanimCalendar methods?

@pinnymz
Copy link
Owner

pinnymz commented Feb 11, 2019

Do you have a specific zman and opinion you'd like an example for, or would any suffice?

@ghost
Copy link
Author

ghost commented Feb 11, 2019

Any

@pinnymz
Copy link
Owner

pinnymz commented Feb 11, 2019

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})

@pinnymz
Copy link
Owner

pinnymz commented Apr 3, 2019

@plonibarploni can I assume this has been resolved?

@ghost
Copy link
Author

ghost commented Apr 3, 2019

Yes, but it would be nice if this was included in a readme or wiki page. Thanks

@Elyahu41
Copy link

Elyahu41 commented Jul 2, 2021

@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!

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

No branches or pull requests

2 participants