chore!: modernize SAFE conversion, stereochemistry and generation - #72
Merged
Conversation
…oding feat: connectivity-aware decoding for scaffold completion (refine)
maclandrol
marked this pull request as ready for review
September 3, 2026 09:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelogs
Prepare the next major SAFE release with stricter molecular identity preservation, a maintained generation stack and a lightweight notation-only installation.
Companion PRs: datamol-io/datamol#244, datamol-io/molfeat#124 and datamol-io/medchem#37.
%(100)-style ring closures through conversion and tokenization. Preserve open terminal attachment points without changing lone/degree-two wildcard topology.max_new_tokens. Add opt-intry_hardfiltering/oversampling to design workflows, with structural-constraint checks, stable deduplication and bounded output counts.expts/files as historical research artifacts rather than supported training examples. They are not installed in the Python package.PYPI_API_TOKEN, with a non-publishing dry run, complete test gates, isolated wheel/source tests and attestations.Breaking changes and preserved behavior
safe-mol[model],[train],[viz]or[all]for those features. Core imports do not require Transformers/PyTorch.ignore_errors=Truestill returnsNonefor invalid batch entries. Strict decoding raisesSAFEDecodeError.motif_extension()is deprecated in favor ofscaffold_decoration(..., add_dot=True);max_lengthis deprecated in favor ofmax_new_tokens.try_hardreduces invalid/duplicate candidates but cannot guarantee the requested count or global chemical diversity. Unsupported stereo is rejected rather than silently approximated.Issues and contributor history
Closes #70 (Transformers 5 import/inference compatibility).
Closes #67 (attachment-point preservation and scaffold decoration).
Closes #32 (wildcard topology artifacts).
Closes #55 (obsolete import dependencies; maintained Python support is now 3.11–3.14, not 3.9/3.10).
Refs #62: local/offline checkpoint loading is now explicit, but this does not repair a user's network configuration. #69 (paper reinforcement-learning workflow) is not addressed by this maintenance PR.
Please use a merge commit so the original #71/#33 contributions remain in the main history.
Intel macOS compatibility
SAFE's notation core supports Intel macOS, including co-installation with Molfeat. SAFE-GPT model/training extras require PyTorch 2.5+ and cannot use the final official Intel macOS PyTorch 2.2 wheels. This boundary is now explicit in the README, migration guide and changelog. Local regression check: 109 non-integration tests passed after the dependency audit.
Validation
Checklist:
fixlabel.Release and licensing discussion
Draft pending model-license clarification. Code is Apache-2.0; the separately distributed training dataset is CC BY 4.0. The two root license files describe different materials, not alternative licenses for SAFE's Python code, so neither has been removed.
The existing README says SAFE-GPT weights are CC BY-NC 4.0, while the model card at the pinned revision declares Apache-2.0. This discrepancy is now explicit in the README and needs an owner decision; this PR does not relicense or redistribute the weights.
Merging will not publish a package or create a version. After resolving that discrepancy, finalize the changelog and run the manual release rehearsal from
main. Seedocs/releasing.mdfor publication and conda-forge follow-up. No package upload was attempted during this audit.This PR is AI-assisted.