(self, vs, **kwargs)
| 46 | return self.gen_table(self.serialize(self.names()), **kwargs) |
| 47 | |
| 48 | def table_diff(self, vs, **kwargs): |
| 49 | fnames = set(self.names()) |
| 50 | fnames_vs = set(vs.names()) |
| 51 | common = fnames.intersection(fnames_vs) |
| 52 | extra = fnames.difference(fnames_vs) |
| 53 | notavl = fnames_vs.difference(fnames) |
| 54 | iextra = {} |
| 55 | inotavl = {} |
| 56 | idiff = set() |
| 57 | for f in common: |
| 58 | implies = self.copt.feature_implies(f) |
| 59 | implies_vs = vs.copt.feature_implies(f) |
| 60 | e = implies.difference(implies_vs) |
| 61 | i = implies_vs.difference(implies) |
| 62 | if not i and not e: |
| 63 | continue |
| 64 | if e: |
| 65 | iextra[f] = e |
| 66 | if i: |
| 67 | inotavl[f] = e |
| 68 | idiff.add(f) |
| 69 | |
| 70 | def fbold(f): |
| 71 | if f in extra: |
| 72 | return f':enabled:`{f}`' |
| 73 | if f in notavl: |
| 74 | return f':disabled:`{f}`' |
| 75 | return f |
| 76 | |
| 77 | def fbold_implies(f, i): |
| 78 | if i in iextra.get(f, {}): |
| 79 | return f':enabled:`{i}`' |
| 80 | if f in notavl or i in inotavl.get(f, {}): |
| 81 | return f':disabled:`{i}`' |
| 82 | return i |
| 83 | |
| 84 | diff_all = self.serialize(idiff.union(extra)) |
| 85 | diff_all += vs.serialize(notavl) |
| 86 | content = self.gen_table( |
| 87 | diff_all, fstyle=fbold, fstyle_implies=fbold_implies, **kwargs |
| 88 | ) |
| 89 | return content |
| 90 | |
| 91 | def gen_table(self, serialized_features, fstyle=None, fstyle_implies=None, |
| 92 | **kwargs): |
no test coverage detected