catkit.hub package¶
Subpackages¶
Submodules¶
catkit.hub.cathubsqlite module¶
-
class
catkit.hub.cathubsqlite.
CathubSQLite
(filename)[source]¶ Class for managing SQLite3 database for reaction energies, publications and atomic structures. Builds on top of the ASE database for atomic strucutres https://wiki.fysik.dtu.dk/ase/ase/db/db.html with four additional tables:
publication: publication info
- publication_system: one-to-many mapping between publication table and
- systems table in ASE database
reaction: reaction energies for surfaces
- reaction_system: mamy-to-many mapping between reaction table and
- systems table in ASE database
Connect to a database object:
db = CathubSQLite(‘yourdbfile.db’)Set up a connection for several manipulations:
- with db as CathubSQLite(‘yourdbfile.db’):
- Do your work…
Parameters: filename (str) – name of database file -
check
(chemical_composition, reaction_energy)[source]¶ Check if entry with same surface and energy is allready written to database file :param chemcial_composition: :type chemcial_composition: str :param reaction_energy: :type reaction_energy: str :param Returns id or None:
-
check_reaction_on_surface
(chemical_composition, reactants, products)[source]¶ Check if entry with same surface and reaction is allready written to database file
Parameters:
-
read
(id, table='reaction')[source]¶ Return an entire row of a table :param id: row integer :type id: int :param table: ‘reaction’, ‘publication’, ‘publication_system’, ‘reaction_system’ :type table: str
-
write
(values, data=None)[source]¶ Write reaction info to db file
Parameters: - values (dict) –
- values dict can include (The) –
- {'chemical_composition' (str (chemical composition on empty slab) ,) –
- 'surface_composition' (str (reduced chemical composition or) – shortname),
- 'facet' (str) –
- 'sites' (dict) – adsorption sites of species. f.ex: {‘OH’: ‘ontop’, ‘O’: ‘hollow’}
- 'coverages' (dict) – coverage of adsorbates relative to the unit cell f.ex. {‘OH’: 0.25, ‘O’: 0.5})
- 'products' ('reactants'/) – keys with name of chemical species folloved by phase (gas, *) values are the prefactor in the reaction. For reaction H2Ogas -> 2Hstar + O star you would write: ‘reactants’: {OHstar: 1, Hstar: 2} ‘products’: {OHstar: 1, Hstar: 2}
- 'reaction_energy' (float) –
- 'activation_energy' (float) –
- 'dft_code' (str) –
- 'dft_functional' (str) –
- 'username' (str) –
- 'pub_id' (str) – Should match the pub_id of the corresponding publications
- } –
catkit.hub.cli module¶
catkit.hub.db2server module¶
catkit.hub.folder2db module¶
catkit.hub.folderreader module¶
-
class
catkit.hub.folderreader.
FolderReader
(folder_name, debug=False, strict=True, verbose=False, update=True)[source]¶ Class for reading data from organized folders and writing to local CathubSQLite database. Folders should be arranged with make_folders_template and are read in the order:
level:
0 folder_name 1 |– publication 2 |– dft_code 3 |– dft_functional 4 |– gas 4 |– metal1 5 |– facet 6 |– reaction
Parameters:
catkit.hub.maintain_server module¶
catkit.hub.make_folders_template module¶
catkit.hub.organize module¶
catkit.hub.postgresql module¶
-
class
catkit.hub.postgresql.
CathubPostgreSQL
(user='catroot', password=None, stdin=<open file '<stdin>', mode 'r'>, stdout=<open file '<stdout>', mode 'w'>)[source]¶ Class for setting up the catalysis hub reaction energy database on postgreSQL server.
-
check
(pub_id, chemical_composition, reactants, products, reaction_energy=None, strict=True)[source]¶
-
catkit.hub.query module¶
-
catkit.hub.query.
get_reactions
(n_results=20, write_db=False, **kwargs)[source]¶ Get reactions from server
Give key value strings as arguments