Skip to content

Commit f188c6b

Browse files
committed
Merge remote-tracking branch 'origin/v0.1.9' into derek/namespacing
2 parents 3f689ed + b825613 commit f188c6b

6 files changed

Lines changed: 146 additions & 40 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ name: build
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches:
9+
- main
10+
- v*.*.*
911
pull_request:
10-
branches: [ main ]
12+
branches:
13+
- main
14+
- v*.*.*
1115
workflow_dispatch:
1216

1317
jobs:

.github/workflows/pip-install.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: pip-install
22

33
on:
44
pull_request:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
- v*.*.*
68
workflow_dispatch:
79

810

.github/workflows/pylint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: pylint
22

33
on:
44
pull_request:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
- v*.*.*
68
workflow_dispatch:
79

810
jobs:

docs/source/contributing/development.rst

Lines changed: 102 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,35 @@
33
Development Guides
44
==================
55

6-
Here are a set of detailed guides depending on if you are a public user,
7-
Stanford NAV Lab member, or a project maintainer.
6+
Here are a set of detailed guides depending on if you are a :ref:`public user<standard_dev>`,
7+
:ref:`Stanford NAV Lab member<navlab_dev>`, or a project maintainer
8+
:ref:`reviewing pull requests<pr_review>` or
9+
:ref:`creating new release branches<release_workflow>`.
810

11+
.. _standard_dev:
912

1013
Standard GitHub Workflow
1114
------------------------
1215

1316
1. Fork `gnss_lib_py <https://github.com/Stanford-NavLab/gnss_lib_py>`__
14-
(look for the "Fork" button).
15-
16-
2. Clone your fork locally:
17+
(look for the "Fork" button), then clone your fork locally:
1718

1819
.. code-block:: bash
1920
2021
git clone https://github.com/<your username>/gnss_lib_py
2122
22-
3. If using poetry, follow the :ref:`developer install instructions<developer install>`
23+
2. If using poetry, follow the :ref:`developer install instructions<developer install>`
2324
to install pyenv, poetry, and the python dependencies. If using
2425
:code:`pip` or :code:`conda` for package management instead, use
2526
:code:`pip install -r requirements.txt` to install dependencies.
2627

27-
4. Create a local branch:
28+
3. Create a local branch:
2829

2930
.. code-block:: bash
3031
3132
git checkout -b your-name/name-of-your-bugfix-or-feature
3233
33-
5. Make changes locally and document them appropriately. See the
34+
4. Make changes locally and document them appropriately. See the
3435
:ref:`Documentation<documentation>` section for more details.
3536

3637
If the feature branch includes new functionality, you must also:
@@ -41,20 +42,18 @@ Standard GitHub Workflow
4142
* add a section in the appropriate tutorial notebook located in
4243
:code:`notebooks/tutorials/*`
4344

44-
6. Add tests for the newly added code and ensure the new code is covered.
45+
5. Add tests for the newly added code and ensure the new code is covered.
4546
See the :ref:`Testing<testing>` section for more details.
4647

47-
7. Add your name to the `contributors list <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/CONTRIBUTORS.sh>`__.
48-
49-
8. When you're done making changes run all the tests with:
48+
6. When you're done making changes run all the tests with:
5049

5150
.. code-block:: bash
5251
5352
poetry run pytest
5453
5554
Make sure that all tests are passing.
5655

57-
9. Verify that testing coverage has not decreased:
56+
7. Verify that testing coverage has not decreased:
5857

5958
.. code-block:: bash
6059
@@ -63,19 +62,51 @@ Standard GitHub Workflow
6362
6463
See the :ref:`Coverage Report<coverage>` section for more details.
6564

66-
10. Ensure that system and IDE dependent files, like those in :code:`.idea`
67-
folders for PyCharm and :code:`.vscode` folders for VS Code are not
68-
committed by updating the :code:`.gitignore` file.
65+
8. Improve code readability by linting it. Run :code:`pylint` to preview
66+
issues with the code:
67+
68+
.. code-block:: bash
69+
70+
poetry run python -m pylint path-to-file-to-lint
71+
72+
Resolve issues that do not impact how you have implemented your functionality,
73+
such as conforming to snake case naming, removing TODOs and using suggested
74+
defaults.
75+
76+
9. Ensure that system and IDE dependent files, like those in :code:`.idea`
77+
folders for PyCharm and :code:`.vscode` folders for VS Code are not
78+
committed by updating the :code:`.gitignore` file.
79+
80+
10. Improve code readability by linting it. Run :code:`pylint` to preview
81+
issues with the code:
82+
83+
.. code-block:: bash
84+
85+
poetry run python -m pylint path-to-file-to-lint
86+
87+
Resolve issues that do not impact how you have implemented your functionality,
88+
such as conforming to snake case naming, removing TODOs and using suggested
89+
defaults.
90+
91+
11. Add your name to the `contributors list <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/CONTRIBUTORS.md>`__.
6992

