Skip to content

Commit 369063c

Browse files
committed
Merge branch 'tutorial-enhancements' into daniel/git_actions_py_version
2 parents b683b4c + 753f1e7 commit 369063c

58 files changed

Lines changed: 1616 additions & 701 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585

8686
- name: Get changed files since last remote commit
8787
id: changed-files
88-
uses: tj-actions/changed-files@v34
88+
uses: tj-actions/changed-files@v41
8989

9090
- name: Check if index.rst changed when README.md file changes
9191
if: contains(steps.changed-files.outputs.modified_files, 'README.md') && !contains(steps.changed-files.outputs.modified_files, 'docs/source/index.rst')

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,31 @@ gnss_lib_py
99
`gnss_lib_py` is a modular Python tool for parsing, analyzing, and
1010
visualizing Global Navigation Satellite Systems (GNSS) data and state
1111
estimates.
12-
It also provides an intuitive and modular framework allowing users to
12+
It also provides an intuitive and modular framework which allows users to
1313
quickly prototype, implement, and visualize GNSS algorithms.
1414
`gnss_lib_py` is modular in the sense that multiple types of
15-
algorithms can be easily exchanged for each other and extendable in
16-
facilitating user-specific extensions of existing implementations.
15+
algorithms or datasets can be easily exchanged for each other.
16+
It is extendable in facilitating user-specific extensions of existing
17+
implementations.
1718

18-
<img src="https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/docs/source/img/skyplot.png" alt="satellite skyplot" width="600"/>
19+
<img src="https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/docs/source/img/skyplot.png" alt="Skyplot of GNSS satellite movement over time" width="600"/>
1920

