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
Try to use minimal explicit data. Often you can use explicit values like
131
-
``[1, 2, 3]``, ``range(5)`` or ``np.arange(5)``. This is cheap and
130
+
Try to use minimal explicit data, such as
131
+
``[1, 2, 3]``, ``range(5)`` or ``np.arange(5)``, because it
132
132
makes the test more readable.
133
133
134
134
When you need more and non-trivial data, generate it programmatically, e.g. ::
135
135
136
136
x = np.linspace(0, 2*np.pi, 101)
137
137
y = 2 * np.sin(x) + 1
138
138
139
-
Use random numbers only, if an algorihmical way to generate the data is not
140
-
possible or too cumbersome. In this case, set the seed to a fixed value to make
139
+
Use random numbers only when an algorithmic way to generate the data is too cumbersome or impossible. In this case, set the seed to a fixed value to make
141
140
the test deterministic. For numpy's default random number generator use ::
142
141
143
142
import numpy as np
@@ -149,7 +148,7 @@ The seed is :ref:`John Hunter's <project_history>` birthday.
149
148
150
149
Test cleanup
151
150
^^^^^^^^^^^^
152
-
We often need figures or modify `.rcParams` to test some functionality. Cleanup
151
+
We often need to create figures or to modify `.rcParams` to test some functionality. Cleanup
153
152
of such side effects is handled automatically through the the pytest fixture
0 commit comments