ANNOUNCE DateTime::Event::Sunrise 0.0503, and possible evolution for 0.0504

[email protected] (Jean Forget) Fri, 18 Oct 2013 07:31:33 +0200
Newsgroups perl.datetime
Message-ID <1382074293.2874.18.camel@jf-xubuntu>
I have released the 0.0503 version of 
DateTime::Event::Sunrise. This version closes
the three remaining RT tickets:
https://rt.cpan.org/Ticket/Display.html?id=8065
https://rt.cpan.org/Ticket/Display.html?id=36532
https://rt.cpan.org/Ticket/Display.html?id=77710
The POD documentation has been reorganized,
some unknown bugs may have been fixed :-)
and some other unknown bugs may have been added :-(

There is still a point I am not satisfied with.
Since it involves ergonomy and API, I ask for
your advice.

When trying to compute a sunrise or sunset for
a location beyond the Arctic circle, the module
emits a warning "Sun never rises" or "Sun never
sets". It may bother some programmers, who would
prefer a silent module returning a status code
(just like Paul Schlyter's C code does) and who would
prefer not to tinker with $SIG{__WARN__}.

Several fixes are possible:

1) adding new methods "sun_does_rise" and "sun_does_set".

2) adding new methods "no_sunrise" and "no_sunset". 
Problem, there is a negation in the method name, 
so users may be confused by a "true" return value: 
does it mean that "there is no sunrise" is true, 
or does it mean that "there is a sunrise"?

3) add a new method, which returns several values
organized as a hash (or hashref):
{ sunrise_exists => 1,
  sunrise_datetime => ...,
  sunset_exists => 1,
  sunset_datetime => ... }

4) variant of (3), create a new class
DT::E::Sunrise::SingleDay
which applies to:
-- a single location (long+lat)
-- a single date
-- and a single set of technical parameters 
(sun altitude, precise algorithm,
upper limb correction).

The "sunrise_exists" and other elements would be
object accessors.

Thank you for your advices,

Jean Forget