Skip to content

Commit

Permalink
Update inpect_notebooks, Update create names for Slycot reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
KybernetikJo committed Aug 25, 2023
1 parent 3599c99 commit 2ec0827
Show file tree
Hide file tree
Showing 3 changed files with 332 additions and 251 deletions.
22 changes: 16 additions & 6 deletions doc/create_names_for_reference.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Generate the routines divide by slicot-chapters for sphinx-doc.
# Only prints out the names, copy & past them into slycot_outer.rst and slycot_inner.rst.
import re
import pandas as pd
import matplotlib.pyplot as plt
Expand All @@ -9,19 +11,27 @@
def get_slycot_routines(sly):
all_attributes = dir(sly)
r = re.compile("[a-z][a-z][0-9][0-9a-z][a-z][a-z]")
matched_attributes = list(filter(r.match, all_attributes)) # Read Note below
matched_attributes = list(filter(r.match, all_attributes))
return matched_attributes

slycot_wrapper = get_slycot_routines(slycot)
slycot_wrapper.sort()
slycot_f2py_wrapper = get_slycot_routines(slycot._wrapper)
slycot_f2py_wrapper.sort()

from itertools import groupby
from operator import itemgetter

print(f"\nslycot_wrapper {len(slycot_wrapper)}\n")
for routine in slycot_wrapper:
print(routine)
for chapter_letter, chapter_routines in groupby(sorted(slycot_wrapper), key=itemgetter(0)):
print(chapter_letter)
for routine in chapter_routines:
print(routine)
print("\n")

print(f"\nslycot_f2py_wrapper {len(slycot_f2py_wrapper)}\n")
for routine in slycot_f2py_wrapper:
print("_wrapper."+routine)

for chapter_letter, chapter_routines in groupby(sorted(slycot_f2py_wrapper), key=itemgetter(0)):
print(chapter_letter)
for routine in chapter_routines:
print("_wrapper."+routine)
print("\n")
Loading

0 comments on commit 2ec0827

Please sign in to comment.