mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2025-12-06 06:52:00 +01:00
commit
13efbc11d6
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
PYTHON_VERSION: ${{ matrix.python-version }}
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
||||||
# delay the execution randomly by 1-20sec to reduce the
|
# delay the execution randomly by 1-20sec to reduce the
|
||||||
# amount of concurrent API calls on Clublog and QRZ.com
|
# amount of concurrent API calls on Clublog and QRZ.com
|
||||||
# when all CI jobs execute simultaniously
|
# when all CI jobs execute simultaneously
|
||||||
run: |
|
run: |
|
||||||
sleep $[ ( $RANDOM % 20 ) + 1 ]s
|
sleep $[ ( $RANDOM % 20 ) + 1 ]s
|
||||||
pytest --cov=./
|
pytest --cov=./
|
||||||
|
|
@ -94,6 +94,6 @@ jobs:
|
||||||
# PYTHON_VERSION: ${{ matrix.python-version }}
|
# PYTHON_VERSION: ${{ matrix.python-version }}
|
||||||
# # delay the execution randomly by 1-20sec to reduce the
|
# # delay the execution randomly by 1-20sec to reduce the
|
||||||
# # amount of concurrent API calls on Clublog and QRZ.com
|
# # amount of concurrent API calls on Clublog and QRZ.com
|
||||||
# # when all CI jobs execute simultaniously
|
# # when all CI jobs execute simultaneously
|
||||||
# run: |
|
# run: |
|
||||||
# pytest
|
# pytest
|
||||||
|
|
@ -16,7 +16,7 @@ PyHamtools 0.7.9
|
||||||
16. December 2021
|
16. December 2021
|
||||||
|
|
||||||
* Calculating sunrise and sunset close to the artic region raised a ValueError due
|
* 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
|
to a bug in the underlying 3rd party library ephem. This release upgrades the
|
||||||
dependency to ephem > 4.1.3 which has the bug already fixed.
|
dependency to ephem > 4.1.3 which has the bug already fixed.
|
||||||
|
|
||||||
PyHamTools 0.7.8
|
PyHamTools 0.7.8
|
||||||
|
|
@ -188,7 +188,7 @@ PyHamTools 0.5.0
|
||||||
|
|
||||||
* corrected Longitude to General Standard (-180...0° West, 0...180° East) [LookupLib]
|
* corrected Longitude to General Standard (-180...0° West, 0...180° East) [LookupLib]
|
||||||
|
|
||||||
* improved callsign decoding alogrithm [CallInfo]
|
* improved callsign decoding algorithm [CallInfo]
|
||||||
|
|
||||||
* added special case to decode location of VK9 callsigns [CallInfo]
|
* added special case to decode location of VK9 callsigns [CallInfo]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ Decode a Callsign and get Country name, ADIF ID, Latitude & Longitude
|
||||||
|
|
||||||
In this example we will use AD1C's Country-files.com database to perform the lookup.
|
In this example we will use AD1C's Country-files.com database to perform the lookup.
|
||||||
|
|
||||||
First we need to instanciate a LookupLib object for Country-files.com database. The latest database will be downloaded automatically.
|
First we need to instantiate a LookupLib object for Country-files.com database. The latest database will be downloaded automatically.
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ First we need to instanciate a LookupLib object for Country-files.com database.
|
||||||
>>> my_lookuplib = LookupLib(lookuptype="countryfile")
|
>>> my_lookuplib = LookupLib(lookuptype="countryfile")
|
||||||
|
|
||||||
|
|
||||||
Next, a Callinfo object needs to be instanciated. The lookuplib object will be injected on construction.
|
Next, a Callinfo object needs to be instantiated. The lookuplib object will be injected on construction.
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ class Callinfo(object):
|
||||||
if len(re.findall(r'\d+', callsign)) == 1: #call has just on digit e.g. DH1TW
|
if len(re.findall(r'\d+', callsign)) == 1: #call has just on digit e.g. DH1TW
|
||||||
callsign = re.sub('[\d]+', area_nr, callsign)
|
callsign = re.sub('[\d]+', area_nr, callsign)
|
||||||
else: # call has several digits e.g. 7N4AAL
|
else: # call has several digits e.g. 7N4AAL
|
||||||
pass # no (two) digit prefix contries known where appendix would change entitiy
|
pass # no (two) digit prefix countries known where appendix would change entity
|
||||||
return self._iterate_prefix(callsign, timestamp)
|
return self._iterate_prefix(callsign, timestamp)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class LookupLib(object):
|
||||||
lookup against the Clublog API or QRZ.com.
|
lookup against the Clublog API or QRZ.com.
|
||||||
|
|
||||||
The entire lookup data (where database files are downloaded) can also be copied into Redis, which an extremely
|
The entire lookup data (where database files are downloaded) can also be copied into Redis, which an extremely
|
||||||
fast in-memory Key/Value store. A LookupLib object can be instanciated to perform then all lookups in Redis,
|
fast in-memory Key/Value store. A LookupLib object can be instantiated to perform then all lookups in Redis,
|
||||||
instead processing and loading the data from Internet / File. This saves some time and allows several instances
|
instead processing and loading the data from Internet / File. This saves some time and allows several instances
|
||||||
of :py:class:`LookupLib` to query the same data concurrently.
|
of :py:class:`LookupLib` to query the same data concurrently.
|
||||||
|
|
||||||
|
|
@ -1147,7 +1147,7 @@ class LookupLib(object):
|
||||||
if len(cty_header) == 2:
|
if len(cty_header) == 2:
|
||||||
self._logger.debug("Header successfully retrieved from CTY File")
|
self._logger.debug("Header successfully retrieved from CTY File")
|
||||||
elif len(cty_header) < 2:
|
elif len(cty_header) < 2:
|
||||||
self._logger.warning("Header could only be partically retrieved from CTY File")
|
self._logger.warning("Header could only be partially retrieved from CTY File")
|
||||||
self._logger.warning("Content of Header: ")
|
self._logger.warning("Content of Header: ")
|
||||||
for key in cty_header:
|
for key in cty_header:
|
||||||
self._logger.warning(str(key)+": "+str(cty_header[key]))
|
self._logger.warning(str(key)+": "+str(cty_header[key]))
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from io import BytesIO
|
||||||
from requests.exceptions import ConnectionError, HTTPError, Timeout
|
from requests.exceptions import ConnectionError, HTTPError, Timeout
|
||||||
|
|
||||||
def get_lotw_users(**kwargs):
|
def get_lotw_users(**kwargs):
|
||||||
"""Download the latest offical list of `ARRL Logbook of the World (LOTW)`__ users.
|
"""Download the latest official list of `ARRL Logbook of the World (LOTW)`__ users.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
url (str, optional): Download URL
|
url (str, optional): Download URL
|
||||||
|
|
@ -69,7 +69,7 @@ def get_lotw_users(**kwargs):
|
||||||
return lotw
|
return lotw
|
||||||
|
|
||||||
def get_clublog_users(**kwargs):
|
def get_clublog_users(**kwargs):
|
||||||
"""Download the latest offical list of `Clublog`__ users.
|
"""Download the latest official list of `Clublog`__ users.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
url (str, optional): Download URL
|
url (str, optional): Download URL
|
||||||
|
|
@ -150,7 +150,7 @@ def get_clublog_users(**kwargs):
|
||||||
except TypeError: #some date fields contain null instead of a valid datetime string - we ignore them
|
except TypeError: #some date fields contain null instead of a valid datetime string - we ignore them
|
||||||
print("Ignoring invalid type in data:", call, call_data)
|
print("Ignoring invalid type in data:", call, call_data)
|
||||||
pass
|
pass
|
||||||
except ValueError: #some date fiels are invalid. we ignore them for the moment
|
except ValueError: #some date fields are invalid. we ignore them for the moment
|
||||||
print("Ignoring invalid data:", call, call_data)
|
print("Ignoring invalid data:", call, call_data)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue