MCPcopy Create free account
hub / github.com/numpy/numpy / gen_table

Method gen_table

doc/source/reference/simd/gen_features.py:91–114  ·  view source on GitHub ↗
(self, serialized_features, fstyle=None, fstyle_implies=None,
                  **kwargs)

Source from the content-addressed store, hash-verified

89 return content
90
91 def gen_table(self, serialized_features, fstyle=None, fstyle_implies=None,
92 **kwargs):
93
94 if fstyle is None:
95 fstyle = lambda ft: f'``{ft}``'
96 if fstyle_implies is None:
97 fstyle_implies = lambda origin, ft: fstyle(ft)
98
99 rows = []
100 have_gather = False
101 for f, implies, gather in serialized_features:
102 if gather:
103 have_gather = True
104 name = fstyle(f)
105 implies = ' '.join([fstyle_implies(f, i) for i in implies])
106 gather = ' '.join([fstyle_implies(f, i) for i in gather])
107 rows.append((name, implies, gather))
108 if not rows:
109 return ''
110 fields = ["Name", "Implies", "Gathers"]
111 if not have_gather:
112 del fields[2]
113 rows = [(name, implies) for name, implies, _ in rows]
114 return self.gen_rst_table(fields, rows, **kwargs)
115
116 def gen_rst_table(self, field_names, rows, tab_size=4):
117 assert(not rows or len(field_names) == len(rows[0]))

Callers 2

tableMethod · 0.95
table_diffMethod · 0.95

Calls 2

gen_rst_tableMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected