You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a job named doctest to the test.yml workflow. The job should run doctest against the examples in the nums package.
Use case
#153 added docstrings to functions. Now that we have examples in our code, we should ensure that examples run correctly because:
Incorrect examples are frustrating for the user.
If we test examples, we'll be more confident about the correctness of NumS.
For example, the examples in #436 should be tested.
Examples
--------
Convert a list into an array:
>>> a = [1, 2]
>>> nps.asarray(a).get()
array([1, 2])
Existing arrays are not copied:
>>> a = nps.array([1, 2])
>>> nps.asarray(a) is a
True
If `dtype` is set, array is copied only if dtype does not match:
>>> a = nps.array([1, 2], dtype=np.float32)
>>> nps.asarray(a, dtype=np.float32) is a
True
>>> nps.asarray(a, dtype=np.float64) is a
False
Open Questions
Which Python versions should we run doctests against?
Which backends should we run doctests against?
Should doctests be part of a new job, or should we add them to the existing pytest job? (In this case, we'd want to rename the pytest job)
The text was updated successfully, but these errors were encountered:
Description
Add a job named
doctest
to thetest.yml
workflow. The job should rundoctest
against the examples in thenums
package.Use case
#153 added docstrings to functions. Now that we have examples in our code, we should ensure that examples run correctly because:
For example, the examples in #436 should be tested.
Open Questions
pytest
job? (In this case, we'd want to rename thepytest
job)The text was updated successfully, but these errors were encountered: