Python bindings for molrs molecular simulation library
Project description
molcrafts-molrs
Python bindings for the molrs molecular modeling toolkit.
This package is the first public preview of the Python API. Install with
pip install molcrafts-molrs and import it as molrs.
Full documentation lives at https://molcrafts.github.io/molrs/. The Python API reference is rendered at https://molcrafts.github.io/molrs/reference/python/.
Install
pip install molcrafts-molrs
Quick start
import numpy as np
import molrs
# Parse SMILES and generate 3D coordinates
ir = molrs.parse_smiles("CCO")
mol = ir.to_atomistic()
result = molrs.generate_3d(mol, molrs.EmbedOptions(speed="fast", seed=42))
frame = result.mol.to_frame()
# Build a system from scratch
frame = molrs.Frame()
atoms = molrs.Block()
atoms.insert("x", np.array([0.0, 0.96, -0.24], dtype=np.float64))
atoms.insert("y", np.array([0.0, 0.0, 0.93], dtype=np.float64))
atoms.insert("z", np.zeros(3, dtype=np.float64))
atoms.insert("element", ["O", "H", "H"])
frame["atoms"] = atoms
Support
- Python 3.9+
pip install molcrafts-molrsimport molrs- Offline API help is available with
help(molrs.Frame)and related symbols
API
Data model
Frame— dict-like container of namedBlocks + optionalBoxBlock— column store backed by numpy arraysBox— simulation box with periodic boundaries
I/O
molrs.read_pdb(path)/molrs.read_xyz(path)→Framemolrs.parse_smiles(smiles)→SmilesIR→.to_frame()
Neighbor search and analysis
nq = molrs.NeighborQuery(box, positions, cutoff=5.0)
nlist = nq.query_self()
rdf = molrs.RDF(100, 5.0)
result = rdf.compute(frame, nlist)
Force field
typifier = molrs.MMFFTypifier()
potentials = typifier.build(atomistic)
Development
maturin build
pip install target/wheels/*.whl
pytest -q
| Component | Version |
|---|---|
| Python | 3.9+ |
| PyO3 | Managed by molrs-python/Cargo.toml |
| maturin | 1.x |
License
BSD-3-Clause
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molcrafts_molrs-0.0.9-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: molcrafts_molrs-0.0.9-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
568ec8746b7eae31e33e02831b542cbbbeed5c9c2f41f0b9e2a718bc9df6e9b8
|
|
| MD5 |
862bbd64010ef82586b5c1e55955e334
|
|
| BLAKE2b-256 |
a2990ceeed0a7188921da1d4865a46b0bb9c1dcb11b6447aa0cde1bf18c52c90
|
Provenance
The following attestation bundles were made for molcrafts_molrs-0.0.9-cp312-abi3-win_amd64.whl:
Publisher:
publish.yml on MolCrafts/molrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molrs-0.0.9-cp312-abi3-win_amd64.whl -
Subject digest:
568ec8746b7eae31e33e02831b542cbbbeed5c9c2f41f0b9e2a718bc9df6e9b8 - Sigstore transparency entry: 1506338401
- Sigstore integration time:
-
Permalink:
MolCrafts/molrs@525738c1e6d235866984f298438a17a7b594a4f4 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@525738c1e6d235866984f298438a17a7b594a4f4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file molcrafts_molrs-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: molcrafts_molrs-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fb80d32576a881a62ceb7d4b41ffab98c61949619e589785696ba27c64efb25
|
|
| MD5 |
db7c709deed015ac6e4ddb056b76751b
|
|
| BLAKE2b-256 |
e6e7cec8bf1e0e4f4a2c8c6ee14fae6f7b9b79667e77c9e6538eed0be8a61298
|
Provenance
The following attestation bundles were made for molcrafts_molrs-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on MolCrafts/molrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molrs-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
0fb80d32576a881a62ceb7d4b41ffab98c61949619e589785696ba27c64efb25 - Sigstore transparency entry: 1506338576
- Sigstore integration time:
-
Permalink:
MolCrafts/molrs@525738c1e6d235866984f298438a17a7b594a4f4 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@525738c1e6d235866984f298438a17a7b594a4f4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file molcrafts_molrs-0.0.9-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: molcrafts_molrs-0.0.9-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.12+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4c038a1abc7bc84ec10594ff6d4560b9138a637712007438ce5a3cf4cf36634
|
|
| MD5 |
1477b1ecc9f306238deef17d10c80951
|
|
| BLAKE2b-256 |
71cb9a3cb9da81d2911aec0e05a6345b0d4dd84634d410b59039dfa470dbde0f
|
Provenance
The following attestation bundles were made for molcrafts_molrs-0.0.9-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
publish.yml on MolCrafts/molrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molrs-0.0.9-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
a4c038a1abc7bc84ec10594ff6d4560b9138a637712007438ce5a3cf4cf36634 - Sigstore transparency entry: 1506338504
- Sigstore integration time:
-
Permalink:
MolCrafts/molrs@525738c1e6d235866984f298438a17a7b594a4f4 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@525738c1e6d235866984f298438a17a7b594a4f4 -
Trigger Event:
workflow_dispatch
-
Statement type: