Skip to content

Commit 2ec0827

Browse files
committed
Update inpect_notebooks, Update create names for Slycot reference.
1 parent 3599c99 commit 2ec0827

File tree

3 files changed

+332
-251
lines changed

3 files changed

+332
-251
lines changed

doc/create_names_for_reference.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Generate the routines divide by slicot-chapters for sphinx-doc.
2+
# Only prints out the names, copy & past them into slycot_outer.rst and slycot_inner.rst.
13
import re
24
import pandas as pd
35
import matplotlib.pyplot as plt
@@ -9,19 +11,27 @@
911
def get_slycot_routines(sly):
1012
all_attributes = dir(sly)
1113
r = re.compile("[a-z][a-z][0-9][0-9a-z][a-z][a-z]")
12-
matched_attributes = list(filter(r.match, all_attributes)) # Read Note below
14+
matched_attributes = list(filter(r.match, all_attributes))
1315
return matched_attributes
1416

1517
slycot_wrapper = get_slycot_routines(slycot)
1618
slycot_wrapper.sort()
1719
slycot_f2py_wrapper = get_slycot_routines(slycot._wrapper)
1820
slycot_f2py_wrapper.sort()
1921

22+
from itertools import groupby
23+
from operator import itemgetter
24+
2025
print(f"\nslycot_wrapper {len(slycot_wrapper)}\n")
21-
for routine in slycot_wrapper:
22-
print(routine)
26+
for chapter_letter, chapter_routines in groupby(sorted(slycot_wrapper), key=itemgetter(0)):
27+
print(chapter_letter)
28+
for routine in chapter_routines:
29+
print(routine)
30+
print("\n")
2331

2432
print(f"\nslycot_f2py_wrapper {len(slycot_f2py_wrapper)}\n")
25-
for routine in slycot_f2py_wrapper:
26-
print("_wrapper."+routine)
27-
33+
for chapter_letter, chapter_routines in groupby(sorted(slycot_f2py_wrapper), key=itemgetter(0)):
34+
print(chapter_letter)
35+
for routine in chapter_routines:
36+
print("_wrapper."+routine)
37+
print("\n")

0 commit comments

Comments
 (0)