Molecules, crystals, promolecule and Hirshfeld surfaces using python.
Project description
chmpy
A library for computational chemistry in python. Featuring support for molecules, crystals, Hirshfeld & promolecule density isosurfaces, spherical harmonic shape descriptors and much more…
Installation
Basic installation can be done through the python package manager pip:
pip install chmpy
If you wish to develop/modify the code, then you should use poetry:
poetry install --no-root poetry install
The first poetry install appears to be required as poetry does not install dev dependencies before building, and this package uses Cython.
Features
While the library is intended to be flexible and make it easy to build complex pipelines or properties, the following is a brief summary of intended features:
Load crystal structures from .cif, .res, POSCAR files.
Evaluate promolecule and procrystal electron densities.
Easily generate Hirshfeld or promolecule isosurfaces and associated properties.
Easily generate spherical harmonic shape descriptors for atoms, molecules, or molecular fragments.
Efficiently calculate crystal slabs, periodic connectivity and more…
Automatic parallelization of some calculations using OpenMP (set the OMP_NUM_THREADS environment variable)
It should also serve as a simple, easy to read library for learning how to represent crystal structures, molecules etc. and evaluate scientifically relevant information quickly and efficiently using python.
Examples
Crystal structures and molecules
Loading a crystal structure from a CIF (.cif) or SHELX (.res) file, or a molecule from an XMOL (.xyz) file is straightforward:
>>> from chmpy import Crystal, Molecule >>> c = Crystal.load("tests/acetic_acid.cif") >>> c <Crystal C2H4O2 Pna2_1> # Calculate the unique molecules in this crystal >>> c.symmetry_unique_molecules() [<Molecule: C2H4O2(2.12,1.15,0.97)>] >>> m = Molecule.load("tests/water.xyz") >>> m <Molecule: H2O(-0.67,-0.00,0.01)>
Hirshfeld and promolecule density isosurfaces
Generation of surfaces with the default settings can be done with minimal hassle, simply by using the corresponding members of the Crystal class:
>>> c = Crystal.load("tests/test_files/acetic_acid.cif") # This will generate a high resolution surface # for each symmetry unique molecule in the crystal >>> surfaces = c.hirshfeld_surfaces() >>> surfaces [<trimesh.Trimesh(vertices.shape=(3598, 3), faces.shape=(7192, 3))>] # We can generate lower resolution surfaces with the separation parameter >>> surfaces = c.hirshfeld_surfaces(separation=0.5) >>> surfaces [<trimesh.Trimesh(vertices.shape=(584, 3), faces.shape=(1164, 3))>] # Surfaces can be saved via trimesh, or a utility function provided in chmpy >>> from chmpy.util.mesh import save_mesh >>> save_mesh(surfaces[0], "acetic_acid.ply")
The resulting surface should look something like this when visualized:
Project details
Release history Release notifications | RSS feed
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
Hashes for chmpy-1.1.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78bbd9db1b28fd95fe3fef967cb71f295bf8a8823d55894f120d3080bcc4ea84 |
|
MD5 | 923e83d939bdfa3fc7e2420115fe3c77 |
|
BLAKE2b-256 | 911fbe512d3941f5443e181e53e167ecc165f0332f5d42bbb413a709c15a83bf |
Hashes for chmpy-1.1.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06ab107371fc0170337389e003c580b5a5bbf3d16461de32a08307e38757ea1b |
|
MD5 | 189e28be532416ded9a939fcda322f8c |
|
BLAKE2b-256 | b1a302ead5fba78f2344bc2af7182b5f045bb49b70009fd99e7eff46ef4fc88f |
Hashes for chmpy-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aa8205819fe7696e33af7ae2cc5c1ad14f08e9780057b5d3c4be09da2f84a8a |
|
MD5 | 1a48586135d57d8962968e23fcb9c900 |
|
BLAKE2b-256 | b2f3544d85808ccf6f96e30dfa38085e0c111907e3b0d9123ba6004fa9bf312b |
Hashes for chmpy-1.1.0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac408b19d3c83fae05257e53822194b3e35ad32d1e6dbbd481918487e8d28f8 |
|
MD5 | 9ca8dc7e200f4937450ed0138064a7a6 |
|
BLAKE2b-256 | a842098dc08d48a0d2e0904e94cb494fb2b8f5441ccc6c7d3d73439a4b49b43b |
Hashes for chmpy-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c9a5efd8866dd0419405ed135015fefea0daec9072ce92c0c8915a82352e1d0 |
|
MD5 | 27c7caf85e822230ceb15640fddc511b |
|
BLAKE2b-256 | df20de951d2ef1fb5b9e2ea149c4f131901eb6c8f075993911993691d5d6df83 |
Hashes for chmpy-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc7dcffc83719327a1ee8f7b045fe3da3307cbbb8c43a4f12af785200f371e92 |
|
MD5 | b42b0b8a3180e110645a2b1fece8590c |
|
BLAKE2b-256 | 16d760108fa0c1957f6394d9a610c2e24936eaceb25b8e9aa8b74bdded08076b |
Hashes for chmpy-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 847c30518f7b00a090c636131b2ec93eb9c58c99c1f83529b441e573f5ef39a1 |
|
MD5 | 860b8de625c7e23e370ca82333a3cbff |
|
BLAKE2b-256 | 7cab7dd8f6e575762f81690ae4740f229bb7e67575d45e1fe81656221d76cea7 |
Hashes for chmpy-1.1.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f6d2100b240da24ed642926d3ab052981824e59efa06e2a55936cd97c6d84d8 |
|
MD5 | 7d00016b359bceff564456d5cee868fc |
|
BLAKE2b-256 | e6d00d0595d6017299554897c3e69171fb460a76fd079ed0965c36d931000359 |
Hashes for chmpy-1.1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90393707ebbee8fc70236b3e39e1f5997bd65d633ffc411570ce1cff242ff214 |
|
MD5 | 73bd4afcbc09098d2458675e78e0d866 |
|
BLAKE2b-256 | b68680ea5d6ea946b3a9e31fc72965424881fe042ae0d810d7d8853e5f93af5c |
Hashes for chmpy-1.1.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 431e0e410d999d08e718d165f53d38e007a55e7c5f653b300fb827b015488776 |
|
MD5 | 16d6bccd618baf342c319b676d6a679a |
|
BLAKE2b-256 | 4e19d479ce955bf5c60dcb6bfe38a2c984567c819e96b79605dacd3256d39c14 |
Hashes for chmpy-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c4c00a0cf6ef379619cf8b2b3eb2882471cd1aa5633ffd67303f80b51a7ea1 |
|
MD5 | 82acbc55bc68fa048689f5db672a72dc |
|
BLAKE2b-256 | 7e67f8f43a7c69f1a9e941562054322127af178012537809378614a9798642c7 |
Hashes for chmpy-1.1.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4324366685783abcd456bda30f61d10bb2b9f09990b4d39c0399a2ac8a6172b9 |
|
MD5 | e0a275f85dda12561a83f84635976d18 |
|
BLAKE2b-256 | 2a46bdc50ffb33cfeae6fc4e2636f3f78262343f52567f0a9f89eeaf27f4f874 |
Hashes for chmpy-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a35d461174e1efc7890eea456fb17487642696e371c5dcaf3c751a283420b4f4 |
|
MD5 | 66bcd472dd47285010233dc9f147c605 |
|
BLAKE2b-256 | 12c606a1f0acf35389259728b427d5e24e7c85ce607fa058e48b7a27fe33458b |
Hashes for chmpy-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90ab76e247c1d6446a35adad0c7acff79555a9eaaab3b957efb9865283409990 |
|
MD5 | 12ed2004a9c95792c6ba105619e81ae4 |
|
BLAKE2b-256 | 39c63e0d2415ce8186375254fefb6b8c905a074ba7775ab57d0a2d6536520fd4 |
Hashes for chmpy-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2585bc3be4ba595fc2d38d211d1c70e8248495880e65b9b014dd1f773bb28a8 |
|
MD5 | 29c6e51a6537cd77ffcf51c0d133d8ea |
|
BLAKE2b-256 | dfe4ce5cab32973525366ab33fb42a50a1466045b4fedced74b60df8fa6ad60b |
Hashes for chmpy-1.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9661a21d67384186415b5a11154cf19312905882adf0d1bfcd6d1b42efe6af5 |
|
MD5 | ff088b6aaf62d16657978d88defe9f7e |
|
BLAKE2b-256 | 4a4c7ae568ea1c560fc69f2a52c7b0698431299913f0681cf56e880fdee14e91 |
Hashes for chmpy-1.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a4fcbec4145905cad9e97ea839cba53bbc059f3172857eb9911b218f86fb3b |
|
MD5 | 7d9241156d3d87d333dda770c290b4f5 |
|
BLAKE2b-256 | 5cb30088fc49c407c862280971be293204e31d91ba7c2bab8664983658166898 |
Hashes for chmpy-1.1.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 189e156ab88db9a523e7f02cff9bca4e52f9439a21a69781615206c0b54c2415 |
|
MD5 | 67333916bdd31f2f2c7f47238be6a85a |
|
BLAKE2b-256 | e20cc5c12d7484b41bc7988f826884eabaee2ef8d63c53c36c886fd2260a4f0c |
Hashes for chmpy-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f573204d29615b92c688155907cc93016b75796a26b9ba649963a519a6a9444 |
|
MD5 | 0e3cff15632a54e12ae1784c688ca3fe |
|
BLAKE2b-256 | a2f43a11979e4ae36e258a51484aaad6fd8e3369aa0fa1ee2919c3eda34160d7 |
Hashes for chmpy-1.1.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3251e46169a9931cc340ca7f239ea4c3e11764799903e0473f16dc824888be3f |
|
MD5 | 6dc3ea174c27e7058a82cfc63db79023 |
|
BLAKE2b-256 | 1e92204e173c2f80526b585738567442a1a4e5d8e7a5fe6ea18e5425d2bb922e |
Hashes for chmpy-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a42dda488c68048144a1cdeb460edf405223509765436af570a392c2339ba498 |
|
MD5 | 3ffb8584b432efeb4be170680e90bc8d |
|
BLAKE2b-256 | b3ba0625ff602e308b8f4a0f99dc1bc6dfd2804a30b5793cccc3d773b0d07d04 |
Hashes for chmpy-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7529321c28848dab81f90816e33f12f4655ef74cb18effb72ad94236682061d7 |
|
MD5 | 1a46f7598c307321b14f36e07789e0c5 |
|
BLAKE2b-256 | d0d9c76284e3ab349497b34f7af3acd0c5118e5656ea0155db54e657848ba31b |
Hashes for chmpy-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51689b5131bc0ff5bba84de85afcc20c6e6274d3b3d991cd83bc7e502da456c7 |
|
MD5 | cd09ccada627ccdcd480b49a43d080bb |
|
BLAKE2b-256 | 5bca37d615381fd856b522b83560e961e32df32621f8117d093961d62f7cf544 |
Hashes for chmpy-1.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4ac557b87bc127675e24f398b21632741e76abd8a5ef62e84622570587f2c15 |
|
MD5 | 6ee265e73c059a3122f3d6888fc0aae3 |
|
BLAKE2b-256 | 92de224090e2b97986629caceca5db54f399beba849683e49b5dd093c74e2be5 |
Hashes for chmpy-1.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb4ad24bba8de060e2855addde504f4331eaf1eeae42d74c66515b3a0891d03f |
|
MD5 | a1cd0335f67c2a537cc06ec7d1e35e2a |
|
BLAKE2b-256 | 7f5ccdfc3aa1bff91a0b89a8a8039f545f44e88fb890216f673287ca7f7846cb |
Hashes for chmpy-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1229c94fb12ac5246eba842b4e6acf6ac25ecdf38d2b4e71c96ca7c6473626ee |
|
MD5 | 1f6a9364063cf78646442ce4eb77b430 |
|
BLAKE2b-256 | ea88f4c7ca6ff63bfe922095670e1306ae798093b75242284309eb4053ad69a3 |
Hashes for chmpy-1.1.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9313ab1adb275c25524d0f1a0d5e5c146f23b466f198425037bb269ad4d6311 |
|
MD5 | 7bf1592ffe30d9bdff6c8cad902f1263 |
|
BLAKE2b-256 | 50a9e2469ceaf6600c19534082160b6752feb19df33e417799a7719a2cb12df0 |
Hashes for chmpy-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70e4cb3a2bfafb4fbd2cf31beb9c55019a08af12e6889c573242f5e2d61cf56c |
|
MD5 | 31f85431acfcadb6449a89d94a8ce050 |
|
BLAKE2b-256 | 9fb54d8c39c896b8924f00f9e33f147acb8543052a7f78f7fc05d0dd5c4bafde |
Hashes for chmpy-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f5e41a69e296e76ad10200bbb3d39c9f99cfe971964a7200bb99840fcaafda7 |
|
MD5 | 8c40a625c1c027b4a88115e341ef348d |
|
BLAKE2b-256 | 3f922daa620ba4fbcfaea97c46bb78c9a817a433d0b862124ad6de6500f7f51e |
Hashes for chmpy-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50e8cafb00dd40e17ed6032362eb9b93ba21a5addfbe52d03aeca93041cbce6 |
|
MD5 | c3589b0cb36938132efe7e1b2bf7ad84 |
|
BLAKE2b-256 | 3adfefcafc22134eb63d207b9a7cb447a7ff2ea5252d438119d85103e721439e |
Hashes for chmpy-1.1.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99b5d97da7c98bed53277c740b095cfa06ee8a4d50400e77fe60b8a1da5d3f5d |
|
MD5 | 6ba64b9f72bf23fb0434d9760984823f |
|
BLAKE2b-256 | 5916ae5ff231bffeba405ab368a8b337ff9a82b7767c46d282181602a912df20 |