andrewtavis/poli-sci-kit
Add equations to appointment.metrics docstrings
Open
#25 opened on Apr 20, 2021
documentationgood first issuehelp wanted
Repository metrics
- Stars
- (34 stars)
- PR merge metrics
- (PR metrics pending)
Description
This issue is for adding LaTeX equations to the docstrings of all functions found in poli_sci_kit.appointment.metrics. The style should be similar to those found in poli_sci_kit.appointment.methods.
The following is an explanation for how to write LaTeX in docstrings:
- In conf.py of the documentation you need the extension
sphinx.ext.imgmath, which allows equations to be rendered to pngs (this has been added to poli-sci-kit'sconf.py) - If you want to add an equation, then as seen in the docstrings for appointment.methods you add the following:
.. math::
LaTeX you want rendered
- The docstring also needs to be converted to an r-sting (this is now the case for
largest_remainderandhighest_averages) - You also need to use
&=instead of=in equations
This LaTeX editor could be used to test equations and then add them to the docstrings (remembering &= instead of =). I would be more than happy to help if one of the equations doesn't make sense, or if getting the LaTeX to work is a bit confusing :)
Thanks for your interest in contributing!