diff -Nru pyhamtools-0.7.7/debian/changelog pyhamtools-0.7.9/debian/changelog --- pyhamtools-0.7.7/debian/changelog 2021-08-31 08:14:23.000000000 +0000 +++ pyhamtools-0.7.9/debian/changelog 2022-01-04 17:13:08.000000000 +0000 @@ -1,3 +1,9 @@ +pyhamtools (0.7.9-1) unstable; urgency=medium + + * New upstream version. + + -- Christoph Berg Tue, 04 Jan 2022 18:13:08 +0100 + pyhamtools (0.7.7-1) unstable; urgency=medium * New upstream version. diff -Nru pyhamtools-0.7.7/debian/watch pyhamtools-0.7.9/debian/watch --- pyhamtools-0.7.7/debian/watch 2019-12-16 08:40:33.000000000 +0000 +++ pyhamtools-0.7.9/debian/watch 2021-12-14 09:44:49.000000000 +0000 @@ -1,2 +1,2 @@ version=4 -https://github.com/dh1tw/pyhamtools/releases .*/v(.*).tar.gz +https://github.com/dh1tw/pyhamtools/tags .*/v(.*).tar.gz diff -Nru pyhamtools-0.7.7/docs/source/changelog.rst pyhamtools-0.7.9/docs/source/changelog.rst --- pyhamtools-0.7.7/docs/source/changelog.rst 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/docs/source/changelog.rst 2021-12-15 23:09:06.000000000 +0000 @@ -1,6 +1,22 @@ Changelog --------- +PyHamtools 0.7.9 +================ + +16. December 2021 + +* Calculating sunrise and sunset close to the artic region raised a ValueError due + to a bug in the underlying 3rd party libary ephem. This release upgrades the + dependency to ephem > 4.1.3 which has the bug already fixed. + +PyHamTools 0.7.8 +================ + +04. December 2021 + +* Updated Clublog's (CDN based) URL for downloading the Prefixes and Exceptions XML + PyHamTools 0.7.7 ================ diff -Nru pyhamtools-0.7.7/.gitignore pyhamtools-0.7.9/.gitignore --- pyhamtools-0.7.7/.gitignore 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/.gitignore 2021-12-15 23:09:06.000000000 +0000 @@ -1,8 +1,11 @@ docs/build +build/ +dist/ settings.json apikeysrc coverage* .coverage +.python-version .cache/* MANIFEST .DS_Store diff -Nru pyhamtools-0.7.7/pyhamtools/lookuplib.py pyhamtools-0.7.9/pyhamtools/lookuplib.py --- pyhamtools-0.7.7/pyhamtools/lookuplib.py 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/pyhamtools/lookuplib.py 2021-12-15 23:09:06.000000000 +0000 @@ -978,7 +978,7 @@ return lookup def _load_clublogXML(self, - url="https://secure.clublog.org/cty.php", + url="https://cdn.clublog.org/cty.php", apikey=None, cty_file=None): """ Load and process the ClublogXML file either as a download or from file diff -Nru pyhamtools-0.7.7/pyhamtools/version.py pyhamtools-0.7.9/pyhamtools/version.py --- pyhamtools-0.7.7/pyhamtools/version.py 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/pyhamtools/version.py 2021-12-15 23:09:06.000000000 +0000 @@ -1,3 +1,3 @@ -VERSION = (0, 7, 7) +VERSION = (0, 7, 9) __release__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:] __version__ = '.'.join((str(VERSION[0]), str(VERSION[1]))) diff -Nru pyhamtools-0.7.7/README.md pyhamtools-0.7.9/README.md --- pyhamtools-0.7.7/README.md 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/README.md 2021-12-15 23:09:06.000000000 +0000 @@ -13,12 +13,12 @@ provided for the following sources: Currently, -* [AD1C's Country-Files.org](http://country-files.org) +* [AD1C's Amateur Radio Country Files](https://www.country-files.com) * [Clublog Prefixes & Exceptions XML File](https://clublog.freshdesk.com/support/articles/54902-downloading-the-prefixes-and-exceptions-as) * [Clublog DXCC Query API](http://clublog.freshdesk.com/support/articles/54904-how-to-query-club-log-for-dxcc) * [QRZ.com XML API](http://www.qrz.com/XML/current_spec.html) * [Redis.io](http://redis.io) -* [ARRL Logbook of the World (LOTW)](http://https://lotw.arrl.org) +* [ARRL Logbook of the World (LOTW)](https://lotw.arrl.org) * [eQSL.cc user list](https://www.eqsl.cc) * [Clublog & OQRS user list](http://clublog.freshdesk.com/support/solutions/articles/3000064883-list-of-club-log-and-lotw-users) diff -Nru pyhamtools-0.7.7/setup.py pyhamtools-0.7.9/setup.py --- pyhamtools-0.7.7/setup.py 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/setup.py 2021-12-15 23:09:06.000000000 +0000 @@ -18,7 +18,7 @@ install_requires=[ "pytz>=2019.1", "requests>=2.21.0", - "pyephem>=3.7.6.0", + "ephem>=4.1.3", "beautifulsoup4>=4.7.1", "future>=0.17.1", "redis>=2.10.6", diff -Nru pyhamtools-0.7.7/test/test_locator_sunrise_sunset.py pyhamtools-0.7.9/test/test_locator_sunrise_sunset.py --- pyhamtools-0.7.7/test/test_locator_sunrise_sunset.py 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/test/test_locator_sunrise_sunset.py 2021-12-15 23:09:06.000000000 +0000 @@ -25,17 +25,30 @@ assert calculate_sunrise_sunset(locator, test_time)['sunset'] - result_JN48QM_1_1_2014_sunset < time_margin assert calculate_sunrise_sunset(locator, test_time)['sunrise'] - result_JN48QM_1_1_2014_sunrise < time_margin - def test_calculate_distance_edge_case(self): + + def test_calculate_sunrise_sunset_with_sun_never_rising(self): + + time_margin = timedelta(minutes=1) + locator = "IQ50PW" + # The sun never rises in winter time close to the north pole (e.g. at Jan Mayen) + # Therefore we expect no sunrise or sunset. + + test_time = datetime(year=2021, month=12, day=15, tzinfo=UTC) + + assert calculate_sunrise_sunset(locator, test_time)['morning_dawn'] == None + assert calculate_sunrise_sunset(locator, test_time)['evening_dawn'] == None + assert calculate_sunrise_sunset(locator, test_time)['sunset'] == None + assert calculate_sunrise_sunset(locator, test_time)['sunrise'] == None + + + def test_calculate_sunrise_sunset_with_sun_never_setting(self): time_margin = timedelta(minutes=1) locator = "AA00AA" - # no sunrise or sunset at southpol during arctic summer + # The sun never sets at the south pole during arctic summer + # Therefore we expect no sunrise or sunset. test_time = datetime(year=2014, month=1, day=1, tzinfo=UTC) - result_AA00AA_1_1_2014_evening_dawn = datetime(2014, 1, 1, 15, 38, tzinfo=UTC) - result_AA00AA_1_1_2014_morning_dawn = datetime(2014, 1, 1, 6, 36, tzinfo=UTC) - result_AA00AA_1_1_2014_sunrise = datetime(2014, 1, 1, 7, 14, tzinfo=UTC) - result_AA00AA_1_1_2014_sunset = datetime(2014, 1, 1, 16, 15, 23, 31016, tzinfo=UTC) assert calculate_sunrise_sunset(locator, test_time)['morning_dawn'] == None assert calculate_sunrise_sunset(locator, test_time)['evening_dawn'] == None diff -Nru pyhamtools-0.7.7/test/test_lookuplib_clublogxml.py pyhamtools-0.7.9/test/test_lookuplib_clublogxml.py --- pyhamtools-0.7.7/test/test_lookuplib_clublogxml.py 2021-06-01 01:27:32.000000000 +0000 +++ pyhamtools-0.7.9/test/test_lookuplib_clublogxml.py 2021-12-15 23:09:06.000000000 +0000 @@ -119,23 +119,6 @@ #TESTS #=========================================================== - -class TestClublogXML_Constructor: - - def test_with_invalid_api_key(self): - with pytest.raises(APIKeyMissingError): - lib = LookupLib(lookuptype="clublogxml", apikey="foo") - lib.lookup_entity(230) - - def test_with_no_api_key(self): - with pytest.raises(APIKeyMissingError): - lib = LookupLib(lookuptype="clublogxml") - lib.lookup_entity(230) - - def test_with_file(self, fix_cty_xml_file): - lib = LookupLib(lookuptype="clublogxml", filename=fix_cty_xml_file) - assert lib.lookup_entity(230) == response_Entity_230 - class TestclublogXML_Getters: #lookup_entity(callsign) @@ -267,14 +250,6 @@ with pytest.raises(KeyError): fixClublogXML.is_invalid_operation("5W1CFN", timestamp_before) - #Invalid Operation with end date - timestamp_before = datetime(year=2004, month=4, day=2).replace(tzinfo=UTC) - with pytest.raises(KeyError): - fixClublogXML.is_invalid_operation("T33C") - - assert fixClublogXML.is_invalid_operation("T33C", timestamp_before) - - #lookup_zone_exception(callsign, [date]) #====================================