Skip to content

Commit f61eec6

Browse files
echedey-lsRDaxiniAdamRJensen
authored
[DOC]: params & units guidelines in contributing page (#2248)
* Fix external link that can be an internal cross reference * Update style_guide.rst * Minor improvements to docs * Update style_guide.rst * Update style_guide.rst * Update style_guide.rst * Update style_guide.rst Co-Authored-By: RDaxini <[email protected]> * Update docs/sphinx/source/contributing/style_guide.rst Co-authored-by: RDaxini <[email protected]> * Update docs/sphinx/source/contributing/style_guide.rst Co-authored-by: Adam R. Jensen <[email protected]> * Apply suggestions from code review Co-authored-by: Adam R. Jensen <[email protected]> * Fix link variables_style_rules -> nomenclature Co-Authored-By: Adam R. Jensen <[email protected]> * Fix bulleted list (hopefully 🙏 ) * Update v0.11.2.rst --------- Co-authored-by: RDaxini <[email protected]> Co-authored-by: Adam R. Jensen <[email protected]>
1 parent f8f60f4 commit f61eec6

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

docs/sphinx/source/contributing/how_to_contribute_new_code.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ We strongly recommend using virtual environments for development.
153153
Virtual environments make it easier to switch between different
154154
versions of software. This `scientific-python.org guide
155155
<https://learn.scientific-python.org/development/tutorials/dev-environment/>`_
156-
is a good reference for virtual environments. The pvlib-python `installation
157-
user guide <https://pvlib-python.readthedocs.io/en/stable/user_guide/
158-
installation.html#set-up-a-virtual-environment>`_ also provides instructions on
156+
is a good reference for virtual environments. The pvlib-python
157+
:ref:`installation guide <setupenvironment>` also provides instructions on
159158
setting up a virtual environment. If this is your first pull request, don't
160159
worry about using a virtual environment.

docs/sphinx/source/contributing/style_guide.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,29 @@ the ``docs/readthedocs.org:pvlib-python`` link within the checks
7070
status box at the bottom of the pull request.
7171

7272

73+
.. _documentation-units:
74+
75+
Parameter names and units
76+
-------------------------
77+
78+
When specifying parameters and their units, please follow these guidelines:
79+
80+
- Use the recommended parameter name and units listed in the :ref:`nomenclature` where applicable.
81+
- Enclose units in square brackets after the parameter description, e.g., ``Air temperature. [°C]``.
82+
- Use unicode superscripts symbols for exponents, e.g. ``m⁻²``.
83+
84+
- Numbers: ````, ``¹``, ``²``, ``³``, ````, ````, ````, ````, ````, ````
85+
- Negative exponent: ````
86+
- Degree symbol: ``°``
87+
88+
- Link to a brief description in the :ref:`nomenclature` section if it exists, via the sphinx role ``:term:`glossary_term```. For example, to document ``dni`` use:
89+
90+
.. code-block:: rst
91+
92+
dni : numeric
93+
Direct normal irradiance, see :term:`dni`. [Wm⁻²]
94+
95+
7396
.. _reference_style:
7497

7598
References

docs/sphinx/source/reference/tracking.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
Tracking
44
========
55

6-
Functions
7-
---------
8-
96
.. autosummary::
107
:toctree: generated/
118

docs/sphinx/source/reference/transformer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Transformer losses
44
==================
55

6-
Methods to account for losses in transformers
6+
Functions to account for losses in transformers
77

88
.. autosummary::
99
:toctree: generated/

docs/sphinx/source/whatsnew/v0.11.2.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Documentation
5151

5252
- `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`)
5353

54+
* Added a section in the style guide for parameter naming and units best practices.
55+
See :ref:`documentation-units`. (:issue:`2205`, :pull:`2248`)
5456
* Added a example to :py:func:`~pvlib.pvsystem.retrieve_sam` docstring to
5557
demonstrate how to retrieve a database from the SAM repo. (:pull:`2313`)
5658

0 commit comments

Comments
 (0)