跳转到主要内容

运行oximachine

项目描述

oximachinerunner

Actions Status Binder Documentation Status codecov PyPI - Python Version

安装

在macOS上,您需要先运行 brew install libomp 以启用 XGBoost 库的多线程。

理想情况下,您应在干净的环境中安装所有内容,例如使用conda。

conda create -n test_oximachine_runner python=3.7 -y

然后使用 conda activate test_oximachine_runner 激活。

最新稳定版本

pip install oximachinerunner

请注意,由于集成使用k最近邻模型,安装需要相当大的(>500 MB)存储空间。

开发版本

pip install git+https://github.com/kjappelbaum/oximachinerunner.git

用法

加载模型

from oximachinerunner import OximachineRunner
runner = OximachineRunner()

可以从 runner.available_models 中初始化 OximachineRunnermodelname

默认情况下,如果模型尚未在正确文件夹中,则将在首次使用时自动下载模型。

/Users/kevinmaikjablonka/opt/miniconda3/envs/test_oximachine_runner/lib/python3.7/site-packages/oximachinerunner/assets/all_202000830/classifier.joblib are not exist or md5 is wrong.
Download file from https://www.dropbox.com/s/lc2z4abaycjbbe1/classifier.joblib?dl=1
2.9% of 527.44M

要禁用此行为,请设置 OximachineRunner(automatic_download=False) 并手动下载您的模型,例如使用 utils 模块中的函数。

预测氧化态

run_oximachine 函数接受 pymatgen.Structurease.Atomsstr 以及 os.PathLike。后两者是文件的路径,然后使用 pymatgen 解析。

runner.run_oximachine('oximachinerunner/assets/ACODAA.cif')

该函数将打印将要运行模型的位置数量。

featurize.py: iterating over 6 metal sites

它返回一个具有以下字段的 OrderedDict

  • metal_indices:金属位置的索引列表
  • metal_symbols:金属原子的符号列表
  • prediction:氧化态预测列表
  • max_probabs:对于每个金属位置,所有4个模型的最大置信度。
  • base_predictions:对于每个金属位置,每个4个模型的氧化态预测列表。

开发设置

git clone https://github.com/kjappelbaum/oximachinerunner
pip install -e .[dev]

参考

贾布隆卡,凯文·迈克;翁加里,达尼埃莱;莫萨维,赛义德·穆罕默德;斯密特,贝伦德(2020年):利用集体知识来分配氧化态。ChemRxiv。预印本。 https://doi.org/10.26434/chemrxiv.11604129.v1

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

oximachinerunner-1.4.0.tar.gz (30.8 kB 查看散列值)

上传时间

构建分发

oximachinerunner-1.4.0-py3-none-any.whl (16.5 kB 查看散列值)

上传时间 Python 3

由以下支持