Mdc/issue 231 dont delete structure file#256
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughFixes a Path-vs-string comparison in get_reward_function_and_structure to prevent deletion of caller files, adds a unit test verifying preservation of the original CIF, and restructures pyproject.toml Pixi configs to add an osx-arm64 feature/environment and move platform-specific toolchain deps. ChangesPixi Platform and Dependency Configuration
Path Comparison Bug Fix and Test Coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pyproject.toml (2)
121-121: 💤 Low valueConsider whether
boltz-osxshould be included in cross-environment testing.The
test-alltask runs tests acrossboltz-dev,protenix-dev, andrf3-devenvironments but does not include the newly addedboltz-osxenvironment. Ifboltz-osxis intended for development use on macOS, consider whether it should be tested alongside the other environments (e.g., asboltz-osxor a hypotheticalboltz-osx-dev).This may be intentional if
boltz-osxis only for local development and not CI, or if the test matrix is handled differently for macOS.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyproject.toml` at line 121, The test-all command in pyproject.toml currently runs environments boltz-dev, protenix-dev, and rf3-dev but omits the new boltz-osx environment; update the test-all task command string (the cmd value in pyproject.toml for the test-all task) to include running the boltz-osx environment (or boltz-osx-dev if you created a dev variant) alongside the others, ensuring the command preserves the existing OR-fail logic (|| f=1) and final exit $f behavior so failures are aggregated the same way.
20-31: Reproducibility concern is mitigated bypixi.lock, but'*'ranges still affect future lock refreshes
pyproject.tomlpinsboltz,cuequivariance-torch,cuequivariance-ops-torch-cu12,protenix,einx, andtritonwith'*'in[tool.pixi.feature.*](lines 20-31). However,pixi.lockresolves them to concrete versions (e.g.,boltz==2.2.1,cuequivariance-torch==0.6.1,protenix==0.7.3,einx==0.3.0,triton==3.3.1), so builds using the lockfile remain reproducible/stable.If lock regeneration is expected to happen frequently, consider replacing
'*'with bounded ranges (at least lower bounds) to reduce the risk of breaking updates whenpixi lockis run.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyproject.toml` around lines 20 - 31, The pyproject.toml feature sections [tool.pixi.feature.boltz], [tool.pixi.feature.boltz-osx], and [tool.pixi.feature.protenix] use '*' for pypi-dependencies (keys: "boltz", "cuequivariance-torch", "cuequivariance-ops-torch-cu12", "rdkit", "protenix", "einx", "triton"), which relies on pixi.lock for reproducibility but allows risky version changes when the lock is regenerated; update those pypi-dependencies to include at least explicit lower bounds or bounded ranges (e.g., replace "*" with ">=<min_version>" or a caret/range) for each named package to limit unexpected upgrades and document the chosen bounds in a comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pyproject.toml`:
- Line 121: The test-all command in pyproject.toml currently runs environments
boltz-dev, protenix-dev, and rf3-dev but omits the new boltz-osx environment;
update the test-all task command string (the cmd value in pyproject.toml for the
test-all task) to include running the boltz-osx environment (or boltz-osx-dev if
you created a dev variant) alongside the others, ensuring the command preserves
the existing OR-fail logic (|| f=1) and final exit $f behavior so failures are
aggregated the same way.
- Around line 20-31: The pyproject.toml feature sections
[tool.pixi.feature.boltz], [tool.pixi.feature.boltz-osx], and
[tool.pixi.feature.protenix] use '*' for pypi-dependencies (keys: "boltz",
"cuequivariance-torch", "cuequivariance-ops-torch-cu12", "rdkit", "protenix",
"einx", "triton"), which relies on pixi.lock for reproducibility but allows
risky version changes when the lock is regenerated; update those
pypi-dependencies to include at least explicit lower bounds or bounded ranges
(e.g., replace "*" with ">=<min_version>" or a caret/range) for each named
package to limit unexpected upgrades and document the chosen bounds in a
comment.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 50420851-c55f-4a54-b4d5-d00a3a357eb7
⛔ Files ignored due to path filters (1)
pixi.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
pyproject.tomlsrc/sampleworks/utils/guidance_script_utils.pytests/utils/test_guidance_script_utils.py
# Conflicts: # pixi.lock
…structure files.
fb6ab1f to
1c00e22
Compare
k-chrispens
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the fix.
This makes a small change to make sure we do not delete original input structure files, and adds a test to ensure this behavior remains correct. This scenario arose because we started checking for unusual CIF files that include different sequences at altloc positions (when there is compositional heterogeneity in the crystal structure, in our case because some fraction of the protein in the crystal is chemically modified). If there were no changes needed, we returned the original file path. We wanted to delete any temporarily created files, but checked that the file was temporary by testing that the file was not the original, but only tested that the file name object was different than the original--these could be Path and str objects which were logically the same but not strictly the same type, and therefore we could accidentally delete the original file by unlinking it.
Resolves #231
Summary by CodeRabbit
New Features
Bug Fixes
Chores