Database interaction
A database can be generated from a remote or a local source.
You can create a database from the entries on echemdb.org:
from echemdb.cv.cv_database import CVDatabase
db = CVDatabase()
Show statistics of the databse
db.describe()
{'number of references': 39,
'number of entries': 195,
'materials': {'Ag', 'Au', 'Cu', 'Pt', 'Ru'}}
You can iterate over these entries
next(iter(db))
CVEntry('alves_2011_electrochemistry_6010_f1a_solid')
The database can be filtered for specific descriptors, wherby a new database is created.
db_filtered = db.filter(lambda entry: entry.system.electrodes.working_electrode.material == 'Pt')
db_filtered.describe()
/home/runner/work/echemdb/echemdb/echemdb/cv/cv_database.py:83: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
pd.unique(pd.Series([entry.get_electrode("WE").material for entry in self]))
{'number of references': 0, 'number of entries': 0, 'materials': set()}
Single entries can be selected by their identifier provided on the echemdb.org for each entry.
entry = db['engstfeld_2018_polycrystalline_17743_f4b_1']
entry
CVEntry('engstfeld_2018_polycrystalline_17743_f4b_1')