andrewtavis/poli-sci-kit

Add equations to appointment.metrics docstrings

Open

#25 opened on Apr 20, 2021

 (0 comments) (0 reactions) (0 assignees)Python (9 forks)auto 404
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:

  1. 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's conf.py)
  2. 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
  1. The docstring also needs to be converted to an r-sting (this is now the case for largest_remainder and highest_averages)
  2. 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!

Contributor guide