Skip to content

Commit 047b642

Browse files
committed
pylint nmea fixes
1 parent 2b2c322 commit 047b642

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

gnss_lib_py/parsers/nmea.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
__authors__ = "Adam Dai, Shubh Gupta, Derek Knowles"
66
__date__ = "16 Jul 2021"
77

8+
import datetime
9+
810
import pynmea2
911
import numpy as np
1012
import pandas as pd
11-
import calendar
12-
import datetime
13-
import warnings
13+
from pynmea2.nmea_utils import timestamp, datestamp
1414

1515
from gnss_lib_py.parsers.navdata import NavData
1616
from gnss_lib_py.utils.coordinates import geodetic_to_ecef
1717
from gnss_lib_py.utils.time_conversions import datetime_to_gps_millis
18-
from pynmea2.nmea_utils import timestamp, datestamp
1918

2019
class Nmea(NavData):
2120
"""Class used to parse through NMEA files
@@ -68,10 +67,10 @@ def __init__(self, filename, msg_types=None,
6867
for line in open_file:
6968
check_ind = line.find('*')
7069
if not check and '*' in line:
71-
# This is the case where a checksum exists but
72-
# the user wants to ignore it
73-
check_ind = line.find('*')
74-
line = line[:check_ind]
70+
# This is the case where a checksum exists but
71+
# the user wants to ignore it
72+
check_ind = line.find('*')
73+
line = line[:check_ind]
7574
try:
7675
msg = pynmea2.parse(line, check = check)
7776
if 'timestamp' in list(msg.name_to_idx.keys()):
@@ -125,8 +124,7 @@ def __init__(self, filename, msg_types=None,
125124
# to radians
126125
pd_df['true_course_rad'] = (np.pi/180.)*pd_df['true_course'].astype(float)
127126
# Convert the given altitude value to float based on the given units
128-
# TODO: Check which of the two (ellipsoidal and geoidal, values
129-
# we use)
127+
130128
# Assuming that altitude units are always meters
131129
pd_df['altitude'] = pd_df['altitude'].astype(float)
132130
super().__init__(pandas_df=pd_df)
@@ -166,5 +164,3 @@ def include_ecef(self):
166164
self['x_rx_m'] = ecef[0,:]
167165
self['y_rx_m'] = ecef[1,:]
168166
self['z_rx_m'] = ecef[2,:]
169-
170-

0 commit comments

Comments
 (0)