GithubHelp home page GithubHelp logo

glotzerlab / fedorov Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 240 KB

A python package to initialize different crystal structures

License: BSD 3-Clause "New" or "Revised" License

Python 64.19% Jupyter Notebook 35.81%

fedorov's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fedorov's Issues

Aflow Database triclinic and monoclinic params

It seems that for all the triclinic and monoclinic structures in the aflow database, the angular lattice params are all improperly stored in basis params.

Verified with the following code snippet.

for i,name in crystal_database.AflowPrototype.Aflow_database['id'].iteritems():
    cdbs=crystal_database.AflowPrototype(i,print_info=False)
    keys=set(cdbs.lattice_params.keys())
    if name.startswith('a'): #triclinic
        try:
            assert(keys==set(('a','b','c','alpha','beta','gamma')))
            print('it worked for '+name)
        except:
            keys.update(filter(lambda k:not k[0] in ['x','y','z'],cdbs.basis_params.keys()))
            assert(keys==set(('a','b','c','alpha','beta','gamma')))
    elif name.startswith('m'): #monoclinic
        try:
            assert(keys==set(('a','b','c','beta')))
            print('it worked for '+name)
        except:
            keys.update(filter(lambda k:not k[0] in ['x','y','z'],cdbs.basis_params.keys()))
            assert(keys==set(('a','b','c','beta')))
    elif name.startswith('o'): #orthorhombic
        assert(keys==set(('a','b','c')))
    elif name.startswith('t'): #tetragonal
        assert(keys==set(('a','c')))
    elif name.startswith('hR'): #rhombohedral
        assert(keys==set(('a','alpha')))
    elif name.startswith('h'): #hexagonal
        assert(keys==set(('a','c')))
    elif name.startswith('c'): #cubic
        assert(keys==set(('a')))
    else:
        raise(name+'not start with a Pearson symbol')

All the excepts are necessary and it outputs nothing meaning that no 'a' or 'm' Pearson symbols from the database works.

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.