Cython Based Fast FES Calculation Toolkit.
Project description
CyFES
介绍
这是一个使用Cython+CUDA+Python编写的高性能FES计算软件。
安装
pip安装
本项目可以直接使用pip进行安装:
$ python3 -m pip install cyfes --user --upgrade -i https://pypi.org/simple
源码安装
首先将本仓库clone到本地:
$ git clone https://gitee.com/dechin/cy-fes.git && cd cy-fes/
然后直接运行setup.py
进行安装:
$ python3 -m pip install .
安装测试
在本仓库的test路径下存放了一个测试用例,用于测试cyfes是否安装成功。用户可以直接简单的运行:
$ python3 tests/test_path_fes.py
[0.00892185 0. 0.09578881 0.01997518]
[0.06397188 0. 0.09973657 0.04956698]
[0.04098002 0.10183226 0.03498954 0. ]
若输出为多个数组,则表示安装成功。也可以使用单元测试运行,但是这需要在本地先安装pytest
:
$ python3 -m pip install pytest
然后直接在仓库的根目录下运行:
$ py.test
=================================== test session starts ====================================
platform linux -- Python 3.7.5, pytest-7.4.4, pluggy-1.2.0
rootdir: /home/cy-fes
collected 3 items
tests/test_path_fes.py ... [100%]
==================================== 3 passed in 5.39s =====================================
没有报错,则表示安装成功。
使用方法
在安装成功后,可以直接在Python脚本中调用:
import numpy as np
from cyfes import PathFES
np.random.seed(0)
def test_path_fes():
atoms = 4
cvs = 10000
crd = np.random.random((atoms, 3))
cv = np.random.random((cvs, 3))
bw = np.random.random(3)
bias = np.random.random(cvs)-1
fes = np.asarray(PathFES(crd, cv, bw, bias))
print (fes)
if __name__ == '__main__':
test_path_fes()
还可以使用命令行模式:
$ python3 -m cyfes --help
usage: __main__.py [-h] [-i I] [-ic IC] [-ib IB] [-s S] [-e E] [-g G] [-o O]
[-f32 F32] [-sigma SIGMA]
optional arguments:
-h, --help show this help message and exit
-i I Set the input record file path.
-ic IC Set the cv index of input record file. Default: 0,1,2
-ib IB Set the bias index of input record file. Default: 3
-s S CV length. Default: None
-e E Edge length. Default: 1.0
-g G Grid numbers. Default: 10,10,10
-o O Set the output FES file path.
-f32 F32 Use float32. Default: false
-sigma SIGMA Sigma value when calculating FES. Default: 0.3
假如我们有一个三维的CV,那么最简单的运行方式为:
$ python3 -m cyfes -i /home/Data/xyz_bias.txt -o ./work_dir/z.cub
那么最后产生的文件内容为:
$ head -n 10 work_dir/z.cub
Generated by CyFES
Total 1000 grids
1 21.6622 19.8498 42.3652
10 6.40465 0 0
10 0 7.02147 0
10 0 0 6.33118
1 1.000000 53.6854 54.9571 74.0211
450 450 450 450 450 450
450 450 450 450 450 450
450 450 70.0855 70.848 450 450
该cube格式的文件可以在支持的软件(如VMD)中进行可视化操作。
已知问题
- 使用numpy==1.22.2的版本中会出现
ImportError: numpy.core.multiarray failed to import
问题。解决方案:升级numpy版本:python3 -m pip install numpy --upgrade
。 - 执行
python3 -m cyfes --help
报错ModuleNotFoundError: No module named 'cyfes.wrapper'
,这是因为执行命令的目录下存在名为cyfes
的文件夹,需要切换执行命令的位置。
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 Distribution
CyFES-2.5.tar.gz
(321.4 kB
view hashes)
Built Distributions
Close
Hashes for CyFES-2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f571ad2322f60f355acc134df99522f0d56d320821f7843bbefda75e9f96f3a7 |
|
MD5 | 5f12963aa54a364b2f7c410eff622ef9 |
|
BLAKE2b-256 | 53353ac099a656fb111612b2ac341b0443b400f215269f2ce6d63395a7a16255 |
Close
Hashes for CyFES-2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8dc08232abcf78db70611f2d4b19680689d9d7b2288170416a450d3aebb0fe |
|
MD5 | fc5e41e635961c370cf4be90c329af5b |
|
BLAKE2b-256 | 833c6de1d202e143b91308046d0e4f1fbff2019ded51323274457f7e29d556be |
Close
Hashes for CyFES-2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b60b6cec8bbeac5f6b642b718ebd0ca1503afab1080d6483e7994199d60c974a |
|
MD5 | 6e13548a25f5913d21ae7057baf48ed1 |
|
BLAKE2b-256 | fd62c37f8271d44ade18a5be21f6b152e87c75cf6ac62f89e7d81d8e0f1cfd90 |
Close
Hashes for CyFES-2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a0605b497c187553d3f5761f4ddfe82130abea155b49c3f810f8d1b06bdcdef |
|
MD5 | 3642a87eb4f06603ab6923ad756d98c9 |
|
BLAKE2b-256 | 3286d757ed2e770d6c33337dc8a2f001e3f2b479c32286839642e9c646622a81 |