Shared task
Allow RST header rows to be specified via header_rows argument
PR #14182 ↗ · astropy/astropy · · merged Dec 16, 2022 · +66 −13 · base a5917978be39
what a new run launched now would send
Please support header rows in RestructuredText output
### Description
It would be great if the following would work:
```Python
>>> from astropy.table import QTable
>>> import astropy.units as u
>>> import sys
>>> tbl = QTable({'wave': [350,950]*u.nm, 'response': [0.7, 1.2]*u.count})
>>> tbl.write(sys.stdout, format="ascii.rst")
===== ========
wave response
===== ========
350.0 0.7
950.0 1.2
===== ========
>>> tbl.write(sys.stdout, format="ascii.fixed_width", header_rows=["name", "unit"])
| wave | response |
| nm | ct |
| 350.0 | 0.7 |
| 950.0 | 1.2 |
>>> tbl.write(sys.stdout, format="ascii.rst", header_rows=["name", "unit"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/astropy/table/connect.py", line 129, in __call__
self.registry.write(instance, *args, **kwargs)
File "/usr/lib/python3/dist-packages/astropy/io/registry/core.py", line 369, in write
return writer(data, *args, **kwargs)
File "/usr/lib/python3/dist-packages/astropy/io/ascii/connect.py", line 26, in io_write
return write(table, filename, **kwargs)
File "/usr/lib/python3/dist-packages/astropy/io/ascii/ui.py", line 856, in write
writer = get_writer(Writer=Writer, fast_writer=fast_writer, **kwargs)
File "/usr/lib/python3/dist-packages/astropy/io/ascii/ui.py", line 800, in get_writer
writer = core._get_writer(Writer, fast_writer, **kwargs)
File "/usr/lib/python3/dist-packages/astropy/io/ascii/core.py", line 1719, in _get_writer
writer = Writer(**writer_kwargs)
TypeError: RST.__init__() got an unexpected keyword argument 'header_rows'
```
### Additional context
RestructuredText output is a great way to fill autogenerated documentation with content, so having this flexible makes the life easier `:-)`
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_astropy_pr14182`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
| Run | Model | Verdict |
|---|---|---|
| Aug 21, 12:31 UTC · completed | composer-2.5 | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6 | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-low |
Powered by YourCodingBench — benchmark coding models on your own repo's commits. sign in
| Aug 21, 12:31 UTC · completed | grok-4.6-medium | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-xhigh | PASS |
Binary verdicts from the pinned judge (D27). Full attempt detail — candidate diff, transcript, timings — lives on each run page's score matrix.