2021
`gnss_lib_py` contains parsers for common file types used for
2122
storing GNSS measurements, benchmark algorithms for processing
2223
measurements into state estimates and visualization tools for measurements
2324
and state estimates.
2425
The modularity of `gnss_lib_py` is made possibly by the unifying
25-
`NavData` class, which contains methods to add, remove and modify
26-
numeric and string data consistently.
27-
We provide standard row names for `NavData` elements on the
26+
`NavData` class, with accompanying standard nomenclature, which can be
27+
found in the
2828
[reference page](https://gnss-lib-py.readthedocs.io/en/latest/reference/reference.html).
29-
These names ensure cross compatibility between different datasets and
30-
algorithms.
29+
The standard nomenclature ensures cross compatibility between different
30+
datasets and algorithms.
31+
32+
`NavData` combines the readability of `pandas.DataFrame` with `numpy.ndarray`
33+
allowing for easy and fast access of numbers or strings.
34+
We also provide functionality to add, remove and modify numeric and
35+
string data consistently along with commonly needed supporting
36+
functionality.
3137

3238
Documentation
3339
-------------
@@ -51,7 +57,7 @@ Code Organization
5157
├── parsers/ # Data parsers
5258
├── utils/ # GNSS and common utilities
5359
├── visualizations/ # plotting functions
54-
└── __init__.py
60+
└── __init__.py # Initialize gnss_lib_py
5561
├── notebooks/ # Interactive Jupyter notebooks
5662
├── tutorials/ # Notebooks with tutorial code
5763
├── results/ # Location for result images/files
@@ -61,7 +67,7 @@ Code Organization
6167
├── parsers/ # Tests for files in parsers
6268
├── utils/ # Tests for files in utils
6369
├── visualizations/ # Tests for files in visualizations
64-
└── test_gnss_lib_py.py # High level checks for repository
70+
└── conftest.py # Common methods for tests
6571
├── CONTRIBUTORS.md # List of contributors
6672
├── build_docs.sh # Bash script to build docs
6773
├── poetry.lock # Poetry specific Lock file
@@ -70,14 +76,19 @@ Code Organization
7076
```
7177
In the directory organization above:
7278

73-
* The `algorithms` directory contains localization algorithms that
79+
* The `algorithms` directory contains algorithms that
7480
work by passing in a `NavData` class. Currently, the following
7581
algorithms are implemented in the `algorithms`:
7682

7783
* Weighted Least Squares
7884
* Extended Kalman Filter
7985
* Calculating pseudorange residuals
8086
* Fault detection and exclusion
87+
88+
* The `navdata` directory defines the `NavData` class, its methods, and
89+
functions that operate on `NavData` instances, like `sort`, `concat`,
90+
and others.
91+
8192
* The data parsers in the `parsers` directory allow for either loading
8293
GNSS data into `gnss_lib_py`'s unifying `NavData` class or parsing
8394
precise ephemerides data.
@@ -96,6 +107,10 @@ In the directory organization above:
96107
visualizations, calculating multi-GNSS satellite PVT information,
97108
satellite simulation, file operations, etc.
98109

110+
* The `visualizations` directory contains methods for plotting quantities
111+
in `NavData`. It includes methods to plot metrics, positions on maps,
112+
and skyplots of satellites visible from the receiver position.
113+
99114
Installation
100115
------------
101116

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# -- Project information -----------------------------------------------------
3838

3939
project = 'gnss_lib_py'
40-
copyright = '2022, Stanford NAV Lab'
40+
copyright = '2024, Stanford NAV Lab'
4141
author = 'Ashwin Kanhere, Derek Knowles'
4242

4343

docs/source/contributing/contributing.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ In your issue, please include:
1616
* Your operating system name and version.
1717
* Any details about your local setup that might be helpful in
1818
troubleshooting.
19-
* A minimal working example to reproduce the bug.
19+
* A minimal working example (MWE) to reproduce the bug. An MWE
20+
helps us reproduce the bug and troubleshoot the problem.
21+
For more details on how to create an MWE, see
22+
`this Stack Overflow guide <https://stackoverflow.com/help/minimal-reproducible-example>`.
2023

2124
Feature requests and feedback
2225
-----------------------------
2326

24-
The best way to send feedback is to file an issue on
27+
The best way to any send feedback is to file an issue on
2528
`GitHub <https://github.com/Stanford-NavLab/gnss_lib_py/issues>`__.
2629

2730
If you are proposing a feature:
@@ -31,8 +34,9 @@ If you are proposing a feature:
3134
* Keep the scope as narrow as possible, which will make it easier to
3235
implement.
3336
* This is a volunteer driven project and most contributions are a
34-
result of other research projects. If you implement your requested
35-
feature and submit a pull request, we will incorporate it.
37+
result of other research projects. We welcome outside implementations
38+
of additional features. If you implement your requested feature
39+
and submit a pull request, we will incorporate it.
3640

3741
Additional Contributing Pages
3842
-----------------------------

docs/source/contributing/development.rst

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ Standard GitHub Workflow
2222
2323
2. If using poetry, follow the :ref:`developer install instructions<developer install>`
2424
to install pyenv, poetry, and the python dependencies. If using
25-
:code:`pip` or :code:`conda` for package management instead, use
26-
:code:`pip install -r requirements.txt` to install dependencies.
25+
:code:`pip` or :code:`conda` for package management instead, install
26+
dependencies using
27+
28+
.. code-block:: bash
29+
30+
pip install -r requirements.txt
2731
2832
3. Create a local branch:
2933

@@ -36,16 +40,21 @@ Standard GitHub Workflow
3640

3741
If the feature branch includes new functionality, you must also:
3842

39-
* update the "Code Organization" section of the :code:`README.md`
40-
* update the "Code Organization" section of
41-
:code:`docs/source/index.rst` to match the :code:`README.md`
4243
* add a section in the appropriate tutorial notebook located in
4344
:code:`notebooks/tutorials/*`
4445
* if the feature is in a new file, import the file in the
4546
`module's import block <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/gnss_lib_py/__init__.py>`__.
4647

48+
If directory level changes were made, you must also:
49+
50+
* update the "Code Organization" section of the :code:`README.md`
51+
* update the "Code Organization" section of
52+
:code:`docs/source/index.rst` to match the :code:`README.md`
53+
54+
4755
5. Add tests for the newly added code and ensure the new code is covered.
48-
See the :ref:`Testing<testing>` section for more details.
56+
See the :ref:`Testing<testing>` and :ref:`Coverage<coverage>` pages
57+
for more details.
4958

5059
6. When you're done making changes run all the tests with:
5160

@@ -93,9 +102,10 @@ Standard GitHub Workflow
93102
in the pull request, select the latest version release branch :code:`vX.Y.Z`
94103
(with the highest number of all such branches). *Do not target the*
95104
:code:`main` *branch in your pull request.* In the pull request,
96-
add a code review request for a current maintainer of the repository.
97-
The reviewers might add comments to ensure compliance with the rest
98-
of the code.
105+
add a code review request for a current maintainer of the repository
106+
and provide a brief description of the implemented features.
107+
The reviewers might add comments or suggest changes to ensure
108+
compliance with the rest of the code.
99109

100110
.. _navlab_dev:
101111

@@ -119,14 +129,18 @@ NAVLab GitHub Workflow
119129

120130
If the feature branch includes new functionality, you must also:
121131

122-
* update the "Code Organization" section of the :code:`README.md`
123-
* update the "Code Organization" section of
124-
:code:`docs/source/index.rst` to match the :code:`README.md`
125132
* add a section in the appropriate tutorial notebook located in
126133
:code:`notebooks/tutorials/*`
127134
* if the feature is in a new file, import the file in the
128135
`module's import block <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/gnss_lib_py/__init__.py>`__.
129136

137+
If directory level changes were made, you must also:
138+
139+
* update the "Code Organization" section of the :code:`README.md`
140+
* update the "Code Organization" section of
141+
:code:`docs/source/index.rst` to match the :code:`README.md`
142+
143+
130144
5. Add tests for the newly added code and ensure the new code is covered.
131145
See the :ref:`Testing<testing>` section for more details.
132146

@@ -214,19 +228,22 @@ Pull Request Review Workflow
214228
3. Verify that documentation is complete and updated if necessary. See
215229
the :ref:`Documentation<documentation>` section for more details on
216230
what is expected.
217-
218231
If the feature branch included new functionality, the following
219232
should have also been updated:
220233

221-
* the "Code Organization" section of the :code:`README.md`
222-
* the "Code Organization" section of
223-
:code:`docs/source/index.rst` to match the :code:`README.md`
224234
* the appropriate tutorial notebook located in
225235
:code:`notebooks/tutorials/*` with a simple example of the new
226236
functionality
227237
* if a new file was created, it should likely be imported in the
228238
`module's import block <https://github.com/Stanford-NavLab/gnss_lib_py/blob/main/gnss_lib_py/__init__.py>`__.
229239

240+
If the directory structure was modified, the following should also have
241+
been updated:
242+
243+
* the "Code Organization" section of the :code:`README.md`
244+
* the "Code Organization" section of
245+
:code:`docs/source/index.rst` to match the :code:`README.md`
246+
230247
4. Verify that all tests run on your system:
231248

232249
.. code-block:: bash

docs/source/contributing/documentation.rst

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ We use `numpy docstrings
1616
<https://numpydoc.readthedocs.io/en/latest/format.html>`__
1717
for all documentation within this package. You can see some example
1818
numpy docstrings `here <https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html#example-numpy>`__.
19-
In addition to class and function docstrings, any code
20-
whose behaviour or purpose is not obvious, should be independently
21-
commented.
19+
In addition to class and function docstrings, any line of code
20+
whose behaviour or purpose is not obvious, should be have a brief explanation
21+
near the code using comments.
2222

2323
Additional documentation guidelines
2424
-----------------------------------
@@ -31,6 +31,11 @@ titled References and include the reference as shown below in the
3131
docstring. (Remove the block comment flag when inserting in already
3232
written docstrings)
3333

34+
The same reference number cannot be used across multiple methods or classes
35+
in the same file. If you want to use the same reference in multiple methods,
36+
you will have to update the reference number each time that the reference
37+
is added.
38+
3439
.. code-block:: python
3540
3641
"""
@@ -53,14 +58,22 @@ following:
5358
* :code:`bool`
5459
* :code:`int`
5560
* :code:`float`
56-
* :code:`list` (include shape in the description)
61+
* :code:`list` (include type of each list element in the description)
5762
* :code:`dict` (include key type and value type in description)
5863
* :code:`np.ndarray` (include shape in the description). Where possible,
59-
single axis arrays should be rows and time should be across
60-
the columns
64+
single axis arrays should be rows and time/different measurements
65+
should be across the columns
6166
* :code:`pd.DataFrame`
6267
* :code:`gnss_lib_py.navdata.navdata.NavData`
6368

69+
If methods can accept/return multiple types of values, combine them in the
70+
parameter/return type :code:`parameter_name : list/np.ndarray` and provide
71+
additional details in the description.
72+
73+
Similarly, if a method accepts/returns a particular combination of types,
74+
mention them in the type like :code:`parameter_name : tuple of np.ndarray`
75+
and provide details in the description.
76+
6477
PEP 8 Style Guide
6578
-----------------
6679
We also follow the `PEP 8 Python Style Guide
@@ -120,22 +133,33 @@ Citations should be added on a function by function basis.
120133
If a function is built on the implementation from another repository,
121134
include the license and attribution as required by the original author.
122135

136+
Use the :code:`Notes` and :code:`References` sections in the docstring
137+
to ensure proper citations, links, and explanations are provided.
138+
123139
Miscellaneous Style Notes
124140
-------------------------
125-
* Vectors (lists, np.ndarrays, etc.) for a single time instance
141+
* Vectors (lists, np.ndarrays, etc.) for a single time/measurement instance
126142
should be column vectors.
127143
* Collections of vectors should be 2D structures with each column
128144
representing the value of the vector for a particular time. In
129145
this convention, time varies across columns while physical
130146
quantities vary across rows.
147+
* When there are multiple measurements per time instance, there should
148+
be a row specifying the time of each measurement. Each measurement
149+
instance should be a column vector. Different types of information
150+
should be rows. Eg., for 10 measurements across 4 time instances,
151+
containing 6 types of information, the shape of the data should be
152+
:code:`(6, 40)`. Ideally, the first 10 columns should correspond to
153+
the same time instance, the next 10 for the next time instance, and
154+
so on.
131155
* Assert errors and tell the user what caused that particular error.
132156
For example, if a column vector is passed instead of a row vector,
133157
the assertion error message should say that a row vector was
134158
expected. We maintain functions in :code:`utils/*` that might be
135159
useful for performing such checks. Please check if an existing
136160
function performs the desired task before adding new functions.
137161
* Write units in brackets in comments and docstrings. For example,
138-
[m].
162+
[m] for values of distance/position and [m/s] for velocities.
139163

140164

141165
Adding to Documentation Pages
@@ -151,6 +175,9 @@ documentation for any syntax queries.
151175
Building Documentation
152176
----------------------
153177

178+
Updating Documentation Configuration
179+
++++++++++++++++++++++++++++++++++++
180+
154181
If you changed any directory names in the repository:
155182

156183
* update :code:`docs/conf.py` to reflect correct directory names
@@ -166,6 +193,9 @@ If you wish to add python dependencies:
166193

167194
If you wish to remove python dependencies, use :code:`poetry remove package`.
168195

196+
Building Documentation Locally
197+
++++++++++++++++++++++++++++++
198+
169199
If you're using :code:`poetry`, after the above, you can run the helper
170200
tool from the main directory that will automatically rebuild references
171201
and build a local HTML copy of the documentation:
@@ -180,3 +210,11 @@ a browser to view your local copy.
180210
If you encounter errors while using the :code:`build_docs.sh` tool, refer
181211
to previously documented solutions in the
182212
:ref:`troubleshooting page <build_errors>`.
213+
214+
Building Documentation on ReadTheDocs
215+
+++++++++++++++++++++++++++++++++++++
216+
217+
Documentation on readthedocs.com is automatically built when a new pull
218+
request is submitted through our GitHub Actions. Check the corresponding
219+
branch of the documentation after you have submitted a pull request
220+
`here <https://readthedocs.org/projects/gnss-lib-py/versions/>`.

0 commit comments

Comments
 (0)