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.
3+ import re
4+ import pandas as pd
5+ import warnings
6+
7+ import slycot
8+ slycot .__version__
9+
10+ def get_slycot_routines (sly ):
11+ all_attributes = dir (sly )
12+ r = re .compile ("[a-z][a-z][0-9][0-9a-z][a-z][a-z]" )
13+ matched_attributes = list (filter (r .match , all_attributes ))
14+ return matched_attributes
15+
16+ def get_slycot_routines_help (file ,pre = "" ):
17+ textfile = open (file , 'r' )
18+ filetext = textfile .read ()
19+ textfile .close ()
20+ lines = filetext .split ("\n " )
21+ res = [ele .replace (" " ,"" ) for ele in lines ]
22+ res = [ele .replace ("_wrapper." ,"" ) for ele in res ]
23+
24+ r = re .compile ("[a-z][a-z][0-9][0-9a-z][a-z][a-z]" )
25+ matched_attributes = list (filter (r .match , res ))
26+ return matched_attributes
27+
28+ slycot_wrapper = get_slycot_routines (slycot )
29+ slycot_wrapper .sort ()
30+ slycot_f2py_wrapper = get_slycot_routines (slycot ._wrapper )
31+ slycot_f2py_wrapper .sort ()
32+
33+ slycot_wrapper_help = get_slycot_routines_help ("source/reference/slycot_outer.rst" )
34+ slycot_wrapper_help .sort ()
35+
36+ slycot_f2py_wrapper_help = get_slycot_routines_help ("source/reference/slycot_inner.rst" )
37+ slycot_f2py_wrapper_help .sort ()
38+
39+ missing = list (set (slycot_wrapper ) - set (slycot_wrapper_help ))
40+ if bool (missing ):
41+ warnings .warn (f"The routines { missing } are missing in 'slycot_outer.rst'." )
42+
43+ missing = list (set (slycot_f2py_wrapper ) - set (slycot_f2py_wrapper_help ))
44+ if bool (missing ):
45+ warnings .warn (f"The routines _wrapper.{ missing } are missing in 'slycot_inner.rst'." )
0 commit comments