@@ -16,9 +16,9 @@ We use `numpy docstrings
1616<https://numpydoc.readthedocs.io/en/latest/format.html> `__
1717for all documentation within this package. You can see some example
1818numpy 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
2323Additional documentation guidelines
2424-----------------------------------
@@ -31,6 +31,11 @@ titled References and include the reference as shown below in the
3131docstring. (Remove the block comment flag when inserting in already
3232written 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+
6477PEP 8 Style Guide
6578-----------------
6679We also follow the `PEP 8 Python Style Guide
@@ -120,22 +133,33 @@ Citations should be added on a function by function basis.
120133If a function is built on the implementation from another repository,
121134include 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+
123139Miscellaneous 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
141165Adding to Documentation Pages
@@ -151,6 +175,9 @@ documentation for any syntax queries.
151175Building Documentation
152176----------------------
153177
178+ Updating Documentation Configuration
179+ ++++++++++++++++++++++++++++++++++++
180+
154181If 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
167194If you wish to remove python dependencies, use :code: `poetry remove package `.
168195
196+ Building Documentation Locally
197+ ++++++++++++++++++++++++++++++
198+
169199If you're using :code: `poetry `, after the above, you can run the helper
170200tool from the main directory that will automatically rebuild references
171201and build a local HTML copy of the documentation:
@@ -180,3 +210,11 @@ a browser to view your local copy.
180210If you encounter errors while using the :code: `build_docs.sh ` tool, refer
181211to 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