Dropped csv field prefixes in scripts

The original idea was to allow merging a whole bunch of different csv
results into a single lfs.csv file, but this never really happened. It's
much easier to operate on smaller context-specific csv files, where the
field prefix:

- Doesn't really add much information
- Requires more typing
- Is confusing in how it doesn't match the table field names.

We can always use summary.py -fcode_size=size to add prefixes when
necessary anyways.
This commit is contained in:
Christopher Haster
2024-06-02 16:33:05 -05:00
parent dc7e7b9ab1
commit 54d77da2f5
10 changed files with 132 additions and 124 deletions

View File

@@ -558,15 +558,15 @@ def main(ci_paths,
if not all(k in r and r[k] in vs for k, vs in defines):
continue
if not any('stack_'+k in r and r['stack_'+k].strip()
if not any(k in r and r[k].strip()
for k in StackResult._fields):
continue
try:
results.append(StackResult(
**{k: r[k] for k in StackResult._by
if k in r and r[k].strip()},
**{k: r['stack_'+k] for k in StackResult._fields
if 'stack_'+k in r and r['stack_'+k].strip()}))
**{k: r[k] for k in StackResult._fields
if k in r and r[k].strip()}))
except TypeError:
pass
@@ -588,14 +588,14 @@ def main(ci_paths,
with openio(args['output'], 'w') as f:
writer = csv.DictWriter(f,
(by if by is not None else StackResult._by)
+ ['stack_'+k for k in (
+ [k for k in (
fields if fields is not None else StackResult._fields)])
writer.writeheader()
for r in results:
writer.writerow(
{k: getattr(r, k) for k in (
by if by is not None else StackResult._by)}
| {'stack_'+k: getattr(r, k) for k in (
| {k: getattr(r, k) for k in (
fields if fields is not None else StackResult._fields)})
# find previous results?
@@ -609,15 +609,15 @@ def main(ci_paths,
if not all(k in r and r[k] in vs for k, vs in defines):
continue
if not any('stack_'+k in r and r['stack_'+k].strip()
if not any(k in r and r[k].strip()
for k in StackResult._fields):
continue
try:
diff_results.append(StackResult(
**{k: r[k] for k in StackResult._by
if k in r and r[k].strip()},
**{k: r['stack_'+k] for k in StackResult._fields
if 'stack_'+k in r and r['stack_'+k].strip()}))
**{k: r[k] for k in StackResult._fields
if k in r and r[k].strip()}))
except TypeError:
raise
except FileNotFoundError: