Giter VIP home page Giter VIP logo

Comments (5)

Swamp-Ig avatar Swamp-Ig commented on June 15, 2024 1

I haven't thought about this for well over a year, and I really can't remember much about it as I'm doing other things.

It would seem from what you said yes, but I can't really confirm or deny.

Basically the problem was that on some days in very Northern latitudes, the sun would only set and not rise, or something of that nature. If this isn't happening anymore, then I guess the answer would be yes.

from astral.

amitfin avatar amitfin commented on June 15, 2024

@Swamp-Ig, it seems that this issue was fixed in version 2.0. You pointed this test case but with v2 it was fixed and the passing test case can be found here.
Can you please verify that this issue no longer exists with the latest version, so we can close it?

from astral.

Swamp-Ig avatar Swamp-Ig commented on June 15, 2024

Hi, sorry I haven't looked at this for a very long time. I seem to remember providing a test case somewhere that demonstrated the issue when I submitted it as part of another submitted issue, it was quite a while ago now though.

from astral.

hudcap avatar hudcap commented on June 15, 2024

@Swamp-Ig You mentioned this test case in #35 and another test case for #36

from astral.

amitfin avatar amitfin commented on June 15, 2024

I think that all other test cases where fixed as well with version 2.

Anyway, the following test demonstrates that this issue doesn't exist anymore:

>>> import astral
>>> import astral.sun
>>> import datetime
>>>
>>> def _next_event(event, observer, date):
...   for offset in range(0, 365):
...     try:
...       return getattr(astral.sun, event)(
...         observer, date + datetime.timedelta(days=offset))
...     except ValueError:
...       pass
...
>>> date = datetime.datetime(2019, 7, 5)
>>> observer = astral.Observer(69.6, 18.8, 0.0)
>>> sunrise = _next_event('sunrise', observer, date)
>>> sunset = _next_event('sunset', observer, date)
>>> sunset < sunrise
True
>>> sunrise
datetime.datetime(2019, 7, 25, 23, 11, 15, 370224, tzinfo=<UTC>)
>>> sunset
datetime.datetime(2019, 7, 25, 22, 34, 55, 924228, tzinfo=<UTC>)

The next sunset is indeed before next sunrise, as expected.

@Swamp-Ig, should we close the issue based on the above results?

from astral.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.