Entry interactions

Each entry consists of

  1. descriptors describing the data in the datapackage.

  2. a bibliography reference (see Bibliography).

  3. functions for descriptor representation, data manipulation and data visualization.

Basic interactions

The underlying information can be retrieved by entry['name'], where name is the respective descriptor. Alternatively you can write entry.name where all spaces should be replaced by underscores.

from echemdb.cv.cv_database import CVDatabase
db = CVDatabase()
entry = db['engstfeld_2018_polycrystalline_17743_f4b_1']
entry
CVEntry('engstfeld_2018_polycrystalline_17743_f4b_1')
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'}
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'}
entry.source.citation_key
'engstfeld_2018_polycrystalline_17743'

Specific information can be retrieved by selecting the desired descriptor

entry.system.electrodes[0].material
'Au'

entry.package provides a full list of available descriptors including the echemdb resource (see below).

Data

The datapackage consists of two resources.

  • The first resource has the entry’s identifier as name. It describes the data in the CSV.

  • The second resource is named “echemdb”. It contains the data used by the echemdb module.

Note

The content of the CSV never changes unless it is explicitly overwritten. Changes to the data with the echemdb module are only applied to the echemdb resource.

entry.package.resource_names
['engstfeld_2018_polycrystalline_17743_f4b_1', 'echemdb']

The data can be returned as a pandas dataframe.

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

The units (and possible reference potentials) of the data are included in the resource schema.

entry.package.get_resource('echemdb').schema
{'fields': [{'name': 't', 'type': 'number', 'unit': 's'},
            {'name': 'E', 'type': 'number', 'unit': 'V', 'reference': 'RHE'},
            {'name': 'j', 'type': 'number', 'unit': 'A / m2'}]}

The units of the dataframe can be rescaled.

rescaled_entry = entry.rescale({'t' : 'h', 'E': 'mV', 'j' : 'uA / cm2'})
rescaled_entry.df.head()
t E j
0 0.000000 -196.961730 4.300884
1 0.000003 -196.393321 5.140820
2 0.000008 -195.443463 5.821203
3 0.000014 -194.443463 6.287469
4 0.000015 -194.202944 6.381011

The units of a field are directly accessible via

rescaled_entry.field_unit('E')
'mV'

The dataframe can be restored to the original figure axes’ units of the published figure.

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 units (and possible reference potentials) of the data are included in the resource schema.

entry.figure_description.fields
[{'name': 'E', 'type': 'number', 'unit': 'V', 'orientation': 'x', 'reference': 'RHE'},
 {'name': 'j', 'type': 'number', 'unit': 'uA / cm2', 'orientation': 'y'}]

Plots

The data can be visualized in a plotly figure. The default plot is j vs. E (or I vs. E). The curve label consits of the figure number in the original publication followed by a unique identifier.

entry.plot()

A plot with rescaled axis is obtained by rescaling the entry first.

entry.rescale({'E':'mV', 'j':'uA / cm2'}).plot()

The dimensions of the axis can be specified explicitly.

entry.plot(x_label='t', y_label='j')

Units and values

Entries containing both a unit and a value are returned as astropy units or quantities.

entry.figure_description.scan_rate
50.0 mV / s

The unit and value can be accessed separately

entry.figure_description.scan_rate.value
50.0
entry.figure_description.scan_rate.unit
'mV / s'

Todo

add link to YAML Files and other resources related to data standardization.