atomate.utils package

Submodules

atomate.utils.database module

atomate.utils.fileio module

class atomate.utils.fileio.FileClient(filesystem=None, private_key='~/.ssh/id_rsa')

Bases: object

A client for performing many file operations while being agnostic of whether those operations are happening locally or via SSH

__init__(filesystem=None, private_key='~/.ssh/id_rsa')
Args:
filesystem (str): remote filesystem, e.g. username@remote_host.
If None, use local
private_key (str): path to the private key file (for remote
connections only). Note: passwordless ssh login must be setup
abspath(path)

return the absolute path

Args:
path (str): path to get absolute string of
copy(src, dest)

Copy from source to destination.

Args:
src (str): source full path dest (str): destination file full path
static exists(sftp, path)

os.path.exists() for paramiko’s SCP object

Args:
sftp (SFTPClient): path (str): path to check existence of
static get_ssh_connection(username, host, private_key)

Connect to the remote host via paramiko using the private key. If the host key is not present it will be added automatically.

Args:

username (str): host (str):

private_key (str): path to private key file

Returns:
SSHClient
glob(path)

return the glob

Args:
path (str): path to glob
listdir(ldir)

Get the directory listing from either the local or remote filesystem.

Args:
ldir (str): full path to the directory
Returns:
iterator of filenames

atomate.utils.testing module

class atomate.utils.testing.AtomateTest(methodName='runTest')

Bases: unittest.case.TestCase

get_task_collection(coll_name=None)

Returns pymongo collection

get_task_database()

Returns pymongo db connection.

setUp(lpad=True)

Create scratch directory(removes the old one if there is one) and change to it. Also initialize launchpad.

tearDown()

Remove the scratch directory and teardown the test db.

atomate.utils.utils module

Module contents