Welcome to echemdb’s documentation!
This echemdb module provides a Python library to interact with a database of frictionless datapackages containing electrochemical data following echemdb’s metadata schema. Such a database can be generated from the data on echemdb.org or from local files.
Examples
The currently available data shown on echemdb.org can be downloaded and stored in a database.
from echemdb.cv.cv_database import CVDatabase
db = CVDatabase()
db.describe()
{'number of references': 39,
'number of entries': 195,
'materials': {'Ag', 'Au', 'Cu', 'Pt', 'Ru'}}
Filtering the database for entries having specific properties, e.g., containing Pt as working electrode material, returns a new database.
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()}
A single entry can be retrieved with the identifiers provided on the website (see for example engstfeld_2018_polycrystalline_17743_f4b_1)
entry = db['engstfeld_2018_polycrystalline_17743_f4b_1']
Each entry has a set of descriptors such as its source
or the electrochemical system
.
entry.source # or entry['source']
{'citation key': 'engstfeld_2018_polycrystalline_17743', 'url': 'https://doi.org/10.1002/chem.201803418', 'techniques': ['XPS', 'STM'], 'figure': '1', 'curve': '1', 'bibdata': '@article{engstfeld_2018_polycrystalline_17743,\n author = "Engstfeld, Albert K and Maagaard, Thomas and Horch, Sebastian and Chorkendorff, Ib and Stephens, Ifan EL",\n title = "Polycrystalline and single-crystal Cu electrodes: influence of experimental conditions on the electrochemical properties in alkaline media",\n journal = "Chem.-Eur. J",\n volume = "24",\n number = "67",\n pages = "17743--17755",\n year = "2018",\n abstract = "Single and polycrystalline Cu electrodes serve as model systems for the study of the electroreduction of CO2, CO and nitrate, or for corrosion studies; even so, there are very few reports combining electrochemical measurements with structural characterization. Herein both the electrochemical properties of polycrystalline Cu and single crystal Cu(1 0 0) electrodes in alkaline solutions (0.1 m KOH and 0.1 m NaOH) are investigated. It is demonstrated that the pre-treatment of the electrodes plays a crucial role in determining their electrochemical properties. Scanning tunneling microscopy, X-ray photoelectron spectroscopy and cyclic voltammetry are performed on Cu(1 0 0) electrodes prepared under UHV conditions; it is shown that the electrochemical properties of these atomically well-defined electrodes are distinct from electrodes prepared by other methods. Also highlighted is the significant role of residual oxygen and electrolyte convection in influencing the electrochemical properties."\n}\n'}
The data related to an entry can be returned as a pandas dataframe (values are provided in SI units).
entry.df.head()
t | E | j | |
---|---|---|---|
0 | 0.000000 | -0.196962 | 0.043009 |
1 | 0.011368 | -0.196393 | 0.051408 |
2 | 0.030365 | -0.195443 | 0.058212 |
3 | 0.050365 | -0.194443 | 0.062875 |
4 | 0.055176 | -0.194203 | 0.063810 |
entry.field_unit('E')
'V'
The dataframe can be returned with custom or original figure axes’ units by rescaling the entry.
entry.rescale({'E' : 'mV', 'j' : 'uA / m2'}).df.head()
t | E | j | |
---|---|---|---|
0 | 0.000000 | -196.961730 | 43008.842162 |
1 | 0.011368 | -196.393321 | 51408.199892 |
2 | 0.030365 | -195.443463 | 58212.028842 |
3 | 0.050365 | -194.443463 | 62874.687137 |
4 | 0.055176 | -194.202944 | 63810.108398 |
original_entry = entry.rescale('original')
original_entry.df.head()
t | E | j | |
---|---|---|---|
0 | 0.000000 | -0.196962 | 4.300884 |
1 | 0.011368 | -0.196393 | 5.140820 |
2 | 0.030365 | -0.195443 | 5.821203 |
3 | 0.050365 | -0.194443 | 6.287469 |
4 | 0.055176 | -0.194203 | 6.381011 |
The data can be visualized in a plotly figure:
original_entry.plot()