Skip to content

alexalemi/openkimtests

Repository files navigation

Openkimtests

Welcome to the Openkimtests project.

This aims to serve as a pipeline example and test development framework for my group. In particular, the goal is to develop some useful tests for the openkim project.

The general workflow here is to write the tests using the ASE (Atomic Simulation Environment) Package in python, and have some code glue to enable these short tests to be run with all different interatomic potentials and elements, and for the results to be collected in a human readable format.

Eventually, the tests should be able to work with any ASE calculator (including EMT, and various DFT codes) as well as LAMMPS and the KIM potentials.

Currently the results are stored as human readable XML files.

The pipeline script tries to pair each test with all of the available models and elements.

Directory Structure

openkimtest
  • bin - holds pipeline and other scripts
    • db.py - database stuff
    • filetools.py - list the good python files in a directory
    • kim.py - kim potential loader
    • lammps.py - lammps potential loader
    • logger.py - logging
    • pipeline.py - runs all of the scripts
    • potential.py - defines the potentials
  • docs - holds documentation automatically generated by doxygen once and a while
  • results - holds the result xml files from pipeline or -w runs
  • kim_tests - holds the tests
    • _BaseTest.py - the test all tests inherit
    • _MinimalTest.py - a minimal example
  • logs - holds the logs
    • openkimlog.log - the debug log
    • openkimg.warning.log - the warning log
    • test.log - the unittest log
  • unittests - some unittests

Tests

As for the tests:

So, the Tests will inherit from the _BaseTest, which should be able to do most of what is required of tests.

There are some example tests in the directory, including _MinimalTest which serves as a minimal example.

Basically, a test is a class inheriting from _BaseTest that needs to supply a result method, wherein when called, the results method returns a python dictionary of results to be stored.

Other test conventions:
  • Each test should store the atomic configuration it is working with as self.slab
  • Each test should use the dynamically created calculator at self.calculator
  • Each test has access to a require(PotentialName,Element,TestName,TestResultName) method that will fetch other test results, to allow tests to build on other tests.

Test Usage:

usage: python ExampleTestName.py [-h] [-v] [-w]
[potential] [element]
positional arguments:
potential The first argument is the potential element The second argument is the element
optional arguments:
-h, --help show this help message and exit

Pipeline:

in bin there is a pipeline.py script that will run the pipeline, you can either run it without arguments to have it run all of the necessary tests, or give it a test name to run that particular test

usage: pipeline.py [-h] [-f] [TestName]

Runs the openkimtests pipeline. If called with a TestName, will run for that particular test, otherwise will run for all. Use the -f flag to force recomputation of results.

positional arguments:
TestName The test you want to run if you're being specific
optional arguments:
-h, --help show this help message and exit
-f, --force force recomputation of results

TESTS

  • X - FCC lattice constants
  • X - BCC lattice constants
  • X - ForceTest
  • O - verify forces are gradients
  • O - Figure out equilibrium structure
  • X - Vacancy formation energy
  • O - Vacancy displacement field
  • O - hexagonal lattice constants
  • X - Elastic Moduli
  • O - maybe verify the lattice constants (see that force is zero)
  • O - unit change test.
  • O - change potential parameters, perhaps make a LennardJones potential

About

OpenKIM test creation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published