70-
11. Commit your changes and publish your branch to GitHub:
93+
12. Commit your changes and publish your branch to GitHub:
7194

7295
.. code-block:: bash
7396
7497
git add -A
7598
git commit -m "<describe changes in this commit>"
7699
git push origin your-name/name-of-your-bugfix-or-feature
77100
78-
12. Submit a pull request through GitHub.
101+
13. Submit a pull request through GitHub. For the base branch
102+
in the pull request, select the latest version release branch :code:`vx.Y.Z`
103+
(with the highest number of all such branches). *Do not target the*
104+
:code:`main` *branch in your pull request.* In the pull request,
105+
add a code review request for a current maintainer of the repository.
106+
The reviewers might add comments to ensure compliance with the rest
107+
of the code.
108+
109+
.. _navlab_dev:
79110

80111
NAVLab GitHub Workflow
81112
----------------------
@@ -103,15 +134,16 @@ NAVLab GitHub Workflow
103134
* add a section in the appropriate tutorial notebook located in
104135
:code:`notebooks/tutorials/*`
105136

106-
5. Add your name to the `contributors list <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/CONTRIBUTORS.sh>`__.
137+
5. Add tests for the newly added code and ensure the new code is covered.
138+
See the :ref:`Testing<testing>` section for more details.
107139

108140
6. When you're done making changes run all the tests with:
109141

110142
.. code-block:: bash
111143
112144
poetry run pytest
113145
114-
See the :ref:`Testing<testing>` section for more details.
146+
Make sure that all tests are passing.
115147

116148
7. Verify that testing coverage has not decreased:
117149

@@ -122,15 +154,39 @@ NAVLab GitHub Workflow
122154
123155
See the :ref:`Coverage Report<coverage>` section for more details.
124156

125-
8. Ensure that system and IDE dependent files, like those in :code:`.idea`
157+
8. Improve code readability by linting it. Run :code:`pylint` to preview
158+
issues with the code:
159+
160+
.. code-block:: bash
161+
162+
poetry run python -m pylint path-to-file-to-lint
163+
164+
Resolve issues that do not impact how you have implemented your functionality,
165+
such as conforming to snake case naming, removing TODOs and using suggested
166+
defaults.
167+
168+
9. Ensure that system and IDE dependent files, like those in :code:`.idea`
126169
folders for PyCharm and :code:`.vscode` folders for VS Code are not
127170
committed by updating the :code:`.gitignore` file.
128171

129-
9. When you're ready to commit changes follow the steps below to
130-
minimize unnecessary merging. This is especially important if
131-
multiple people are working on the same branch. If you pull new
132-
changes, then repeat the tests above to double check that everything
133-
is still working as expected.
172+
10. Improve code readability by linting it. Run :code:`pylint` to preview
173+
issues with the code:
174+
175+
.. code-block:: bash
176+
177+
poetry run python -m pylint path-to-file-to-lint
178+
179+
Resolve issues that do not impact how you have implemented your functionality,
180+
such as conforming to snake case naming, removing TODOs and using suggested
181+
defaults.
182+
183+
11. Add your name to the `contributors list <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/CONTRIBUTORS.md>`__.
184+
185+
12. When you're ready to commit changes follow the steps below to
186+
minimize unnecessary merging. This is especially important if
187+
multiple people are working on the same branch. If you pull new
188+
changes, then repeat the tests above to double check that everything
189+
is still working as expected.
134190

