Fix Protoss pathing: source PDB from project root, bypass Protoss dir#3
Open
amengland9 wants to merge 2 commits into
Open
Fix Protoss pathing: source PDB from project root, bypass Protoss dir#3amengland9 wants to merge 2 commits into
amengland9 wants to merge 2 commits into
Conversation
Added a function to find Protoss-processed PDB files with case-insensitive lookup and fallback to source PDB.
Benzoin96485
self-requested a review
July 15, 2026 19:24
| Full path to the matched Protoss PDB, or ``None`` if the | ||
| Protoss folder or a matching file inside it doesn't exist. | ||
| """ | ||
| protoss_dir = os.path.join(project_root, "out", pdb_name, "Protoss") |
Collaborator
There was a problem hiding this comment.
Why does this always hold? Where does the out directory come from?
Benzoin96485
left a comment
Collaborator
There was a problem hiding this comment.
Left some comments because I don't think there is a standard output directory prefix like "out" and we shouldn't assume any. Regarding your question, user may confirm the protonation themselves
Comment on lines
+497
to
+498
| if "out" in cwd_parts: | ||
| project_root = os.sep.join(cwd_parts[:cwd_parts.index("out")]) |
Collaborator
There was a problem hiding this comment.
The same question: why "out"?
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.
Description
Fixes the Protoss pathing bug in
get_charges()(qp/manager/charge_embedding.py). Before, the function always sourced the structure PDB for charge embedding fromout/<pdb>/Protoss/<pdb>_protoss.pdb, with no way to point it elsewhere. This PR changes it to look for the source.pdbin the project root (the directory containingout/) using a case-insensitive filename match if it cannot find a Protoss folder, so charge embedding can be run against a structure that bypasses Protoss entirely if desired.Todos
find_source_pdb()helper with case-insensitive glob match and clear errors on zero/multiple matches"out"in the cwd path'/'splitting toos.sepfor Windows compatibility (I usually use the package on my local machine so this was moreso for me)Questions
rename_and_clean_resnames()runs immediately after this and assigns HIP/HIE/HID based onHD1/HE2hydrogens being present which means it assumes a protonated structure. Should there be an explicit check/warning if the bypassed structure isn't already protonated, rather than relying on the user to confirm this themselves?Status