Skip to content

Tier 1 cleanup: unused deps, pressure setpoint bug, doc/config tidy - #191

Closed
skearnes wants to merge 1 commit into
mainfrom
cleanup/tier1-tidy
Closed

Tier 1 cleanup: unused deps, pressure setpoint bug, doc/config tidy#191
skearnes wants to merge 1 commit into
mainfrom
cleanup/tier1-tidy

Conversation

@skearnes

@skearnes skearnes commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

The Tier 1 batch from the cleanup plan — low-risk, mostly zero-behavior-change. One genuine bug fix.

Dependencies

  • Python: remove unused docopt (zero imports anywhere) from pyproject.toml; uv.lock refreshed.
  • JS: remove 6 unused deps — axios, zod, @hookform/resolvers, react-hook-form, @headlessui/react, @heroicons/react — plus @types/react-router-dom (a v5 type stub mismatched against react-router v7, which ships its own types). Each verified with a grep for import sites (0). package-lock.json refreshed; npm run lint and npm run build still pass.

Bug fix

filters.py _pressure_conditions_html: the setpoint block was gated on atmosphere.type != UNSPECIFIED, so a reaction with a pressure setpoint but no atmosphere never displayed the setpoint. Now gated on the setpoint's presence (shown bare when there's no atmosphere, parenthetically otherwise), matching the text filter and _temperature_conditions_html. New filters_test.py covers it (the without-atmosphere case fails before the fix).

Docs / config

  • .gitignore: add .pytype/ (stale output from the abandoned pytype checker; ty is the checker now).
  • api/README.md: the "Vue interface" section is actually post-migration React — fixed the heading and the stale src/ketcher path (the app loads ketcher from public/ketcher, per ModalKetcher).
  • search.py: docstrings for the get_input_stats / get_product_stats endpoints (project style requires them).

Also fixes red CI on main

Reflows two lines in view.py/view_test.py that #187 introduced over 88 chars after #188 (line-length) merged. The check_python job in checks.yml already runs ruff format --check ord_interface, and it has been failing on main since #187 because that PR didn't rebase on #188's line-length change before merging. Merging this PR turns main green again.

Notes / skipped

  • The plan's "Updating ord-schema" README item is already fixed on main (it now references both pyproject.toml and the Dockerfile), so no change there.
  • The plan's interface.py flask_talisman cleanup was skipped: that file is the editor entrypoint, which is off-limits until its scheduled August 2026 deletion.

Verification

  • ruff check . clean; tree is ruff format-stable.
  • uv run pytest ord_interface/api ord_interface/visualization61 passed (incl. the new regression).
  • npm run lint + npm run build clean.

🤖 Generated with Claude Code

Greptile Summary

This PR is a low-risk "Tier 1" cleanup batch: one genuine bug fix, removal of unused Python and JS dependencies, documentation corrections, and line-length formatting fixes.

  • Bug fix (filters.py): the pressure-conditions HTML renderer previously gated the setpoint display on atmosphere.type != UNSPECIFIED, silently dropping the setpoint whenever no atmosphere was set. The fix moves the setpoint check outside the atmosphere guard and shows it bare when there is no atmosphere text, or parenthetically otherwise. A new filters_test.py adds three regression cases that cover all combinations.
  • Dependency cleanup: removes docopt from pyproject.toml/uv.lock (no import sites), and removes six unused JS packages (axios, react-hook-form, @hookform/resolvers, @headlessui/react, @heroicons/react) plus the mismatched @types/react-router-dom v5 stub from package.json/package-lock.json.
  • Docs/config: corrects the README's stale "Vue interface" heading and src/ketcher path to public/ketcher; adds docstrings to two API endpoints; adds .pytype/ to .gitignore; reformats two over-length lines in view.py and view_test.py.

Confidence Score: 5/5

Safe to merge — all changes are either additive (tests, docstrings) or clearly bounded removals (unused deps, dead gate condition).

The bug fix is straightforward and fully covered by new regression tests. Every removed dependency was verified to have zero import sites, and the lock files are consistent with their manifests. The formatting and documentation changes carry no behavioural risk.

No files require special attention.

Important Files Changed

Filename Overview
ord_interface/visualization/filters.py Bug fix: pressure setpoint now displayed even when no atmosphere is set, by moving the setpoint check outside the atmosphere guard and using a conditional append.
ord_interface/visualization/filters_test.py New regression test file covering all three pressure condition combinations (setpoint only, setpoint+atmosphere, atmosphere only); correctly pinpoints the pre-fix failure.
app/package.json Removes six unused runtime deps (axios, react-hook-form, @hookform/resolvers, @headlessui/react, @heroicons/react) and the mismatched @types/react-router-dom v5 stub.
app/package-lock.json Lock file regenerated to reflect removed deps and their transitive closure; no unexpected additions.
pyproject.toml Drops unused docopt>=0.6.2 Python dependency.
ord_interface/api/search.py Adds one-line docstrings to get_input_stats and get_product_stats to match project documentation style.
ord_interface/api/view.py Pure formatting: two HTTPException raises split across lines to respect the 88-char limit; no logic change.
ord_interface/api/view_test.py Pure formatting: test_client.get call split across lines; no logic change.
ord_interface/api/README.md Corrects stale 'Vue interface' heading to 'React frontend' and updates ketcher install path from src/ketcher to public/ketcher.
.gitignore Adds .pytype/ to gitignore since pytype has been replaced by ty as the project's type checker.
uv.lock Lock file regenerated after removing docopt; only the docopt package entry and its references were removed.

Reviews (1): Last reviewed commit: "Tier 1 cleanup: drop unused deps, fix pr..." | Re-trigger Greptile

Low-risk, mostly zero-behavior-change cleanup:

Dependencies
- Remove unused `docopt` (zero imports) from pyproject.toml; refresh uv.lock.
- Remove 6 unused npm deps (axios, zod, @hookform/resolvers,
  react-hook-form, @headlessui/react, @heroicons/react) plus the
  mismatched @types/react-router-dom (v5 stub against react-router v7,
  which ships its own types); refresh package-lock.json.

Bug fix
- filters.py `_pressure_conditions_html`: the setpoint block was gated on
  `atmosphere.type != UNSPECIFIED`, so a reaction with a pressure setpoint
  but no atmosphere never displayed the setpoint. Gate on the setpoint's
  presence instead (shown bare when there is no atmosphere, parenthetically
  otherwise), matching the temperature filter. Adds filters_test.py with a
  regression case.

Docs / config
- .gitignore: add `.pytype/` (stale output from the abandoned pytype
  checker; `ty` is the checker now).
- api/README.md: the "Vue interface" section is post-migration React;
  fix the heading and the stale `src/ketcher` path (the app loads ketcher
  from `public/ketcher`).
- search.py: add docstrings to the get_input_stats / get_product_stats
  endpoints (project style requires them).

Also reflows two lines in view.py/view_test.py that #187 introduced over
88 chars after #188 landed (no ruff-format gate in CI caught them).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@skearnes

Copy link
Copy Markdown
Member Author

Superseding this in favor of #186, which already landed the same Tier 1 work on main (unused-dep removal, the _pressure_conditions_html setpoint fix + regression test, .pytype gitignore, the stats-endpoint docstrings, and the doc tidies).

The one piece not covered by #186 — reformatting the two over-88 lines in ord_interface/api/view.py/view_test.py that #187 introduced (currently failing check_python on main) — will land as its own small PR.

Analysis performed with Claude Code (Claude Opus 4.7).

@skearnes skearnes closed this Jun 21, 2026
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.

1 participant