135191
.. code-block:: bash
136192
@@ -141,10 +197,15 @@ NAVLab GitHub Workflow
141197
git commit -m "<describe changes in this commit>"
142198
git push origin your-name/name-of-your-bugfix-or-feature
143199
144-
10. Submit a pull request through the GitHub website. In the pull request,
145-
add a code review request for the current maintainers of the repository,
146-
Ashwin Kanhere, Derek Knowles or Sriramya Bhamidipati. The reviewers
147-
might add comments to ensure compliance with the rest of the code.
200+
13. Submit a pull request through GitHub. For the base branch
201+
in the pull request, select the latest version release branch :code:`vx.Y.Z`
202+
(with the highest number of all such branches). *Do not target the*
203+
:code:`main` *branch in your pull request.* In the pull request,
204+
add a code review request for a current maintainer of the repository.
205+
The reviewers might add comments to ensure compliance with the rest
206+
of the code.
207+
208+
.. _pr_review:
148209

149210
Pull Request Review Workflow
150211
----------------------------
@@ -203,16 +264,24 @@ Pull Request Review Workflow
203264
204265
See the :ref:`Coverage Report<coverage>` section for more details.
205266

206-
7. Submit your approval or any comments on GitHub.
267+
7. Verify that the Pull Request targets the latest version release branch,
268+
called :code:`vX.Y.Z`. If it doesn't target this branch, change the base
269+
branch to the latest version release branch. If this branch
270+
doesn't exist, create the latest version release branch from :code:`main`
271+
before changing the base.
272+
273+
8. Submit your approval or any comments on GitHub.
274+
275+
.. _release_workflow:
207276

208277
New Package Release Workflow
209278
----------------------------
210279

211-
1. Create new branch for the release:
280+
1. Switch to the latest version release branch (with the highest number):
212281

213282
.. code-block:: bash
214283
215-
git checkout -b your-name/release-X.Y.Z
284+
git checkout -b vX.Y.Z
216285
217286
2. Open the ``pyproject.toml`` file and under the ``[tool.poetry]``
218287
group change the ``version = X.Y.Z`` variable to match the new

gnss_lib_py/parsers/navdata.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,21 @@ class NavData():
3939
----------
4040
arr_dtype : numpy.dtype
4141
Type of values stored in data array
42+
orig_dtypes : pandas.core.series.Series
43+
Type of each original column if reading from a csv or Pandas
44+
dataframe.
4245
array : np.ndarray
4346
Array containing data, dimension M x N
4447
map : Dict
4548
Map of the form {pandas column name : array row number }
4649
str_map : Dict
4750
Map of the form {pandas column name : {array value : string}}.
4851
Map is of the form {pandas column name : {}} for non string rows.
49-
orig_dtypes : pandas.core.series.Series
50-
Type of each original column if reading from a csv or Pandas
51-
dataframe.
52+
num_cols : int
53+
Number of columns in array containing data, set to 0 by default
54+
for empty NavData
55+
curr_cols : int
56+
Current number of column for iterator, set to 0 by default
5257
5358
"""
5459
def __init__(self, csv_path=None, pandas_df=None, numpy_array=None,
@@ -1051,6 +1056,14 @@ def __next__(self):
10511056
return x_curr
10521057

10531058
def __str__(self):
1059+
"""Creates string representation of NavData object
1060+
1061+
Returns
1062+
-------
1063+
str_out : str
1064+
String representation of Navdata object, based on equivalent
1065+
Pandas string
1066+
"""
10541067
str_out = str(self.pandas_df())
10551068
str_out = str_out.replace("DataFrame","NavData")
10561069
str_out = str_out.replace("Columns","Rows")
@@ -1060,6 +1073,21 @@ def __str__(self):
10601073
str_out)
10611074
return str_out
10621075

1076+
def __repr__(self): # pragma: no cover
1077+
"""Evaluated string representation of Navdata object
1078+
1079+
For NavData objects, this is similar to the str method and is
1080+
defined separately to avoid having to add a `print` method
1081+
before each display command in Jupyter notebooks
1082+
1083+
Returns
1084+
-------
1085+
rep_out : str
1086+
Evaluated string representation object
1087+
"""
1088+
rep_out = str(self)
1089+
return rep_out
1090+
10631091
def __len__(self):
10641092
"""Return length of class
10651093

notebooks/tutorials/parsers.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384
"outputs": [],
385385
"source": [
386386
"from gnss_lib_py.parsers.precise_ephemerides import multi_gnss_from_precise_eph\n",
387+
"from gnss_lib_py.parsers.android import AndroidDerived2021\n",
387388
"import numpy as np\n",
388389
"\n",
389390
"# load Android Google Challenge data\n",

0 commit comments

Comments
 (0)