Bug#574749: first day of spring badly broken (w/o iteration)
Joey Hess
joeyh at debian.org
Sat Mar 20 19:02:34 UTC 2010
Package: libdatetime-astro-sunrise-perl
Version: 0.01.01-2
Severity: normal
I use this library a lot in planning my days, and it generally is fairly
spot on, within a few minutes. Today, it has gone crazy. Today is the
first day of spring, and in the EDT timezone, according to wund.com
sunrise here is 7:32, and sunset at 19:40 -- just over 12 hours of daylight.
Now look what the library says:
perl -le 'use DateTime::Astro::Sunrise; $s=DateTime::Astro::Sunrise->new(-82, 36); print join("\n", map { scalar localtime($_->epoch) } $s->sunrise(DateTime->now))'
Sat Mar 20 11:04:00 2010
Sat Mar 20 16:06:00 2010
Where did the other 5 hours of daylight go? The sun never rises at 11 am
here, at any time of the year!
Iteration seems to be needed today to get good values:
perl -le 'use DateTime::Astro::Sunrise; my $s=DateTime::Astro::Sunrise->new(-82, 36, undef, 1); print join("\n", map { scalar localtime($_->epoch) } $s->sunrise(DateTime->now))'
Sat Mar 20 07:26:00 2010
Sat Mar 20 19:40:00 2010
The man page makes it sound as if iteration is only needed in "the land
of the midnight sun"; I'm several thousand miles from there. So this
could be considered a doc bug. However, being so far off, at such a
populated latitude as mine (basically the same latitude as eg, San
Francisco) seems to mean that iteration is basically needed all the
time.
This seems to be basically the same bug as
<https://rt.cpan.org/Public/Bug/Display.html?id=34770> (which affected
Paris). I have not figured out the relationship between
DateTime::Astro::Sunrise and DateTime::Event::Sunrise, but I assume one
is based on the other. From that bug report:
| Then, I looked for Paul Schlyter's code. I found that you
| made a mistake, confusing the variables for the Sun's right ascension
| and for its distance from Earth. Here is the patch with
| the bugfix.
(patch also contains some unrelated changes)
BTW, https://rt.cpan.org/Public/Bug/Display.html?id=36532 probably also
affects this module, and has a patch.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libdatetime-astro-sunrise-perl depends on:
ii libdatetime-perl 2:0.5200-1 module for manipulating dates, tim
ii perl 5.10.1-11 Larry Wall's Practical Extraction
libdatetime-astro-sunrise-perl recommends no packages.
libdatetime-astro-sunrise-perl suggests no packages.
-- no debconf information
--
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20100320/ea291cc5/attachment.pgp>
More information about the pkg-perl-maintainers
mailing list