Skip to content

DOC: Sphinx docs setup, fix parameter wording, replace micromamba with pixi#17

Open
HaoZeke wants to merge 3 commits intoairspeed-velocity:mainfrom
HaoZeke:docs/readme-updates
Open

DOC: Sphinx docs setup, fix parameter wording, replace micromamba with pixi#17
HaoZeke wants to merge 3 commits intoairspeed-velocity:mainfrom
HaoZeke:docs/readme-updates

Conversation

@HaoZeke
Copy link
Member

@HaoZeke HaoZeke commented Feb 21, 2026

Summary

  • Sphinx documentation with PyData theme, MyST-Parser, sphinx-click CLI reference, and ReadTheDocs config
  • Clarify that parameters remain visible as benchmark(param, ...) even without benchmarks.json; only separate param_* columns are absent
  • Replace the micromamba-based end-to-end example with pixi
  • Use --label-before/--label-after in the cross-env compare example for cleaner output

Depends on #15 and #16.

Fixes: #1

Currently, asv-spyglass compare and to-df commands require a
benchmarks.json file (the BCONF argument) to function. This file is
used to provide metadata such as units and parameter names. However,
users running benchmarks in existing environments may want to compare
result files directly without providing the full asv benchmark
configuration.

This commit makes benchmarks.json optional by:
- Updating ReadOnlyASVBenchmarks to allow initialization with a None
  path, returning an empty benchmark set.
- Modifying ResultPreparer and do_compare to handle missing benchmark
  metadata gracefully by falling back to information available in the
  result files.
- Updating the CLI to make BCONF (compare) and BDAT (to-df) optional.
- Implementing an automatic search for benchmarks.json in the parent
  directory of the results (for both compare and to-df).
- Safely handling missing parameter names in PreparedResult.to_df.
- Guarding against empty result files in ResultPreparer.prepare().

Documentation updates:
- Restructured README.md to lead with the simplified usage (no BCONF).
- Added a "Metadata Handling" section explaining the benefits of
  providing the configuration file.
- Updated command docstrings to detail optional arguments and
  automatic search behavior.

Tests:
- Added regression tests for do_compare and to_df without configuration
  files in tests/test_results.py.
- Added CLI auto-search test for to_df.

Fixes: airspeed-velocity#8
Introduce the 'compare-many' command to support comparing multiple ASV
result files against a single baseline. This provides a clear,
multi-column view of timings and relative ratios, similar to the
output of 'hyperfine'.

Specifically:
- Implement 'do_compare_many' in src/asv_spyglass/compare.py to
  handle an arbitrary number of contender result files.
- Add 'compare-many' Click command to src/asv_spyglass/cli.py.
- Implement 'human_value_fallback' to ensure clean output (scientific
  notation with fixed precision) when benchmark units are missing.
- Update README.md with a new section on comparing multiple results
  and restructured examples.
- Add regression tests for 'compare-many' both with and without
  benchmark configuration files in tests/test_results.py.

This builds on the optional benchmarks.json logic from PR airspeed-velocity#15.

Fixes: airspeed-velocity#3
…h pixi

Establish formal documentation using Sphinx with PyData Sphinx Theme:
- Use MyST-Parser for Markdown documentation support.
- Add automatically generated CLI reference via sphinx-click.
- Create initial Index, Usage Guide, and CLI Reference pages.
- Add .readthedocs.yaml for automated RTD builds.
- Add 'doc' optional dependencies to pyproject.toml.

README improvements:
- Clarify that parameters remain visible as benchmark(param, ...) in
  the name column even without benchmarks.json; only separate param_*
  columns are absent.
- Replace the micromamba-based end-to-end example with pixi.
- Use --label-before/--label-after in the cross-env compare example
  for cleaner output.

Fixes: airspeed-velocity#1
@HaoZeke HaoZeke marked this pull request as draft February 21, 2026 22:46
@HaoZeke HaoZeke marked this pull request as ready for review February 26, 2026 10:47
@HaoZeke HaoZeke requested a review from mattip February 26, 2026 10:47
@HaoZeke HaoZeke mentioned this pull request Feb 27, 2026
@HaoZeke
Copy link
Member Author

HaoZeke commented Feb 27, 2026

Last one for a release @mattip (thanks for the quick reviews!)

@mattip
Copy link
Contributor

mattip commented Feb 27, 2026

Does this need some readthedocs webhook or app to be registered with the repo?

@HaoZeke
Copy link
Member Author

HaoZeke commented Feb 27, 2026

Does this need some readthedocs webhook or app to be registered with the repo?

There should have been one already, at some point it was being served there, I can double check

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.

DOC: Setup CI and Sphinx

2 participants