Skip to content

refactor(projects): move the studies to polyphys-lab - #278

Merged
amirhs1 merged 2 commits into
mainfrom
refactor/standalone-projects
Nov 14, 2026
Merged

amirhs1 merged 2 commits into
mainfrom
refactor/standalone-projects

Conversation

@amirhs1

@amirhs1 amirhs1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

PolyPhys no longer holds or imports any study: the four published studies'
parsers, specs, and tests, and the 27 PolyPhys tests that need them, are in
the companion repository
polyphys-lab. The maintainer
decided on 2026-11-08 that PolyPhys stands alone, and on 2026-11-14 how
(#275).

Related issues

Closes #275

Refs #277, the later change that brings real-frame tests back under
synthetic names.

Problem

The package's tests imported projects.<study>.spec through
polyphys/tests/probe/conftest.py:259, analyze/test_pipeline.py:1630, and
viz/test_helpers.py:273; CI linted, type-checked, and tested projects/;
and the 1.0.0 ImportError of a moved parser pointed into this repository.
Deleting projects/ in a scratch copy failed 218 tier B cases and, with an
empty POLYPHYS_DATA_DIR, 11 tier C tests.

What changed

  • projects/ removed (19 files).
  • The 27 tests that need a study's parser or specs, and the fixtures only
    they used, removed from the probe, pipeline, and viz test modules; they
    are in amirhs1/polyphys-lab#2 with a copy of the trimmed frames. The
    three tests that open the frames with make_universe alone stay here,
    with polyphys/tests/data/probe/.
  • polyphys/tests/manage/test_parser.py: a ChainCyl test of the
    ValueError a species too wide for the cylinder raises
    (polyphys/manage/parser.py:1210-1211), which only a study parser test
    reached before.
  • polyphys/manage/parser.py: the ImportError names
    polyphys_lab.<study>.parser and the lab's URL; versionchanged:: 1.1.0.
  • benchmarks/organizer_timing.py: --parser <module>:<class>.
  • CI, the pull request template, pyproject.toml, AGENTS.md, and
    CONTRIBUTING.md: projects dropped from the commands, package
    discovery, and mypy; the projects area retired, and the projects/
    rows of the tier tables in AGENTS.md and the README removed together.
    The area:projects label stays.
  • The README, seven docs pages, and four module docstrings point to
    polyphys-lab. studies.md says where the folder that the 1.0.0
    ImportError names went; decisions.md adds a paragraph instead of
    rewriting the earlier record.
  • CHANGELOG.md: three lines under [Unreleased].

Checks run

  • python -m flake8 polyphys → clean (with benchmarks, also clean)
  • python -m mypy polyphys/analyze polyphys/manage polyphys/probe polyphys/simulate → no issues in 25 source files
  • python -m pytest polyphys README.md --cov=polyphys --cov-report=term-missing --cov-report=xml --doctest-modules --doctest-glob='README.md' → 2065 passed, 2 skipped; 5 lines missed, against 6 on origin/main in a throwaway worktree
  • python -m build → sdist and wheel built; the wheel has 69 files and no projects/
  • python -m sphinx -W -b html docs/source docs/_build → built, after rm -rf docs/source/generated; rebuilt after the last studies.md edit, with polyphys/tests/test_docs.py → 6 passed
  • CHANGELOG.md has entries under [Unreleased]

Also: pytest polyphys/tests/probe with coverage, with and without the 16
moved tier B tests → polyphys/probe/ at 100% in every module both times.
The lab suite passes against this branch: 635 passed, 59 skipped, 1 xfailed.

The moved tier C tests ran in the lab on the maintainer's data, run by the
maintainer on 2026-11-14: pytest -m private_data → 58 passed.

Not verified: the full pytest run predates the last studies.md edit, which
changed prose only.

Scientific correctness

  • Measurement and statistics behavior is unchanged: no module under
    polyphys/analyze/, probe/, or simulate/ changes in code, only in
    docstrings
  • Units, numerical fixtures, and domain assumptions are preserved: no
    expected value changed; the tier B frames stay here and are copied, not
    moved, to the lab
  • Parser lineage and organizer vocabulary are unchanged

Decisions and risks

The maintainer chose to move the tests rather than copy the study parsers
into polyphys/tests/, which ships in the wheel, or rename the fixture
wholes now (#277).

  • Undo: revert the merge commit; the lab keeps its copies either way.
  • Callers: a user of the 1.0.0 ImportError path finds the pointer in
    studies.md; the benchmark's --parser now takes <module>:<class>.
    Neither is public API under the stability page.
  • Numerical results: none change.
  • Stored artifacts and file names: none change.
  • The lab is private, so the new links give the public a 404 until it goes
    public; the maintainer chose to link it now.

Notes for review

  • The removed tests are mechanical cuts: their bodies are unchanged in
    amirhs1/polyphys-lab#2. Review the four docstrings in
    polyphys/tests/probe/ that now point to the lab, and
    polyphys/tests/probe/conftest.py, which lost the fixtures only the
    moved tests used and the polymer_counts and window_counts methods.
  • Merge amirhs1/polyphys-lab#2 first. After this merges, amirhs1/polyphys-lab#3 to amirhs1/polyphys-lab#6
    transfer to the lab.
  • The wording of every changed prose passage and of the new test is mine.

Assisted-by: Claude Code, claude-opus-5-5 (full implementation)
Checks-run: flake8 polyphys — clean
Checks-run: mypy (four layers) — no issues in 25 files
Checks-run: pytest with doctests — 2065 passed, 2 skipped
Checks-run: sphinx -W — built
Checks-run: python -m build — no projects/ in the wheel

- projects/: removed. The four studies' parsers, specs, and tests are
  in polyphys-lab, installed as polyphys_lab.<study>
  (amirhs1/polyphys-lab#1).
- polyphys/tests/probe/, analyze/test_pipeline.py, viz/test_helpers.py:
  remove the 27 tests that need a study's parser or specs (16 tier B,
  11 tier C) and the fixtures only they used; they are in
  amirhs1/polyphys-lab#2. The three tests that open the real frames with
  the library alone stay, with polyphys/tests/data/probe/. The module
  docstrings say where the moved tests are.
- polyphys/tests/manage/test_parser.py: a ChainCyl test of the error a
  species too wide for the cylinder raises, which only a study parser
  test reached; the moved-parser test expects the new message.
- polyphys/manage/parser.py: the ImportError of a moved study parser
  names polyphys_lab.<study>.parser and the lab's URL; versionchanged
  1.1.0.
- benchmarks/organizer_timing.py: --parser takes <module>:<class>.
- .github/workflows/ci.yaml, .github/pull_request_template.md,
  pyproject.toml, AGENTS.md, CONTRIBUTING.md: drop projects from the
  lint, type-check, and test commands and from package discovery and
  mypy; retire the projects area and the projects/ rows of the tier
  tables in AGENTS.md and README.md.
- README.md, docs/source/ (decisions, pipeline, probe, studies,
  testing, viz, workflow), polyphys/spec.py, analyze/pipeline.py,
  tests/strategies.py, tests/test_docs.py: point to polyphys-lab;
  studies.md says where the folder named by the 1.0.0 ImportError went;
  decisions.md adds a paragraph on the companion repository.
- CHANGELOG.md: three lines under Unreleased.

Why: the maintainer decided on 2026-11-08 that PolyPhys stands alone,
and on 2026-11-14 how: move the tests that need a study to the lab, since
a copy of the parsers in polyphys/tests would ship in the wheel; link the
lab now; keep no stub projects/README.md; retire the projects area.

Assisted-by: Claude Code, claude-opus-5-5 (full implementation)
Checks-run: python -m flake8 polyphys — clean
Checks-run: python -m mypy polyphys/analyze polyphys/manage polyphys/probe polyphys/simulate — no issues in 25 files
Checks-run: python -m pytest polyphys README.md --cov=polyphys --doctest-modules --doctest-glob='README.md' — 2065 passed, 2 skipped; 5 lines missed against 6 on origin/main
Checks-run: python -m sphinx -W -b html docs/source — built
Checks-run: python -m build — sdist and wheel built; no projects/ in the wheel
@amirhs1 amirhs1 added type:refactor Type: refactor area:ci Area: ci area:manage Area: manage area:packaging Area: packaging area:guide Area: guide area:agents Area: agents area:projects Area: projects area:probe Area: probe labels Nov 14, 2026
@read-the-docs-community

read-the-docs-community Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 PolyPhys | 🛠️ Build #35897062 | 📁 Comparing 16b6aa2 against latest (7b0dedd)

  🔍 Preview build  

13 files changed · ± 13 modified

± Modified

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (7b0dedd) to head (16b6aa2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     amirhs1/PolyPhys#278      +/-   ##
==========================================
- Coverage   99.95%   99.95%   -0.01%     
==========================================
  Files          62       62              
  Lines       10945    10754     -191     
==========================================
- Hits        10940    10749     -191     
  Misses          5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amirhs1
amirhs1 marked this pull request as ready for review November 14, 2026 21:40
@amirhs1
amirhs1 merged commit be675d5 into main Nov 14, 2026
13 checks passed
@amirhs1
amirhs1 deleted the refactor/standalone-projects branch November 14, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agents Area: agents area:ci Area: ci area:guide Area: guide area:manage Area: manage area:packaging Area: packaging area:probe Area: probe area:projects Area: projects type:refactor Type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[projects] Move the study records to polyphys-lab and make PolyPhys standalone

1 participant