Skip to content

Refactor test suite#922

Merged
padix-key merged 1 commit into
biotite-dev:mainfrom
padix-key:issue-694
Jul 3, 2026
Merged

Refactor test suite#922
padix-key merged 1 commit into
biotite-dev:mainfrom
padix-key:issue-694

Conversation

@padix-key

Copy link
Copy Markdown
Member

Resolves #694 .

This PR refactors tests/ and benchmarks/. The changes are mainly aesthetic (with random seeds being the exception) the test logic has not changed:

  • Replaced itertools.product in parametrizations with multiple stacked @pytest.mark.parametrize decorators
  • Added ids for parametrizations with opaque or long-path arguments
  • Switched from os.path to pathlib.Path (including glob/splitext); data_dir() now returns a Path
  • Moved PDB-derived structure files into tests/structure/data/pdb
  • Replaced load_structure()/save_structure() calls with the respective File classes
  • Replaced manual tempfile handling with the tmp_path fixture
  • Normalized from pytest import approx to pytest.approx
  • Replaced legacy global np.random.seed with local np.random.default_rng
  • Converted comma-separated parametrize argname strings ("a, b") to lists (["a", "b"])

@padix-key padix-key changed the title Issue 694 Refactor test suite Jul 1, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
❌ 1 (👁 1) regressed benchmark
✅ 90 untouched benchmarks
🆕 10 new benchmarks
⏩ 14 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
benchmark_match_kmer_selection[KmerTable-None] 278.5 µs 243.3 µs +14.49%
benchmark_match[KmerTable-None] 326.9 µs 294.9 µs +10.87%
🆕 benchmark_get_sequences[cas9.fasta] N/A 8.5 ms N/A
🆕 benchmark_get_sequences[ec_bl21.fasta] N/A 168.1 ms N/A
🆕 benchmark_lddt[all-False] N/A 206.3 ms N/A
🆕 benchmark_lddt[all-True] N/A 869.6 ms N/A
🆕 benchmark_lddt[atom-False] N/A 290.4 ms N/A
🆕 benchmark_lddt[atom-True] N/A 1.9 s N/A
🆕 benchmark_lddt[chain-False] N/A 296.5 ms N/A
🆕 benchmark_lddt[chain-True] N/A 1.9 s N/A
🆕 benchmark_lddt[residue-False] N/A 301.8 ms N/A
🆕 benchmark_lddt[residue-True] N/A 1.9 s N/A
👁 benchmark_match_kmer_selection[KmerTable-11*11*1*1***111] 245.1 µs 276.1 µs -11.22%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing padix-key:issue-694 (e7abbe3) with main (00054e5)

Open in CodSpeed

Footnotes

  1. 14 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@padix-key padix-key marked this pull request as ready for review July 1, 2026 10:19
@padix-key

Copy link
Copy Markdown
Member Author

The branch of this PR is branched off #921, since this PR also introduced some test changes in test_pdb.py, test_pdbx.py and test_mol.py. So these changes can be ignored in this PR and the PR will be rebased on main once #921 is merged.

@padix-key padix-key force-pushed the issue-694 branch 2 times, most recently from b4fffc3 to 78ec081 Compare July 3, 2026 10:59
@padix-key padix-key merged commit 1fa1b70 into biotite-dev:main Jul 3, 2026
24 checks passed
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.

Refactor test parametrization

1 participant