Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ipython-with-reprs Sphinx directive #430

Merged
merged 6 commits into from Nov 8, 2022

Conversation

mhostetter
Copy link
Owner

@mhostetter mhostetter commented Nov 8, 2022

Adds a custom Sphinx directive ipython-with-reprs to simplify a common pattern in the galois documentation where an example is performed in each element representation in separate tabs.

Before

.. md-tab-set::

   .. md-tab-item:: Integer

      .. ipython:: python

         GF9 = galois.GF(3**2)
         print(GF9.properties)

   .. md-tab-item:: Polynomial

      .. ipython:: python

         GF9 = galois.GF(3**2, display="poly")
         print(GF9.properties)

   .. md-tab-item:: Power

      .. ipython:: python

         GF9 = galois.GF(3**2, display="power")
         print(GF9.properties)

After

.. ipython-with-reprs:: int,poly,power
   :name: GF9

   GF9 = galois.GF(3**2)
   print(GF9.properties)

Renders as (the same)

image

@mhostetter mhostetter added the documentation Improvements or additions to documentation label Nov 8, 2022
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Base: 97.08% // Head: 97.08% // No change to project coverage 👍

Coverage data is based on head (16e0764) compared to base (c17cd6a).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #430   +/-   ##
=======================================
  Coverage   97.08%   97.08%           
=======================================
  Files          42       42           
  Lines        5345     5345           
=======================================
  Hits         5189     5189           
  Misses        156      156           
Impacted Files Coverage Δ
src/galois/_fields/_array.py 98.90% <ø> (ø)
src/galois/_fields/_meta.py 100.00% <ø> (ø)
src/galois/typing.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mhostetter mhostetter merged commit b131da1 into master Nov 8, 2022
@mhostetter mhostetter deleted the add-ipython-with-reprs-directive branch November 8, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant