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

Sunrise/Sunset calculation hangs for a specific Date/lat/long combo #1

Closed
cracell opened this issue Aug 5, 2011 · 6 comments
Closed

Comments

@cracell
Copy link

cracell commented Aug 5, 2011

The calculations for

suntime = SunTime.new(Date.parse("2011-07-21"), 34.2578, -118.757)
suntime.sunrise #Hangs and does not complete
suntime.sunset #hangs and does not complete

Other dates for that latitude/longitude work correctly.

@cjse
Copy link
Contributor

cjse commented Aug 5, 2011

Thanks, I'll look into it.

@cracell
Copy link
Author

cracell commented Aug 9, 2011

Did some research on this today.

It looks like it's getting stuck in the "def recalculate_m" (sun_time.rb line 97) loop. I don't really understand what's going on to calculate this and why it's getting stuck here for this particular combo though.

@cracell
Copy link
Author

cracell commented Oct 11, 2011

I couldn't figure out how to patch this so I ended up making a new gem https://github.com/cracell/when_sun based on this one https://github.com/joeyates/ruby-sun-times with a few patches/changes to make it a proper gem.

@nowells
Copy link

nowells commented Apr 26, 2012

@cracell looks like this has been addressed in pull request #4

@cjse
Copy link
Contributor

cjse commented Apr 27, 2012

I've merged pull request 4, that @beerlington was nice enough to provide. Should fix the issue. I'll try to release a new gem version next week.

@cjse cjse closed this as completed Apr 27, 2012
@beerlington
Copy link
Contributor

@cjkihlbom Was curious if you're still planning on releasing a new gem this week.

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

4 participants