Skip to content

Commit

Permalink
Merge pull request #66 from jwg4/fix_array_display
Browse files Browse the repository at this point in the history
Change the doctest to ignore differences in array display.
  • Loading branch information
jwg4 authored Oct 19, 2023
2 parents baa190e + a8c3237 commit d719ab0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Now we can call `exact_cover`:
>>> import numpy as np
>>> import exact_cover as ec
>>> S = np.array([[1,0,0,1,0],[1,1,1,0,0],[0,1,1,0,0],[0,0,0,0,1]], dtype=bool)
>>> ec.get_exact_cover(S)
array([0, 2, 3])
>>> print(ec.get_exact_cover(S))
[0 2 3]

This is telling us that the 0th row (i.e. A), the 2nd row (i.e. C),
and the 3rd row (i.e. D) together form an exact cover.
Expand Down
8 changes: 4 additions & 4 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Input and output to the package are using the numpy array type:

This example is explained in README.md
>>> S = np.array([[1,0,0,1,0],[1,1,1,0,0],[0,1,1,0,0],[0,0,0,0,1]], dtype=np.int32)
>>> ec.get_exact_cover(S)
array([0, 2, 3])
>>> print(ec.get_exact_cover(S))
[0 2 3]

The numpy type to use is defined in the package for convenience and compatibility:
>>> from exact_cover.io import DTYPE_FOR_ARRAY
>>> T = np.array([[1,0,0,1,0],[1,1,1,0,0],[0,1,1,0,0],[0,0,0,0,1]], dtype=DTYPE_FOR_ARRAY)
>>> ec.get_exact_cover(T)
array([0, 2, 3])
>>> print(ec.get_exact_cover(T))
[0 2 3]

0 comments on commit d719ab0

Please sign in to comment.