Skip to content

Ship rfdiffusion/inference/sym_rots.npz in built distributions (fixes #305) - #461

Open
AtharvaTilewale wants to merge 1 commit into
RosettaCommons:mainfrom
AtharvaTilewale:fix/305-package-sym-rots
Open

AtharvaTilewale wants to merge 1 commit into
RosettaCommons:mainfrom
AtharvaTilewale:fix/305-package-sym-rots

Conversation

@AtharvaTilewale

@AtharvaTilewale AtharvaTilewale commented Oct 24, 2026 •

Copy link
Copy Markdown

Problem

Any symmetry run from a non-editable install (pip install ., the wheel, the sdist, or the Dockerfile's pip install /app/RFdiffusion) dies in SymGen.__init__:

FileNotFoundError: [Errno 2] No such file or directory:
'.../site-packages/rfdiffusion/inference/sym_rots.npz'

The reporter's workaround was to cp the file into site-packages from the Dockerfile.

Root cause

setup.py uses find_packages() and declares no package data. find_packages() only collects Python modules, so rfdiffusion/inference/sym_rots.npz — the only non-.py file in the package — is left out of every built distribution. symmetry.py loads it from the installed package directory (pathlib.Path(__file__).parent), so tetrahedral, octahedral and icosahedral symmetry all fail. The README's pip install -e . route hides this, because an editable install points back at the source tree.

What this changes

One line in setup.py:

package_data={'rfdiffusion.inference': ['sym_rots.npz']},

No version bump, no new dependency, no change to any module.

Validation

The project's only test harness (tests/test_diffusion.py) needs the downloaded checkpoints and the CUDA dgl/torch wheels, neither of which is reachable from this machine, so it was not run; this change touches packaging metadata only. Instead, the distributions were built and installed:

python -m pip wheel . --no-deps --no-build-isolation -w val/<label>
python -m build --sdist --no-isolation -o val/<label> .
python -m venv val/<label>/venv && val/<label>/venv/bin/pip install --no-deps <wheel>

Before the change (at 86507b6) the wheel holds only the four modules:

    rfdiffusion/inference/__init__.py
    rfdiffusion/inference/model_runners.py
    rfdiffusion/inference/symmetry.py
    rfdiffusion/inference/utils.py
WHEEL: sym_rots.npz MISSING
SDIST: sym_rots.npz MISSING
    FileNotFoundError: [Errno 2] No such file or directory: '.../site-packages/rfdiffusion/inference/sym_rots.npz'
INSTALL: LOAD FAILED

After the change:

    rfdiffusion/inference/__init__.py
    rfdiffusion/inference/model_runners.py
    rfdiffusion/inference/sym_rots.npz
    rfdiffusion/inference/symmetry.py
    rfdiffusion/inference/utils.py
WHEEL: sym_rots.npz PRESENT
SDIST: sym_rots.npz PRESENT
    np.load OK, keys = ['icosahedral', 'octahedral', 'tetrahedral']
INSTALL: LOAD OK

Driving the real class from the installed (non-editable) package reproduces the issue's frame and then clears it:

# wheel built before the change
>>> symmetry.SymGen('tetrahedral', recenter=True, radius=10.0)
FileNotFoundError: ... sym_rots.npz
# wheel built after the change
>>> symmetry.SymGen('tetrahedral', recenter=True, radius=10.0)
SymGen(tetrahedral): order = 12, first rot shape (3, 3)

pip install -e . --no-deps was re-checked afterwards and still resolves SymGen('tetrahedral') (order = 12) from the source tree, so the documented install route is unchanged.

Fixes #305

Disclosure: this change was prepared with AI assistance and validated locally as described above.

find_packages() only collects Python modules, so a non-editable install
(pip install ., the wheel, the sdist, and the Dockerfile's
`pip install /app/RFdiffusion`) left out rfdiffusion/inference/sym_rots.npz.
symmetry.py loads that file from the installed package directory, so every
tetrahedral, octahedral and icosahedral run died with

    FileNotFoundError: .../rfdiffusion/inference/sym_rots.npz

Editable installs hide this because they point back at the source tree.

Fixes RosettaCommons#305
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.

FileNotFoundError - sym_rots.npz

1 participant