Skip to main content

Run the oximachine

Project description

oximachinerunner

Actions Status Binder Documentation Status codecov PyPI - Python Version

Installation

On macOS you need to run brew install libomp first to enable multithreading for the XGBoost library.

Ideally, you install everything in a clean environment, e.g., using conda

conda create -n test_oximachine_runner python=3.7 -y

Then activate with conda activate test_oximachine_runner.

Latest stable release

pip install oximachinerunner

Note that the installation requires significant (>500 MB) storage space since the ensembles use k-nearest neighbors models.

Development version

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

Usage

Loading the model

from oximachinerunner import OximachineRunner
runner = OximachineRunner()

The OximachineRunner can be initialized with a modelname from runner.available_models.

By default, models will be automatically downloaded (upon first use) if there are not yet in the correct folder:

/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

To disable this behavior of, set OximachineRunner(automatic_download=False) and manually download your model, e.g. using a function from the utils module.

Predicting oxidation states

The run_oximachine function accepts pymatgen.Structure, ase.Atoms and str as well as os.PathLike. The latter two are expected to be paths to a file that is then parsed with pymatgen.

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

The function prints for how many sites it will run the model.

featurize.py: iterating over 6 metal sites

It returns an OrderedDict with the fields:

  • metal_indices: A list of indices of the metal sites
  • metal_symbols: A list of symbols of the metal atoms
  • prediction: A list of oxidation state predictions
  • max_probabs: For each metal site the maximum confidence of all 4 models.
  • base_predictions: For each metal site a list of the oxidation state predictions for each of the 4 models.

Development setup

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

Reference

Jablonka, Kevin Maik; Ongari, Daniele; Moosavi, Seyed Mohamad; Smit, Berend (2020): Using Collective Knowledge to Assign Oxidation States. ChemRxiv. Preprint. https://doi.org/10.26434/chemrxiv.11604129.v1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oximachinerunner-1.4.0.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

oximachinerunner-1.4.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file oximachinerunner-1.4.0.tar.gz.

File metadata

  • Download URL: oximachinerunner-1.4.0.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.0

File hashes

Hashes for oximachinerunner-1.4.0.tar.gz
Algorithm Hash digest
SHA256 854d5e0f2adcd87ae75448a05598cfd6392eb3719e72e0d7451e9ddaf6dd799b
MD5 ff9dd12c2307d9462a29334633b0ab12
BLAKE2b-256 e2ec66600da6db37da6a85f0701bc50665994206cf6815c5f0987c0639069cd3

See more details on using hashes here.

File details

Details for the file oximachinerunner-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: oximachinerunner-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.0

File hashes

Hashes for oximachinerunner-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 977054c1bef5e871c198d8a11ed9afb4a2aa33f254b8e2fecbbc69523a286961
MD5 2c6765b93e9e922ce103ab88b1f517a6
BLAKE2b-256 00a3546d194dffc8305c876699e5c39d66ebf44bc0448cab939b893bbe841d76

See more details on using hashes here.

Supported by

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