Skip to content

Report timings.generic pandas.data frame.to type interface#7205

Open
wxtim wants to merge 3 commits into
cylc:masterfrom
wxtim:report-timings.generic-pandas.DataFrame.to_type_interface
Open

Report timings.generic pandas.data frame.to type interface#7205
wxtim wants to merge 3 commits into
cylc:masterfrom
wxtim:report-timings.generic-pandas.DataFrame.to_type_interface

Conversation

@wxtim

@wxtim wxtim commented Feb 5, 2026

Copy link
Copy Markdown
Member

Follow on from #7204

Should satisfy the desires of any users who wish to open up the Raw data in Excel.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are not included, because this is almost entirely dependent on Pandas functionality.
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

oliver-sanders and others added 2 commits February 2, 2026 13:16
* Port onto latest pandas and matplotlib (bump pandas dep).
* Remove back-compat code.
* Add basic tests.
"to_<output>" methods.
Added "json" and "csv" to the list of raw output formats.
n.b: You can't use `to_excel` or `to_markdown` without
additional optional dependencies.
Also left scope in the interface for "csv-specific-char-delimited".
@wxtim wxtim force-pushed the report-timings.generic-pandas.DataFrame.to_type_interface branch from ffef099 to 6e04161 Compare February 5, 2026 09:53
@wxtim wxtim requested a review from oliver-sanders February 5, 2026 09:54
"""

buf.write('<html><head><style>%s</style></head><body>' % css)
buf.write('<!DOCTYPE html><html><head><style>%s</style></head><body>' % css)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not having this showed as an warning when I looked at the HTML with dev tools on

'raw': format_raw,
'summary': format_summary,
'html': format_html,
'csv': partial(format_generic, format='csv'),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly to_markdown and to_excel require extra dependencies, and to_html, though it works isn't very nice to look at and needs some CSS appended.

@oliver-sanders

Copy link
Copy Markdown
Member

Might as well go with the CSV and JSON outputs added here, it's adding no more to dependencies than what was already there.

Some Context:

I was kinda hoping that we might rewrite the data handling side of this code to remove that pandas and matplotlib dependences as these are substantial environment-inflating packages. So didn't really want to onboard any more pandas'ey functionality., especially as the Analysis view in the GUI should eventually supersede much of this functionality (interactive GUI, customisable plots, etc).

However, it does look like these dependencies are delivering real value here (especially the HTML output) and there may be value to this post-analysis view, even though we probs don't want to take on the burden of maintaining both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants