Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion echemdb/data/cv/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __dir__(self):

>>> entry = Entry.create_examples()[0]
>>> dir(entry)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_descriptor', 'create_examples', 'curator', 'df', 'electrochemical_system', 'figure_description', 'identifier', 'package', 'plot', 'profile', 'resources', 'source']
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_descriptor', 'create_examples', 'curator', 'df', 'electrochemical_system', 'figure_description', 'identifier', 'package', 'plot', 'profile', 'resources', 'source', 'yaml']

"""
return list(set(dir(Descriptor(self.package.descriptor)) + object.__dir__(self)))
Expand Down Expand Up @@ -297,3 +297,17 @@ def __repr__(self):

"""
return repr(self._descriptor)

@property
def yaml(self):
r'''Return a printable representation of this descriptor in yaml format.

EXAMPLES::

>>> descriptor = Descriptor({'a': 0})
>>> descriptor.yaml
'a: 0\n'

'''
import yaml
return yaml.dump(self._descriptor)
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- plotly
- pip
- pytest
- pyyaml
- pip:
- linkchecker
- mkdocs-material
Expand Down
19 changes: 8 additions & 11 deletions templates/cv_entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ Properties of the electrochemical cell:
* Reference electrode: XXX

<!-- TODO: Insert all the metadata from the .yaml file in some collapsible form here. E.g., just the YAML file with syntax highlighting. See #31. -->
## Metdata
<details>
<summary>Click to expand metadata (yaml).</summary>

```yaml
{{ entry.electrochemical_system.yaml }}
```
</details>

----

<!-- TODO: Insert links to other data which are plotted in the same figure and/or even add a plot with all data from that figure. See #31 -->

<!-- TODO: These sections should be removed. See #31. -->
## electrolyte
0.1 M CsF + 0.1 M HClO4

## reference electrode

{{ entry.electrochemical_system.electrodes.reference_electrode.type }}

## scan rate
{{ entry.figure_description.scan_rate.value }} {{ entry.figure_description.scan_rate.unit | lower }}