Skip to content

Remove Rxn-INSIGHT reaction classification - #978

Merged
skearnes merged 6 commits into
mainfrom
agent/remove-reaction-classification
Aug 18, 2026
Merged

Remove Rxn-INSIGHT reaction classification#978
skearnes merged 6 commits into
mainfrom
agent/remove-reaction-classification

Conversation

@skearnes

@skearnes skearnes commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

Reaction classification ran inside the ORM's derived stage, behind --classify_reactions and a guarded import, writing labels to derived.reaction_classes. Removing it: the model is a transformer loaded per worker, and that work belongs to a job that can be given a GPU rather than to the ingest that loads a dataset.

Changes

  • Deleted ord_schema/orm/reaction_class.py and its test.
  • database.py: the guarded import, _classify_reactions, classify_dataset, and the classify_reactions argument to update_derived_data.
  • loading.py: the classify pass, _classify_shard, _CLASSIFY_JOBS_CAP, and the classify_reactions / classify_jobs arguments to load_datasets and derive_dataset.
  • scripts/add_datasets.py: --classify_reactions and --classify_jobs.
  • derived_mappers.py: the ReactionClasses mapper, which is the schema change — see Notes.
  • pyproject.toml: the reaction-class extra, added one PR down the stack and now unnecessary.
  • Docs: the ORM README and the orm-database-load skill.

Testing

uv run pytest -n auto — 1186 passed. All three of the suite's skips are gone with it, since every one was a test the missing extra was skipping:

SKIPPED ord_schema/orm/reaction_class_test.py:21: could not import 'rxn_insight'
SKIPPED ord_schema/orm/database_test.py:287: reaction-class extra not installed
SKIPPED ord_schema/dependencies_test.py:214: ord-schema[orm,reaction-class] is not installed here

No consumer at origin references reaction_class, classify_dataset, classify_reactions, or reaction_classes — checked against origin/main of ord-interface, ord-app, ord-infrastructure, and ord-data.

Notes

This changes the schema. The mappers are what create the tables, so a database built after this has no derived.reaction_classes. An existing one keeps the table and its rows, now unmapped and untouched by any pass here; dropping it is a separate decision, and a GPU job that writes classifications later can define its own.

Stacked on #976, which is where the reaction-class extra was added — it was a true statement about the tree as it stood, and this PR removes both the extra and what needed it. Retarget to main once #976 lands.

🤖 Generated with Claude Code

Greptile Summary

The PR removes Rxn-INSIGHT reaction classification from the ORM and its installation surface.

  • Removes the classification mapper, implementation, loading pass, API parameters, and CLI flags.
  • Removes the optional dependency profile and its transitive lockfile packages.
  • Updates ORM documentation, operational guidance, and tests to match the reduced schema and interfaces.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
ord_schema/orm/database.py Removes the guarded classifier import, classification API, and classification option from derived-data updates.
ord_schema/orm/loading.py Removes classification workers and arguments while preserving the SMILES and RDKit derivation pipeline.
ord_schema/orm/derived_mappers.py Removes the ReactionClasses mapper so newly prepared databases no longer create that table.
ord_schema/orm/scripts/add_datasets.py Removes the classification-related command-line options and forwarding logic.
pyproject.toml Removes the obsolete reaction-class optional dependency profile.
uv.lock Prunes the removed reaction-class profile and its transitive dependency graph.
ord_schema/dependencies_test.py Removes dependency-profile coverage for the deleted classifier module and extra.
ord_schema/orm/README.md Removes the remaining documentation for reaction-class schema data and classification controls.

Reviews (2): Last reviewed commit: "Merge main into agent/remove-reaction-cl..." | Re-trigger Greptile

skearnes and others added 3 commits August 17, 2026 20:06
ord_schema.search.execute imports ord_schema.artifacts.pivot, which
imports inflection to name a pivot's ordinal columns; inflection was
declared only by the orm extra. A development checkout installs every
group, so the suite passed while `pip install ord-schema[search]`
produced a subpackage that raises ModuleNotFoundError on import.

The test walks the import graph from the search entry points and asks
importlib.metadata which distribution provides each module reached,
which needs no hand-maintained map of module to distribution.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each profile owns the modules no more specific one claims, so the base
install is checked against everything the extras do not carry, and an
extra is checked against what its own subpackage imports. An import
inside a try is one the module states it can do without, so it belongs
to the profile owning the guarded module rather than to this one.

Doing that to the ORM turned up a second gap: reaction_class.py imports
rxn-insight and rxnmapper, and database.py tells whoever hits the
resulting ImportError to install ord-schema[reaction-class], which
pyproject did not define -- so following the instruction installed
nothing and changed nothing. The extra exists now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Classification ran inside the ORM's derived stage, behind an opt-in flag
and a guarded import, and the labels it wrote went to
derived.reaction_classes. That is not the shape this should take: the
model is a transformer per worker, and the work belongs to a job that
can be given a GPU rather than to the ingest that loads a dataset.

Removed the module, the classify pass and its shard pool, the flags that
reached them, the mapper for the table, and the pages that documented
them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Base automatically changed from agent/declare-inflection-for-search to main August 18, 2026 00:43
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	ord_schema/dependencies_test.py
Comment thread ord_schema/dependencies_test.py
Comment thread ord_schema/orm/README.md
skearnes and others added 2 commits August 17, 2026 20:53
Merging main brought the reaction-class extra back: main gained it in a
squash-merge, so relative to the merge base only main had touched those
lines and the deletion did not survive. Removed again, with the lockfile
regenerated.

The rest is prose that says "reaction classes" in words rather than in
the identifiers the first pass grepped for -- the schema description and
the loading overview in the ORM README, the same sentence in the
orm-database-load skill, the loading module docstring, and two lines in
database.py.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skearnes
skearnes merged commit 8661e46 into main Aug 18, 2026
22 of 23 checks passed
@skearnes
skearnes deleted the agent/remove-reaction-classification branch August 18, 2026 00:59
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