Skip to content

Commit

Permalink
Add dropdown tips to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Nov 8, 2022
1 parent 6e08914 commit b131da1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions docs/basic-usage/array-creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ useful for initializing empty arrays.
GF.Zeros(4)
GF.Ones(4)

.. note::
.. details:: There is no :func:`numpy.empty` equivalent.
:class: note

There is no :func:`numpy.empty` equivalent. This is because :obj:`~galois.FieldArray` instances must have values in
:math:`[0, p^m)`. Empty NumPy arrays have whatever values are currently in memory, and therefore would fail those
bounds checks.
This is because :obj:`~galois.FieldArray` instances must have values in :math:`[0, p^m)`. Empty NumPy arrays have whatever values
are currently in memory, and therefore would fail those bounds checks during instantiation.

Ordered arrays
..............
Expand All @@ -126,8 +126,8 @@ the polynomial field elements.

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

GF.Random(4, seed=1234)
GF.Random(4, low=10, high=20, seed=5678)
GF.Random(4, seed=1)
GF.Random(4, low=10, high=20, seed=2)

Class properties
----------------
Expand Down
10 changes: 8 additions & 2 deletions docs/basic-usage/poly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ Or pass a :obj:`~galois.FieldArray` of coefficients without explicitly specifyin
coeffs = GF([1, 0, 0, 55, 23]); coeffs
galois.Poly(coeffs)
.. tip::
.. details:: Use :func:`~galois.set_printoptions` to display the polynomial coefficients in degree-ascending order.
:class: tip

Use :func:`~galois.set_printoptions` to display the polynomial coefficients in degree-ascending order.
.. ipython:: python
galois.set_printoptions(coeffs="asc")
galois.Poly(coeffs)
@suppress
galois.set_printoptions(coeffs="desc")
Element representation
----------------------
Expand Down

0 comments on commit b131da1

Please sign in to comment.