Skip to content

Commit a78dd5c

Browse files
alexfiklketch
authored andcommitted
docs: fix doctests
1 parent 8947eb5 commit a78dd5c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

nodepy/graph.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ def rk_dependency_graph(rkm):
4343
s = len(rkm)
4444
K = np.zeros((s+1,s+1))
4545
K[:,:-1] = np.vstack((rkm.A,rkm.b))
46-
G = nx.from_numpy_matrix(np.abs(K.T)>0,nx.DiGraph())
46+
47+
try:
48+
G = nx.from_numpy_matrix(np.abs(K.T)>0,nx.DiGraph())
49+
except AttributeError:
50+
# NOTE: networkx v3.0 removed from_numpy_matrix
51+
G = nx.from_numpy_array(np.abs(K.T)>0, create_using=nx.DiGraph)
52+
4753
return G
4854

4955
def _longest_paths(G):

nodepy/low_storage_rk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
>>> myrk = lsrk.load_low_storage('DDAS47')
4747
>>> print(myrk)
4848
DDAS4()7[2R]
49-
2R Method of Tselios \& Simos (2007)
49+
2R Method of Tselios & Simos (2007)
5050
0.000 |
5151
0.336 | 0.336
5252
0.286 | 0.094 0.192

nodepy/runge_kutta_method.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ def latex(self):
204204
>>> print(merson.latex())
205205
\begin{align}
206206
\begin{array}{c|ccccc}
207-
& & & & & \\
207+
& & & & & \\
208208
\frac{1}{3} & \frac{1}{3} & & & & \\
209209
\frac{1}{3} & \frac{1}{6} & \frac{1}{6} & & & \\
210210
\frac{1}{2} & \frac{1}{8} & & \frac{3}{8} & & \\
211211
1 & \frac{1}{2} & & - \frac{3}{2} & 2 & \\
212212
\hline
213-
& \frac{1}{6} & & & \frac{2}{3} & \frac{1}{6}\\
214-
& \frac{1}{10} & & \frac{3}{10} & \frac{2}{5} & \frac{1}{5}
213+
& \frac{1}{6} & & & \frac{2}{3} & \frac{1}{6}\\
214+
& \frac{1}{10} & & \frac{3}{10} & \frac{2}{5} & \frac{1}{5}
215215
\end{array}
216216
\end{align}
217217
"""

0 commit comments

Comments
 (0)