Skip to main content

AiiDA plugin for running the CRYSTAL17 code

Project description

aiida-crystal17

CI Coverage Status Docs status PyPI Conda DOI

AiiDA plugin for running the CRYSTAL17 code. The code is principally tested against CRYSTAL17, but the output parsing has also been tested against CRYSTAL14.

Documentation: https://readthedocs.org/projects/aiida-crystal17

Installation

To install from Conda (recommended)::

>> conda install -c conda-forge aiida-crystal17 aiida-core.services

To install from pypi::

>> pip install aiida-crystal17

To install the development version:

>> git clone https://github.com/aiidaplugins/aiida-crystal17 .
>> cd aiida-crystal17
>> pip install -e .  # also installs aiida, if missing (but not postgres)
>> #pip install -e .[pre-commit,testing] # install extras for more features
>> verdi quicksetup  # set up a new profile
>> verdi calculation plugins  # should now show the calclulation plugins (with prefix crystal17.)

Development

Testing against mock CRYSTAL17 executables

Because CRYSTAL17 is a licensed software, it is not possible to source a copy of the executable on Travis CI. Therefore, a mock executable (mock_runcry17) has been created for testing purposes (which also speeds up test runs).

This executable computes the md5 hash of the supplied input file and tries to match it against a dictionary of precomputed hashes. If found, the executable will write the matching output (from test/output_files) to stdout.

The following will discover and run all unit test:

>> pip install -e .[testing]
>> reentry scan -r aiida
>> pytest -v

To omit tests which call external executables (like crystal17):

>> pytest --cry17-skip-exec

To call the actual executables (e.g. crystal17 instead of mock_crystal17):

>> pytest --cry17-no-mock

To output the results of calcjob executions to a specific directory:

>> pytest --cry17-workdir "test_workdir"

Coding Style Requirements

The code style is tested using flake8, with the configuration set in .flake8, and code should be formatted with yapf (configuration set in .style.yapf).

Installing with aiida-crystal17[code_style] makes the pre-commit package available, which will ensure these tests are passed by reformatting the code and testing for lint errors before submitting a commit. It can be setup by:

>> cd aiida-crystal17
>> pre-commit install

Optionally you can run yapf and flake8 separately:

>> yapf -r -i .  # recrusively find and format files in-place
>> flake8

Editors like VS Code also have automatic code reformat utilities, which can adhere to this standard.

Setting up CRYSTAL17 locally

To set up local version of CRYSTAL17 on a mac (after downloading a copy from the distributor), I had to:

  1. Remove the quarantine from the executable permissions:

    xattr -c crystal
    xattr -c properties
    
  2. Create versions of the lapack/blas libraries in the expected folders:

    sudo port install lapack
    sudo cp /opt/local/lib/lapack/liblapack.3.dylib /usr/local/opt/lapack/lib/liblapack.3.dylib
    sudo cp /opt/local/lib/lapack/libblas.3.dylib /usr/local/opt/lapack/lib/libblas.3.dylib
    
  3. Define environmental variables in ~/.bashrc, as detailed in cry17_scripts/cry17.bashrc

  4. Copy or symlink the cry17_scripts/runcry17 script into /usr/local/bin/

License

See LICENSE file

Contact

chrisj_sewell@hotmail.com

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

aiida-crystal17-0.11.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

aiida_crystal17-0.11.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file aiida-crystal17-0.11.0.tar.gz.

File metadata

  • Download URL: aiida-crystal17-0.11.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for aiida-crystal17-0.11.0.tar.gz
Algorithm Hash digest
SHA256 8a21dcf6137092ebb3e1e35c3385debbb7f8e5d29986dd2754944bf84af1ee81
MD5 8b5f273e44e000f154e22d52840bd0f9
BLAKE2b-256 0051111a37f747b0ee580f8a51530d2eee0ca62781dcb0b506ecd9d3a0efd32e

See more details on using hashes here.

File details

Details for the file aiida_crystal17-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: aiida_crystal17-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for aiida_crystal17-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac5747a206ad332060bdd391ee5ba35e090d3ec2a49fc2314207b62b494635d
MD5 5967e825fcb28d6a0239e153feece39e
BLAKE2b-256 c041c2e82efd35a75055300ae390628b6268fe285f2e4855b9c548662af93acf

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