Skip to content

Commit 8523a21

Browse files
committed
Fixed issue with num_cols
1 parent ead1f77 commit 8523a21

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

gnss_lib_py/navdata/navdata.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ class NavData():
5050
str_map : Dict
5151
Map of the form {pandas column name : {array value : string}}.
5252
Map is of the form {pandas column name : {}} for non string rows.
53-
num_cols : int
54-
Number of columns in array containing data, set to 0 by default
55-
for empty NavData
5653
curr_cols : int
5754
Current number of column for iterator, set to 0 by default
5855
@@ -70,7 +67,6 @@ def __init__(self, csv_path=None, pandas_df=None, numpy_array=None,
7067
# Attributes for looping over all columns
7168

7269
self.curr_col = 0
73-
self.num_cols = 0
7470

7571
if csv_path is not None:
7672
self.from_csv_path(csv_path, **kwargs)
@@ -81,6 +77,7 @@ def __init__(self, csv_path=None, pandas_df=None, numpy_array=None,
8177
else:
8278
self._build_navdata()
8379

80+
8481
if len(self) > 0:
8582
self.rename(self._row_map(), inplace=True)
8683
self.postprocess()
@@ -694,6 +691,18 @@ def shape(self):
694691
shp = np.shape(self.array)
695692
return shp
696693

694+
@property
695+
def num_cols(self):
696+
"""Return the number of columns in the NavData instance.
697+
698+
Returns
699+
-------
700+
num_cols : int
701+
Number of columns in the NavData instance.
702+
"""
703+
num_cols = self.shape[1]
704+
return num_cols
705+
697706
@property
698707
def rows(self):
699708
"""Return all row names in instance as a list
@@ -879,7 +888,6 @@ def __iter__(self):
879888
Instantiation of NavData class with iteration initialized
880889
"""
881890
self.curr_col = 0
882-
self.num_cols = np.shape(self.array)[1]
883891
return self
884892

885893
def __next__(self):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "gnss-lib-py"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Modular Python tool for parsing, analyzing, and visualizing Global Navigation Satellite Systems (GNSS) data and state estimates"
55
authors = ["Derek Knowles <dcknowles@stanford.edu>",
66
"Ashwin Kanhere <akanhere@stanford.edu>",

tests/utils/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def pytest_collection_modifyitems(items):
3838

3939
module_mapping = {item: item.module.__name__ for item in items}
4040
download_tests = [
41-
"test_ephemeris_downloader"
41+
"test_ephemeris_downloader",
42+
"test_rinex_nav",
43+
"test_rinex_obs"
4244
]
4345
sorted_items = [item for item in items if module_mapping[item] not in download_tests] \
4446
+ [item for item in items if module_mapping[item] in download_tests]

0 commit comments

Comments
 (0)