Skip to main content

Python bindings for molrs molecular simulation library

Project description

molcrafts-molrs

PyPI

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-molrs
  • import molrs
  • Offline API help is available with help(molrs.Frame) and related symbols

API

Data model

  • Frame — dict-like container of named Blocks + optional Box
  • Block — column store backed by numpy arrays
  • Box — simulation box with periodic boundaries

I/O

  • molrs.read_pdb(path) / molrs.read_xyz(path)Frame
  • molrs.parse_smiles(smiles)SmilesIR.to_frame()

Neighbor search and analysis

nq = molrs.NeighborQuery(box, positions, cutoff=5.0)
nlist = nq.query_self()

from molrs.compute.density import RDF
rdf = 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (9.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 be384d81f5c578c32e4a7e66599929b07dcdd1547b9f09c1d300b3e55dbf82ab
MD5 440f6df6b3fe6a8b5f8262b41b943201
BLAKE2b-256 26bf436eebebc9a1b5fed4dab55e19bb4a81b8ccc094c8f528e6cef954821fc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-win_amd64.whl:

Publisher: nightly.yml on MolCrafts/molrs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67a1d85f4be405b44a6963a0f39402c5b48daf4cc8a17ecbdb25d16d9dc98381
MD5 1b2ef589e68f00f48aaaee58533a2e9e
BLAKE2b-256 60d369d99b114db5d41e7faee9c8e8b313c67577bc98116434c24ad93d028afd

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: nightly.yml on MolCrafts/molrs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 52c8e45b7d8f134205b476360852cb96caa05910c93781f85119fa01d2ec712d
MD5 1a136de4fa4a0f82717fd06510a49a5f
BLAKE2b-256 4a2cbefb3e084b06ec2a8bfc51fb034d3c59ced5c14df64a71e4cfa8e1478a91

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrafts_molrs_nightly-0.1.0.dev202606122218-cp312-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: nightly.yml on MolCrafts/molrs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page