pingswept / pysolar

Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
http://pysolar.org
GNU General Public License v3.0
372 stars 125 forks source link

Leap Seconds 2021 #139

Closed levydanqc closed 1 year ago

levydanqc commented 3 years ago

Hi, is it possible to add the leap seconds for 2021 please ?

Message : UserWarning: I don't know about leap seconds after 2020 warnings.warn \

Thank you very much !

pingswept commented 3 years ago

A patch that adds the 2021 value is welcome.

levydanqc commented 3 years ago

I added it myself, you can add (0,0) at the end of the file « solartime.py »

pingswept commented 3 years ago

Fixed in PR #140. Thanks, all.

joffreypeters commented 2 years ago

@pingswept could we get this in a released version?

pingswept commented 2 years ago

Yes, I'll try to make a release in the next few days. Feel free to post a reminder if I fail to do so.

pingswept commented 2 years ago

Hey, a new release 0.10 is up on PyPI. Please alert me here if anything is amiss. The tests and validation suite all pass, and the wheel installed successfully for me from PyPI, but there could always be subtle problems.

MBARIMike commented 1 year ago

It's 2023 and I'm getting this warning:

pysolar/solartime.py:111: UserWarning: I don't know about leap seconds after 2021

Thanks for maintaining this package!

joffreypeters commented 1 year ago

How difficult would it be to use this package as a dependency to perhaps make keeping up with leap seconds easier?

https://pypi.org/project/leapseconddata/

pingswept commented 1 year ago

I guess the good news is that leap seconds will be gone in 12 years or less: https://www.nature.com/articles/d41586-022-03783-5

I think I’d rather update a text file 12 or fewer times than add another dependency.

joffreypeters commented 1 year ago

Excellent! I hadn't seen that bit of news!

dietervansteenwegen commented 1 year ago

Wanted to open a pull request with added info for june 30, 2023 (no leap seconds according to the page you reference), but there is no info for December 31st yet.

I don't really see a clean way of adding the now-known information yet, unless I can set it to (0, 0) or (0, None)...

pingswept commented 1 year ago

I just put in (0,0) as a placeholder until the Dec 31 value is announced in July. This data will be in the next release.