-
Notifications
You must be signed in to change notification settings - Fork 3
use packmol from PyPI #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| from ase.io.proteindatabank import write_proteindatabank | ||
| from rdkit import Chem | ||
|
|
||
| from molify.packmol import get_packmol_binary | ||
| from molify.utils import calculate_box_dimensions | ||
|
|
||
| log = logging.getLogger(__name__) | ||
|
|
@@ -147,7 +146,7 @@ def pack( | |
| seed: int = 42, | ||
| tolerance: float = 2, | ||
| verbose: bool = False, | ||
| packmol: str | None = None, | ||
| packmol: str = "packmol", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainBreaking change: Verify documentation and migration guide. Changing from Run the following script to check if the README or documentation mentions the new Packmol installation requirement: 🏁 Script executed: #!/bin/bash
# Check if documentation mentions packmol installation requirement
echo "=== Checking README ==="
fd -t f "README" --exec cat {} \; | grep -i "packmol" -C 3
echo -e "\n=== Checking docs directory ==="
fd -t f . docs/ --exec grep -l "packmol" {} \; 2>/dev/null | head -5
echo -e "\n=== Checking for installation instructions ==="
rg -i "install.*packmol|packmol.*install|pip install.*packmol" -C 2Length of output: 967 🏁 Script executed: #!/bin/bash
# Check documentation content and changelog
echo "=== README content (full) ==="
fd -t f "README*" --exec cat {} \;
echo -e "\n=== Checking docs/source/index.rst ==="
cat docs/source/index.rst 2>/dev/null | head -100
echo -e "\n=== Looking for CHANGELOG or version notes ==="
fd -t f "CHANGELOG|HISTORY|CHANGES|NEWS" --exec cat {} \; 2>/dev/null | head -50
echo -e "\n=== Checking if pack.py has error messages about packmol ==="
rg -n "packmol" src/molify/pack.py | head -20Length of output: 6392 🏁 Script executed: #!/bin/bash
# Check setup configuration and error handling
echo "=== Checking setup.py / pyproject.toml ==="
fd -t f "setup.py|pyproject.toml|setup.cfg" --exec cat {} \;
echo -e "\n=== Error handling in pack.py around line 227-234 ==="
sed -n '220,240p' src/molify/pack.py
echo -e "\n=== Full _run_packmol function ==="
sed -n '63,80p' src/molify/pack.pyLength of output: 2791 🌐 Web query: 💡 Result: There isn't an official "packmol" Python library on PyPI that contains the PACKMOL solver itself. PACKMOL is a standalone packing program (source/binaries distributed from the project site and via conda-forge) that creates initial molecular configurations for MD simulations. PyPI instead hosts related packages that wrap or integrate PACKMOL (e.g. packmol-step — a SEAMM plug‑in for building periodic fluid boxes; mdapackmol — an MDAnalysis wrapper around Packmol). [1][2][3] Sources:
🌐 Web query: 💡 Result: Short answer: "Packmol" is primarily a standalone program (written in Fortran) that builds initial molecular configurations by packing molecules into user‑defined regions for molecular‑dynamics or docking setups. It is not primarily a pure‑Python PyPI package — instead you usually install the Packmol executable (e.g., from the Packmol GitHub/releases or via conda‑forge) and use Python wrappers on PyPI that call it (examples: mdapackmol, packmol-step). Sources: Packmol GitHub (project & install info) [1], PyPI pages for Python wrappers (mdapackmol, packmol‑step) [2][3]. References
🌐 Web query: 💡 Result: There is no official PyPI package named "packmol" (version 0.1.0) — PACKMOL is distributed from its upstream site and via OS packages; Python wrappers/integration packages exist on PyPI (e.g., packmol-step, mdapackmol). Sources: PACKMOL upstream (download/docs). [1] Packmol-step on PyPI. [2] MDAPackmol on PyPI. [3] Sources
🏁 Script executed: #!/bin/bash
# Check if there's actually a packmol package on PyPI or if this is a broken dependency
echo "=== Searching for any reference to packmol package in repo ==="
rg -i "packmol" pyproject.toml setup.py setup.cfg 2>/dev/null
echo -e "\n=== Checking if packmol is imported anywhere ==="
fd -t f "\.py$" --exec grep -l "import packmol\|from packmol" {} \; 2>/dev/null
echo -e "\n=== Looking at imports in pack.py ==="
head -30 src/molify/pack.pyLength of output: 1268 🏁 Script executed: #!/bin/bash
# Final verification - check git history or comments about packmol dependency
echo "=== Checking git log for packmol changes ==="
git log --oneline -20 2>/dev/null | head -10
echo -e "\n=== Check if this is perhaps a typo or if packmol.py file exists ==="
fd -t f "packmol" src/
echo -e "\n=== Look at molify.packmol module (referenced in pyproject.toml) ==="
fd -t f "packmol.py" --exec head -50 {} \;Length of output: 649 🏁 Script executed: #!/bin/bash
# Check the latest commit details
echo "=== Full commit message for latest packmol change ==="
git show df9c6e8 --stat 2>/dev/null
echo -e "\n=== What changed in that commit ==="
git show df9c6e8 --no-stat 2>/dev/null | head -100
echo -e "\n=== Check if packmol package actually exists by searching PyPI ==="
python3 << 'EOF'
import urllib.request
import json
try:
with urllib.request.urlopen("https://pypi.org/pypi/packmol/json") as response:
data = json.loads(response.read().decode())
print(f"Package found: {data['info']['name']}")
print(f"Latest version: {data['info']['version']}")
print(f"Description: {data['info']['summary']}")
except urllib.error.HTTPError as e:
print(f"Package not found on PyPI (HTTP {e.code})")
EOFLength of output: 2740 Multiple critical issues: Broken dependency, misleading documentation, and unhandled breaking change. The breaking change itself is legitimate, but the implementation has critical flaws:
Remove the broken 🤖 Prompt for AI Agents |
||
| pbc: bool = True, | ||
| output_format: FORMAT = "pdb", | ||
| ratio: tuple[float, float, float] = (1.0, 1.0, 1.0), | ||
|
|
@@ -169,11 +168,8 @@ def pack( | |
| The tolerance for the packing algorithm, by default 2. | ||
| verbose : bool, optional | ||
| If True, enables logging of the packing process, by default False. | ||
| packmol : str or None, optional | ||
| The path to the packmol executable. If None (default), uses the bundled | ||
| packmol binary shipped with molify. You can provide a custom path to | ||
| use a different packmol installation (e.g., "packmol" to use system | ||
| PATH, or "/path/to/custom/packmol"). | ||
| packmol : str, optional | ||
| The path to the packmol executable. | ||
| pbc : bool, optional | ||
| Ensure tolerance across periodic boundaries, by default True. | ||
| output_format : str, optional | ||
|
|
@@ -199,10 +195,6 @@ def pack( | |
| >>> print(packed_system) | ||
| Atoms(symbols='C10H44O12', pbc=True, cell=[8.4, 8.4, 8.4]) | ||
| """ | ||
| # Use bundled packmol binary if not specified | ||
| if packmol is None: | ||
| packmol = str(get_packmol_binary()) | ||
|
|
||
| selected_images = _select_conformers(data, counts, seed) | ||
| cell = calculate_box_dimensions(images=selected_images, density=density) | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Invalid PyPI dependency — packmol is not published on PyPI.
The dependency
"packmol>=21.1.2"cannot be resolved. The PACKMOL program is not distributed as a package on PyPI; it is distributed via GitHub releases, conda-forge, or compiled from source. This matches the issue flagged in the previous review. The PR description indicates the checklist item "wait for PyPI release of packmol with correct version number" is still unchecked, confirming the PyPI package is not yet available.pip install molifywill fail when this dependency cannot be resolved.Please confirm the package availability:
If PACKMOL is not published to PyPI, consider:
[project.optional-dependencies]or[dependency-groups]dev if packmol is only needed for certain features.conda install -c conda-forge packmolbeforepip install molify.🌐 Web query:
💡 Result:
Short answer: No — Packmol (including v21.1.2) is not available on PyPI. Packmol is distributed from its source/GitHub and via conda-forge (conda); mbuild and other docs note PACKMOL is not on pip. (github.com)
Citations:
Critical: Remove invalid PyPI dependency — packmol is not published on PyPI.
Packmol (including v21.1.2) is not available on PyPI and is distributed from its source/GitHub and via conda-forge. The dependency
"packmol>=21.1.2"cannot be resolved duringpip install molify, causing installation to fail. The PR description checklist confirms the PyPI release is still pending (unchecked item: "wait for PyPI release of packmol with correct version number").Remove this line from
pyproject.tomlor move packmol to optional dependencies until the package is officially released to PyPI. If packmol is required for certain features only, use[project.optional-dependencies]and update documentation to guide users to install viaconda install -c conda-forge packmolfirst.🤖 Prompt for AI Agents