Ejemplo n.º 1
0
def test(calculators=tuple(),
         jobs=0,
         verbose=False,
         stream='ignored',
         strict='ignored'):
    """Run the tests programmatically.

    This is here for compatibility and perhaps convenience."""
    from ase.cli.main import main

    if stream != 'ignored':
        warnings.warn('Ignoring old "stream" keyword', FutureWarning)
    if strict != 'ignored':
        warnings.warn('Ignoring old "strict" keyword', FutureWarning)

    args = ['test']
    if verbose:
        args += ['--verbose']
    if calculators:
        args += ['--calculators={}'.format(','.join(calculators))]
    if jobs:
        args += '--jobs={}'.format(jobs)

    main(args=args)
Ejemplo n.º 2
0
from ase.cli.main import main
main()
Ejemplo n.º 3
0
for name in ['bulk.db', 'ads.db', 'refs.db']:
    if os.path.isfile(name):
        os.remove(name)

# Run the tutorial:
for filename in ['bulk.py', 'ads.py', 'refs.py']:
    runpy.run_path(filename)

for cmd in [
        'ase db ads.db ads=clean --insert-into refs.db',
        'ase db ads.db ads=clean --delete --yes',
        'ase db ads.db pbc=FFF --insert-into refs.db',
        'ase db ads.db pbc=FFF --delete --yes'
]:
    main(args=cmd.split()[1:])

runpy.run_path('ea.py')

# Create the figures:
for n in [1, 2, 3]:
    a = read('ads.db@Cu{}O'.format(n))[0]
    a *= (2, 2, 1)
    renderer = write('cu{}o.pov'.format(n), a, rotation='-80x')
    renderer.render()

# A bit of testing:
row = connect('ads.db').get(surf='Pt', layers=3, ads='O')
assert abs(row.ea - -4.724) < 0.001
assert abs(row.height - 1.706) < 0.001