Code Monkey home page Code Monkey logo

openkimtests's Introduction

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

openkimtests's People

Contributors

alexalemi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

yanjiun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.