openml-python icon indicating copy to clipboard operation
openml-python copied to clipboard

Added suite.metadata property and to_latex helper and tests (fixes #1126)

Open anvithagowda098 opened this issue 1 month ago • 0 comments

What does the PR fix?

This PR implements the OpenMLBenchmarkSuite.metadata property and the suite.to_latex(...) helper method. This essentially fixes #1126

What this adds

  • suite.metadata
    Returns a pandas DataFrame with:

    • dataset IDs,
    • task IDs,
    • dataset names,
    • #instances (n), #features (p), #classes (C)
  • suite.to_latex(filename, caption=None, label=None)
    A lightweight, non-opinionated LaTeX export helper for the metadata.
    It:

    • prefers pandas Styler formatting if jinja2 is installed,
    • otherwise falls back to a minimal internal LaTeX generator,
    • never imposes formatting rules/tricks on the user.

Why

Per discussion in #1126, maintainers preferred exposing the DataFrame (suite.metadata) instead of an opinionated Latex formatter. This PR:

  • provides the canonical DataFrame for suites,
  • includes a small, non-opinionated to_latex convenience helper,
  • ships tests (mocked + server-tagged).

Notes

  • The to_latex helper will prefer pandas' Styler when jinja2 is available; otherwise it uses a small fallback generator that does not require extra dependencies.
  • The server integration test will skip if suite 99 is not present on the configured server.
  • Additionally, if the fix is satisfactory, examples and a mention of the same in documentation can be done.

Metadata

  • Reference Issue: Fixes #1126
  • New Tests Added: Yes
  • Documentation Updated: No

anvithagowda098 avatar Nov 15 '25 16:11 anvithagowda098