Skip to content

Commit

Permalink
Merge pull request #25 from semuconsulting/RC-1.0.6
Browse files Browse the repository at this point in the history
Rc 1.0.6
  • Loading branch information
semuadmin committed Apr 4, 2023
2 parents fd49e1d + db224ae commit 6af4d9b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ Fixes # (issue)

## Testing

Please test all changes, however trivial, against the supplied unittest suite `tests/test_*.py` e.g. by executing the `tests/testsuite.py` module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.
Please test all changes, however trivial, against the supplied pytest suite `tests/test_*.py`. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.

- [ ] Test A
- [ ] Test B

## Checklist:

- [ ] I agree to abide by the code of conduct (see [CODE_OF_CONDUCT.md](https://github.com/semuconsulting/pygnssutils/blob/master/CODE_OF_CONDUCT.md)).
- [ ] My code follows the style guidelines of this project (see `CONTRIBUTING.MD`).
- [ ] I have performed a self-review of my own code.
- [ ] (*if appropriate*) I have cited my u-blox documentation source(s).
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"editor.formatOnSave": true,
"modulename": "${workspaceFolderBasename}",
"distname": "${workspaceFolderBasename}",
"moduleversion": "1.0.5"
"moduleversion": "1.0.6"
}
9 changes: 8 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"build",
".",
"--wheel",
"--sdist",
],
"problemMatcher": []
},
Expand All @@ -114,7 +115,13 @@
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pytest"
"pytest",
"--cov-report",
"html",
"--cov-fail-under",
"30",
"--cov=${config:distname}",
"tests/",
],
"problemMatcher": []
},
Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# pygnssutils Release Notes

### RELEASE 1.0.6

1. superfluous haversine helper, latlon2dms and latlon2dmm methods removed - use pynmeagps helpers instead
1. Minimum pyubx2 version updated to 1.2.23
1. Minimum pyspartn version updated to 0.1.4
1. Minor updates to VSCode tasks and GitHub actions for pyproject.toml build framework

### RELEASE 1.0.5

FIXES:
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ maintainers = [
{name = "semuadmin", email = "[email protected]"}
]
description = "GNSS Command Line Utilities"
version = "1.0.5"
version = "1.0.6"
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"License :: OSI Approved ::BSD License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Environment :: MacOS X",
Expand All @@ -39,8 +38,8 @@ classifiers = [
]

dependencies = [
"pyubx2>=1.2.22",
"pyspartn>=0.1.3",
"pyubx2>=1.2.23",
"pyspartn>=0.1.4",
"pyserial>=3.5",
"paho-mqtt>=1.6.1",
]
Expand Down Expand Up @@ -85,7 +84,7 @@ disable = """

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--cov --cov-report html --cov-report term-missing"
addopts = "--cov --cov-report term-missing"
pythonpath = ["src"]

[tool.coverage.run]
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyubx2>=1.2.22
pyspartn>=0.1.3
pyubx2>=1.2.23
pyspartn>=0.1.4
pyserial>=3.5
paho-mqtt>=1.6.1
2 changes: 1 addition & 1 deletion src/pygnssutils/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.0.5"
__version__ = "1.0.6"
48 changes: 1 addition & 47 deletions src/pygnssutils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,8 @@

from math import sin, cos, radians
from pyubx2 import itow2utc
from pynmeagps import haversine as hsine, latlon2dms as ll2dms, latlon2dmm as ll2dmm


def haversine(
lat1: float, lon1: float, lat2: float, lon2: float, radius: float = 6378.137
) -> float:
"""
For backward compatibility - method now available from pynmeagps library.
Calculate spherical distance in km between two coordinates using haversine formula.
:param float lat1: lat1
:param float lon1: lon1
:param float lat2: lat2
:param float lon2: lon2
:param float radius: radius in km (Earth = 6378.137 km)
:return: spherical distance in km
:rtype: float
"""

return hsine(lat1, lon1, lat2, lon2, radius)


def latlon2dms(latlon: tuple) -> str:
"""
For backward compatibility - method now available from pynmeagps library.
Convert decimal lat/lon to D.M.S format.
:param tuple latlon (lat, lon) as tuple
:return: lat lon in DMS format
:rtype: str
"""

lat, lon = latlon
return ll2dms(lat, lon)


def latlon2dmm(latlon: tuple) -> str:
"""
For backward compatibility - method now available from pynmeagps library.
Convert decimal lat/lon to D.M.M format.
:param tuple latlon (lat, lon) as tuple
:return: lat lon in DMM format
:rtype: str
"""

lat, lon = latlon
return ll2dmm(lat, lon)
from pynmeagps import haversine


def get_mp_distance(lat: float, lon: float, mp: list) -> float:
Expand Down

0 comments on commit 6af4d9b

Please sign in to comment.