You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the polar regions, the sun may stay up the whole day (midnight sun) or may stay down the whole day (polar night). In both cases, we raise the same exception:
returnNone# The sun never rises on this location (on the specified date)
ifcosH<-1:
returnNone# The sun never sets on this location (on the specified date)
it seems that the algorithm knows whether we have midnight sun or polar night.
Could you raise a different exception depending on whether we have midnight sun or polar night?
If you agree that this is a useful feature I can try to make a PR.
The text was updated successfully, but these errors were encountered:
rfjakob
changed the title
Feature request: report whether sun is always up or always down
Feature request: report whether we have midnight sun or polar night
Jul 10, 2024
rfjakob
added a commit
to rfjakob/suntime
that referenced
this issue
Jul 11, 2024
Instead of just raising SunTimeException, report
whether we have midnight sun or polar night.
Implemented in a backwards-compatible way by
subclassing SunTimeException.
That catching SunTimeException still works as before
is verified by extending the tests.
FixesSatAgro#32
Instead of just raising SunTimeException, report
whether we have midnight sun or polar night.
Implemented in a backwards-compatible way by
subclassing SunTimeException.
That catching SunTimeException still works as before
is verified by extending the tests.
FixesSatAgro/suntime#32
Upstream PR:
SatAgro/suntime@0b59d7b
+1 this request, came here looking for this. My use case is computing hours of daylight at a location, so a more specific exception would help me distinguish 0 vs 24 hours.
In the polar regions, the sun may stay up the whole day (midnight sun) or may stay down the whole day (polar night). In both cases, we raise the same exception:
suntime/suntime/suntime.py
Line 36 in 8053379
It would be useful to know whether we have sunlight the whole day or night the whole day.
Looking at
suntime/suntime/suntime.py
Lines 104 to 107 in 8053379
it seems that the algorithm knows whether we have midnight sun or polar night.
Could you raise a different exception depending on whether we have midnight sun or polar night?
If you agree that this is a useful feature I can try to make a PR.
The text was updated successfully, but these errors were encountered: