diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05adf4f5d..1f26f2f78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,6 @@ jobs: run: | mamba env update --quiet -n test -f environment.yml conda list - - name: fix permissions - shell: bash -l {0} - run: | - # Strangely, the linkchecker modules are installed writable and linkchecker then refuses to load them. - chmod -R a-w `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` - name: digitize shell: bash -l {0} run: | @@ -42,6 +37,11 @@ jobs: mv data generated/website/ # Disable further processing by GitHub touch generated/website/.nojekyll + - name: fix permissions + shell: bash -l {0} + run: | + # Strangely, the linkchecker modules are installed writable and linkchecker then refuses to load them. + chmod -R a-w `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` - name: detect broken links shell: bash -l {0} run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fc53e327..154db1373 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,4 +31,4 @@ jobs: - name: doctest shell: bash -l {0} run: | - pytest --doctest-modules echemdb + pytest -n auto --doctest-plus --remote-data --doctest-modules echemdb diff --git a/echemdb/data/cv/database.py b/echemdb/data/cv/database.py index 409d9c834..85bf6d1ee 100644 --- a/echemdb/data/cv/database.py +++ b/echemdb/data/cv/database.py @@ -10,11 +10,11 @@ Create a database from the data packages published in the echemdb:: - >>> database = Database() + >>> database = Database() # doctest: +REMOTE_DATA Search the database for a single publication:: - >>> database.filter(lambda entry: entry.source.doi == 'https://doi.org/10.1039/C0CP01001D') + >>> database.filter(lambda entry: entry.source.doi == 'https://doi.org/10.1039/C0CP01001D') # doctest: +REMOTE_DATA [Entry('alves_2011_electrochemistry_6010_p2_2a_solid')] """ diff --git a/echemdb/data/cv/descriptor.py b/echemdb/data/cv/descriptor.py new file mode 100644 index 000000000..dcde03ea5 --- /dev/null +++ b/echemdb/data/cv/descriptor.py @@ -0,0 +1,249 @@ +r""" +Wrappers for a Data Package's metadata stored in the descriptor property. + +These wrappers are automatically applied to all metadata of each :class:`Entry` +in our :class:`Database`. + +Metadata in data packages is stored as a JSON object. In Python, such a nested +JSON object gets turned into a hierarchy of dictionaries and lists. Such raw +data structures can be a bit tedious to work with, so the descriptors in this +module provide some convenience wrappers for it, e.g., better tab-completion +when working in an interactive session. + +EXAMPLES: + +To add convenience methods to a data package's descriptor, run it through the +:func:`Descriptor` factory function:: + + >>> descriptor = {'some': {'nested': 'metadata'}} + >>> descriptor = Descriptor(descriptor) + +Such a descriptor has some added convenience methods that make it more +convenient to work with. + +For example, it can be easily dumped to YAML:: + + >>> print(descriptor.yaml) + some: + nested: metadata + +It can be explored with attributes that are more tab-completion friendly:: + + >>> descriptor.some.nested + 'metadata' + +Extra methods are added if the descriptor satisfies a certain interface:: + + >>> descriptor = {'some': {'nested': {'value': 13.37, 'unit': 'parsec'}}} + >>> descriptor = Descriptor(descriptor) + >>> descriptor.some.nested.quantity.to('km') + + +""" +# ******************************************************************** +# This file is part of echemdb. +# +# Copyright (C) 2021 Albert Engstfeld +# Copyright (C) 2021 Johannes Hermann +# Copyright (C) 2021 Julian Rüth +# Copyright (C) 2021 Nicolas Hörmann +# +# echemdb is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# echemdb is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with echemdb. If not, see . +# ******************************************************************** + + +class GenericDescriptor: + r""" + Wrapper for a data package's descriptor to make searching in metadata easier. + + EXAMPLES:: + + >>> GenericDescriptor({'a': 0}) + {'a': 0} + + """ + + def __init__(self, descriptor): + self._descriptor = descriptor + + def __dir__(self): + r""" + Return the attributes of this descriptor. + + Implemented to allow tab-completion in a package's descriptor. + + EXAMPLES:: + + >>> descriptor = GenericDescriptor({'a': 0}) + >>> 'a' in dir(descriptor) + True + + """ + return list(key.replace(' ', '_') for key in self._descriptor.keys()) + object.__dir__(self) + + def __getattr__(self, name): + r""" + Return the attribute `name` of the descriptor. + + EXAMPLES:: + + >>> descriptor = GenericDescriptor({'a': 0}) + >>> descriptor.a + 0 + + """ + name = name.replace('_', ' ') + if name in self._descriptor: + return Descriptor(self._descriptor[name]) + + raise AttributeError(f"Descriptor has no entry {name}. Did you mean one of {[key.replace(' ', '_') for key in self._descriptor.keys()]}?") + + def __getitem__(self, name): + r""" + Return the attribute `name` of the descriptor. + + EXAMPLES:: + + >>> descriptor = GenericDescriptor({'a': 0}) + >>> descriptor["a"] + 0 + + """ + if name in self._descriptor: + return Descriptor(self._descriptor[name]) + + raise KeyError(f"Descriptor has no entry {name}. Did you mean one of {list(self._descriptor.keys())}?") + + def __repr__(self): + r""" + Return a printable representation of this descriptor. + + EXAMPLES:: + + >>> GenericDescriptor({}) + {} + + """ + return repr(self._descriptor) + + @property + def yaml(self): + r'''Return a printable representation of this descriptor in yaml format. + + EXAMPLES:: + + >>> descriptor = GenericDescriptor({'a': 0}) + >>> descriptor.yaml + 'a: 0\n' + + ''' + import yaml + return yaml.dump(self._descriptor) + + +class QuantityDescriptor(GenericDescriptor): + r""" + Extends a descriptor with convenience methods when it is encoding a + quantity, i.e., unit and value. + + EXAMPLES:: + + >>> from echemdb.data.cv.entry import Entry + >>> entry = Entry.create_examples()[0] + >>> temperature = entry.electrochemical_system.electrolyte.temperature + >>> temperature + 298.15 K + + """ + markdown_template = "components/quantity.md" + + @property + def quantity(self): + r""" + This quantity as an astropy quantity. + + EXAMPLES:: + + >>> from echemdb.data.cv.entry import Entry + >>> entry = Entry.create_examples()[0] + >>> temperature = entry.electrochemical_system.electrolyte.temperature + >>> temperature.quantity + + + """ + from astropy import units + + return float(self.value) * units.Unit(self.unit) + + def __repr__(self): + r""" + Return a printable representation of this quantity. + + EXAMPLES:: + + >>> from echemdb.data.cv.entry import Entry + >>> entry = Entry.create_examples()[0] + >>> temperature = entry.electrochemical_system.electrolyte.temperature + >>> temperature + 298.15 K + + """ + return str(self.quantity) + + +def Descriptor(descriptor): + r""" + Return `descriptor` augmented with additional convenience methods. + + EXAMPLES: + + Primitive types are returned unchanged:: + + >>> Descriptor("string") + 'string' + + Dictionaries are augmented with attribute access:: + + >>> descriptor = Descriptor({"an attribute": 13.37}) + >>> descriptor.an_attribute + 13.37 + + Lists are recursively augmented:: + + >>> descriptor = Descriptor([{"an attribute": 13.37}, {}]) + >>> descriptor[0].an_attribute + 13.37 + + Dictionaries encoding a unit and value are augmented with astropy + convenience methods:: + + >>> descriptor = Descriptor({"value": 1, "unit": "liter"}) + >>> descriptor.quantity.to("m^3") + + + """ + + if isinstance(descriptor, GenericDescriptor): + return descriptor + + if isinstance(descriptor, dict): + if set(descriptor.keys()) == {"unit", "value"}: + return QuantityDescriptor(descriptor) + + return GenericDescriptor(descriptor) + + if isinstance(descriptor, list): + return [Descriptor(item) for item in descriptor] + + return descriptor diff --git a/echemdb/data/cv/entry.py b/echemdb/data/cv/entry.py index fa53bb136..721697eba 100644 --- a/echemdb/data/cv/entry.py +++ b/echemdb/data/cv/entry.py @@ -25,6 +25,9 @@ # along with echemdb. If not, see . # ******************************************************************** + +from echemdb.data.cv.descriptor import Descriptor + class Entry: r""" A [data packages](https://github.com/frictionlessdata/datapackage-py) @@ -72,7 +75,7 @@ def __dir__(self): ['__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', 'bibliography', '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))) + return list(set(dir(self._descriptor) + object.__dir__(self))) def __getattr__(self, name): r""" @@ -84,8 +87,13 @@ def __getattr__(self, name): >>> entry.source {'version': 1, 'doi': 'https://doi.org/10.1039/C0CP01001D', 'bib': 'alves_2011_electrochemistry_6010', 'figure': '2a', 'curve': 'solid'} + The returned descriptor can again be accessed in the same way:: + + >>> entry.electrochemical_system.electrolyte.components[0].name + 'H2O' + """ - return getattr(Descriptor(self.package.descriptor), name) + return getattr(self._descriptor, name) def __getitem__(self, name): r""" @@ -98,7 +106,11 @@ def __getitem__(self, name): {'version': 1, 'doi': 'https://doi.org/10.1039/C0CP01001D', 'bib': 'alves_2011_electrochemistry_6010', 'figure': '2a', 'curve': 'solid'} """ - return Descriptor(self.package.descriptor)[name] + return self._descriptor[name] + + @property + def _descriptor(self): + return Descriptor(self.package.descriptor) def df(self, yunit=None): r""" @@ -206,14 +218,25 @@ def create_examples(cls, name="alves_2011_electrochemistry_6010"): 'svgdigitizer', name) - if not os.path.exists(outdir): - from glob import glob - for yaml in glob(os.path.join(source, "*.yaml")): - svg = os.path.splitext(yaml)[0] + ".svg" + # We now might have to digitize some files on demand. When running + # tests in parallel, this introduces a race condition that we avoid + # with a global lock in the file system. + lockfile = f"{outdir}.lock" + os.makedirs(os.path.dirname(lockfile), exist_ok=True) + + from filelock import FileLock + with FileLock(lockfile): + if not os.path.exists(outdir): + from glob import glob + for yaml in glob(os.path.join(source, "*.yaml")): + svg = os.path.splitext(yaml)[0] + ".svg" - from svgdigitizer.test.cli import invoke - from svgdigitizer.__main__ import digitize_cv - invoke(digitize_cv, "--sampling_interval", ".005", "--package", "--metadata", yaml, svg, "--outdir", outdir) + from svgdigitizer.test.cli import invoke + from svgdigitizer.__main__ import digitize_cv + invoke(digitize_cv, "--sampling_interval", ".005", "--package", "--metadata", yaml, svg, "--outdir", outdir) + + assert os.path.exists(outdir), f"Ran digitizer to generate {outdir}. But directory is still missing after invoking digitizer." + assert any(os.scandir(outdir)), f"Ran digitizer to generate {outdir}. But the directory generated is empty after invoking digitizer." from echemdb.data.local import collect_datapackages, collect_bibliography packages = collect_datapackages(outdir) @@ -222,96 +245,7 @@ def create_examples(cls, name="alves_2011_electrochemistry_6010"): bibliography = next(iter(bibliography)) if len(packages) == 0: - raise ValueError(f"No literature data found for {name}. There is probably some outdated data in {outdir}.") + from glob import glob + raise ValueError(f"No literature data found for {name}. The directory for this data {outdir} exists. But we could not find any datapackages in there. There is probably some outdated data in {outdir}. The contents of that directory are: { glob(os.path.join(outdir,'**')) }") return [Entry(package=package, bibliography=bibliography) for package in packages] - - -class Descriptor: - r""" - Wrapper for a data package's descriptor to make searching in metadata easier. - - EXAMPLES:: - - >>> Descriptor({'a': 0}) - {'a': 0} - - """ - def __init__(self, descriptor): - self._descriptor = descriptor - - def __dir__(self): - r""" - Return the attributes of this descriptor. - - Implemented to allow tab-completion in a package's descriptor. - - EXAMPLES:: - - >>> descriptor = Descriptor({'a': 0}) - >>> 'a' in dir(descriptor) - True - - """ - return list(key.replace(' ', '_') for key in self._descriptor.keys()) + object.__dir__(self) - - def __getattr__(self, name): - r""" - Return the attribute `name` of the descriptor. - - EXAMPLES:: - - >>> descriptor = Descriptor({'a': 0}) - >>> descriptor.a - 0 - - """ - name = name.replace('_', ' ') - if name in self._descriptor: - value = self._descriptor[name] - return Descriptor(value) if isinstance(value, dict) else value - - raise AttributeError(f"Descriptor has no entry {name}. Did you mean one of {list(self._descriptor.keys())}?") - - def __getitem__(self, name): - r""" - Return the attribute `name` of the descriptor. - - EXAMPLES:: - - >>> descriptor = Descriptor({'a': 0}) - >>> descriptor["a"] - 0 - - """ - if name in self._descriptor: - value = self._descriptor[name] - return Descriptor(value) if isinstance(value, dict) else value - - raise KeyError(f"Descriptor has no entry {name}. Did you mean one of {list(self._descriptor.keys())}?") - - def __repr__(self): - r""" - Return a printable representation of this descriptor. - - EXAMPLES:: - - >>> Descriptor({}) - {} - - """ - 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) diff --git a/echemdb/data/legacy/build_data.py b/echemdb/data/legacy/build_data.py index 1462b17f7..483e13d2f 100644 --- a/echemdb/data/legacy/build_data.py +++ b/echemdb/data/legacy/build_data.py @@ -34,11 +34,11 @@ import plotly.express as px import plotly.graph_objects as go import plotly.io -TEMPLATE_FOLDERS = {'elements': "./templates/element.md", - 'echemdb_id': "./templates/echemdb_id.md", - 'systems': "./templates/systems.md", - 'surfaces': "./templates/surface.md", - 'element_surface': "./templates/element_surface.md" +TEMPLATE_FOLDERS = {'elements': "./templates/pages/legacy/element.md", + 'echemdb_id': "./templates/pages/legacy/echemdb_id.md", + 'systems': "./templates/pages/legacy/systems.md", + 'surfaces': "./templates/pages/legacy/surface.md", + 'element_surface': "./templates/pages/legacy/element_surface.md" } TARGET_FOLDERS = {'path': "./pages/", diff --git a/echemdb/data/remote.py b/echemdb/data/remote.py index 35eb59116..a9b6b0567 100644 --- a/echemdb/data/remote.py +++ b/echemdb/data/remote.py @@ -44,7 +44,7 @@ def collect_datapackages(data=".", url="https://github.com/echemdb/website/archi EXAMPLES:: - >>> packages = collect_datapackages() + >>> packages = collect_datapackages() # doctest: +REMOTE_DATA """ if outdir is None: @@ -73,7 +73,7 @@ def collect_bibliography(data=".", url="https://github.com/echemdb/website/archi EXAMPLES:: - >>> packages = collect_bibliography() + >>> packages = collect_bibliography() # doctest: +REMOTE_DATA """ if outdir is None: @@ -90,4 +90,4 @@ def collect_bibliography(data=".", url="https://github.com/echemdb/website/archi import os.path import echemdb.data.local - return echemdb.data.local.collect_bibliography(os.path.join(outdir, data)) \ No newline at end of file + return echemdb.data.local.collect_bibliography(os.path.join(outdir, data)) diff --git a/echemdb/website/filters/__init__.py b/echemdb/website/filters/__init__.py new file mode 100644 index 000000000..0a5e02484 --- /dev/null +++ b/echemdb/website/filters/__init__.py @@ -0,0 +1,30 @@ +r""" +Provides custom Jinja filters for rendering the echemdb websites. +""" +# ******************************************************************** +# This file is part of echemdb. +# +# Copyright (C) 2021 Albert Engstfeld +# Copyright (C) 2021 Johannes Hermann +# Copyright (C) 2021 Julian Rüth +# Copyright (C) 2021 Nicolas Hörmann +# +# echemdb is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# echemdb is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with echemdb. If not, see . +# ******************************************************************** + +from echemdb.website.filters.render import render + + +def enable_filters(env): + env.filters["render"] = render diff --git a/echemdb/website/filters/render.py b/echemdb/website/filters/render.py new file mode 100644 index 000000000..cd7b679c1 --- /dev/null +++ b/echemdb/website/filters/render.py @@ -0,0 +1,91 @@ +r""" +Implements a `render` filter that renders an object as MarkDown. + +EXAMPLES: + +The `render` filter renders an element using a specific template:: + + >>> from echemdb.website.macros.render import render + >>> from io import StringIO + >>> from astropy.units import Unit + + >>> snippet = StringIO("{{ value | render(template='components/quantity.md') }}") + >>> render(snippet, value={ 'quantity': 1 * Unit("mol / l") }) + '1.0 M' + +When no template is given, the filter returns the `markdown` property if +present:: + + >>> snippet = StringIO("{{ value | render }}") + + >>> class Value: + ... @property + ... def markdown(self): return "MarkDown" + + >>> render(snippet, value=Value()) + 'MarkDown' + +When no template is given, the filter renders the value with the +`markdown_template` if present:: + + >>> snippet = StringIO("{{ value | render }}") + + >>> class Value(dict): + ... markdown_template = 'components/quantity.md' + + >>> render(snippet, value=Value({ 'quantity': 1 * Unit("mol / l") })) + '1.0 M' + +""" +# ******************************************************************** +# This file is part of echemdb. +# +# Copyright (C) 2021 Albert Engstfeld +# Copyright (C) 2021 Johannes Hermann +# Copyright (C) 2021 Julian Rüth +# Copyright (C) 2021 Nicolas Hörmann +# +# echemdb is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# echemdb is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with echemdb. If not, see . +# ******************************************************************** + + +def render(value, template=None): + r""" + Return `value` as a MarkDown string. + + Note that this filter might not interact correctly with autoescaping. If + there are problems, we should revisit the autoescaping advice at + https://jinja.palletsprojects.com/en/3.0.x/api/#custom-filters. + + EXAMPLES:: + + >>> from echemdb.website.macros.render import render + >>> from io import StringIO + >>> from astropy.units import Unit + + >>> snippet = StringIO("{{ value | render(template='components/quantity.md') }}") + >>> render(snippet, value={ 'quantity': 1 * Unit("A / m^2") }) + '1.0 $\\mathrm{A\\,m^{-2}}$' + + """ + if template is None: + if hasattr(value, "markdown"): + return value.markdown + elif hasattr(value, "markdown_template"): + template = value.markdown_template + else: + raise ValueError("No template specified but value does neither provide a markdown property nor a markdown_template property.") + + from echemdb.website.macros.render import render + return render(template, value=value) diff --git a/echemdb/website/generator/__main__.py b/echemdb/website/generator/__main__.py index 48b7e2383..fe88841be 100644 --- a/echemdb/website/generator/__main__.py +++ b/echemdb/website/generator/__main__.py @@ -24,14 +24,16 @@ import mkdocs_gen_files from echemdb.data.legacy.data import make_cvs_dataframe, datadir from echemdb.data.local import collect_datapackages -from echemdb.website.legacy.make_pages import create_element_pages, create_element_surface_pages, create_systems_pages, render +from echemdb.website.legacy.make_pages import create_element_pages, create_element_surface_pages, create_systems_pages +from echemdb.website.macros.render import render import echemdb.website.generator.database + def main(): for entry in echemdb.website.generator.database.cv: with mkdocs_gen_files.open(os.path.join("cv", "entries", f"{entry.identifier}.md"), "w") as md: - md.write(render("cv_entry.md", database=echemdb.website.generator.database.cv, entry=entry)) + md.write(render("pages/cv_entry.md", database=echemdb.website.generator.database.cv, entry=entry)) data = make_cvs_dataframe(collect_datapackages(datadir)) @@ -44,8 +46,9 @@ def main(): with mkdocs_gen_files.open(os.path.join("cv", "echemdb_pages", f"{echemdb_id}.md"), 'w') as out: out.write(render("echemdb_id.md", echemdb_id=echemdb_id, cvs=data)) - for tupled in data.groupby(by = ['electrode material', 'surface']).groups: + for tupled in data.groupby(by=['electrode material', 'surface']).groups: create_element_surface_pages(tupled[0], tupled[1]) + if __name__ in ["__main__", ""]: main() diff --git a/echemdb/website/legacy/make_pages.py b/echemdb/website/legacy/make_pages.py index c828c70f7..1fdf7d091 100644 --- a/echemdb/website/legacy/make_pages.py +++ b/echemdb/website/legacy/make_pages.py @@ -23,12 +23,10 @@ import os import os.path -from mdutils.mdutils import MdUtils from echemdb.data.legacy.build_data import TEMPLATE_FOLDERS, ELEMENTS_DATA, TARGET_FOLDERS, DISPLAYED_INFOS, get_plotly_plot import frontmatter import pandas as pd -import numpy as np import copy import mkdocs_gen_files from echemdb.data.legacy.data import datadir, make_cvs_dataframe @@ -37,26 +35,6 @@ cv_data = make_cvs_dataframe(collect_datapackages(datadir)) grouped_cv_data = cv_data.groupby(by=['electrode material', 'surface']) -def render(template, **kwargs): - r""" - Render `template` as a jinja template. - """ - from jinja2 import Environment, FileSystemLoader, select_autoescape, ChainableUndefined - env = Environment( - loader=FileSystemLoader(os.path.join(os.path.dirname(__file__), "..", "..", "..", "templates")), - autoescape=select_autoescape(), - ) - - # Load macros like mkdocs-macros does, see - # https://github.com/fralau/mkdocs_macros_plugin/blob/master/mkdocs_macros/plugin.py#L157 - def macro(f, name=''): - env.globals[name or f.__name__] = f - env.macro = macro - from echemdb.website.macros.legacy import define_env - define_env(env) - del env.macro - - return env.get_template(template).render(**kwargs) def get_filtered_tables(elementname, surface=None): diff --git a/echemdb/website/macros/__init__.py b/echemdb/website/macros/__init__.py index e69de29bb..d98ee2327 100644 --- a/echemdb/website/macros/__init__.py +++ b/echemdb/website/macros/__init__.py @@ -0,0 +1,32 @@ +r""" +Provides custom Jinja macros for rendering the echemdb websites. +""" +# ******************************************************************** +# This file is part of echemdb. +# +# Copyright (C) 2021 Albert Engstfeld +# Copyright (C) 2021 Johannes Hermann +# Copyright (C) 2021 Julian Rüth +# Copyright (C) 2021 Nicolas Hörmann +# +# echemdb is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# echemdb is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with echemdb. If not, see . +# ******************************************************************** + + +def enable_macros(env): + from echemdb.website.macros.legacy import define_env + define_env(env) + + from echemdb.website.macros.render import render + env.macro(render) diff --git a/echemdb/website/macros/render.py b/echemdb/website/macros/render.py new file mode 100644 index 000000000..e14dd2095 --- /dev/null +++ b/echemdb/website/macros/render.py @@ -0,0 +1,84 @@ +r""" +Implements a `render` macro that renders a template with the Jinja engine. + +EXAMPLES:: + +The `render` macro renders an element using a specific template:: + + >>> from io import StringIO + >>> from astropy.units import Unit + + >>> snippet = StringIO("{{ render('components/quantity.md', value=value) }}") + >>> render(snippet, value={ 'quantity': 1 * Unit("mol / l") }) + '1.0 M' + +""" +# ******************************************************************** +# This file is part of echemdb. +# +# Copyright (C) 2021 Albert Engstfeld +# Copyright (C) 2021 Johannes Hermann +# Copyright (C) 2021 Julian Rüth +# Copyright (C) 2021 Nicolas Hörmann +# +# echemdb is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# echemdb is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with echemdb. If not, see . +# ******************************************************************** + + +def render(template, **kwargs): + r""" + Render `template` as a jinja template in a new context. + + TESTS: + + The outer context does not leak into a nested context:: + + >>> from io import StringIO + >>> from astropy.units import Unit + + >>> snippet = StringIO("{{ render('components/quantity.md') }}") + >>> render(snippet, value={ 'quantity': 1 * Unit("mol / l") }) + Traceback (most recent call last): + ... + jinja2.exceptions.UndefinedError: 'value' is undefined + + """ + import os.path + from jinja2 import Environment, FileSystemLoader, select_autoescape + env = Environment( + loader=FileSystemLoader(os.path.join(os.path.dirname(__file__), "..", "..", "..", "templates")), + autoescape=select_autoescape(), + trim_blocks=True, + lstrip_blocks=True, + ) + + # Load macros like mkdocs-macros does, see + # https://github.com/fralau/mkdocs_macros_plugin/blob/master/mkdocs_macros/plugin.py#L157 + def macro(f, name=''): + env.globals[name or f.__name__] = f + env.macro = macro + from echemdb.website.macros import enable_macros + enable_macros(env) + del env.macro + + from echemdb.website.filters import enable_filters + enable_filters(env) + + from io import TextIOBase + if isinstance(template, TextIOBase): + template = env.from_string(template.read()) + else: + template = env.get_template(template) + + return template.render(**kwargs) diff --git a/environment.yml b/environment.yml index f1434c641..54b99fb1d 100644 --- a/environment.yml +++ b/environment.yml @@ -4,6 +4,7 @@ channels: - defaults dependencies: - astropy + - filelock - inflect - matplotlib - mkdocs @@ -14,6 +15,9 @@ dependencies: - pip - pybtex - pytest + - pytest-doctestplus + - pytest-xdist + - pytest-remotedata - pyyaml - pip: - linkchecker diff --git a/literature/alves_2011_electrochemistry_6010/alves_2011_electrochemistry_6010_p2_2a_solid.yaml b/literature/alves_2011_electrochemistry_6010/alves_2011_electrochemistry_6010_p2_2a_solid.yaml index 8b00e1551..b8b17db94 100644 --- a/literature/alves_2011_electrochemistry_6010/alves_2011_electrochemistry_6010_p2_2a_solid.yaml +++ b/literature/alves_2011_electrochemistry_6010/alves_2011_electrochemistry_6010_p2_2a_solid.yaml @@ -46,7 +46,7 @@ electrochemical system: LOT: null concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 1 uncertainty: none diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.3.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.3.yaml index 6f29ccc85..8ba9081ab 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.3.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.3.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: CsF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.9.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.9.yaml index be3540cb9..d08248bf5 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.9.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_2.9.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: CsF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_3.5.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_3.5.yaml index 3cd191776..3ae3fbe26 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_3.5.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_3.5.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: CsF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.0.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.0.yaml index faea8ec30..89e736151 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.0.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.0.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: CsF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.4.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.4.yaml index f6828333b..effd96c34 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.4.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Cs_4.4.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: CsF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.3.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.3.yaml index 4e00ac214..035895db8 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.3.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.3.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.04 name: LiF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.9.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.9.yaml index 5a90ea4a7..7f419bdf5 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.9.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_2.9.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.04 name: LiF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_3.5.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_3.5.yaml index 316f334a5..624725a4f 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_3.5.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_3.5.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.04 name: LiF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.0.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.0.yaml index 69d490c96..7c6b02edc 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.0.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.0.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.04 name: LiF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.4.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.4.yaml index 3f104d78f..4c3dd3bbf 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.4.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Li_4.4.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.04 name: LiF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.3.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.3.yaml index 5fdc35874..d8d7e7ea0 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.3.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.3.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: NaF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.9.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.9.yaml index 34e719202..553c343e4 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.9.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_2.9.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: NaF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_3.5.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_3.5.yaml index 792c3ffa2..e1acd2560 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_3.5.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_3.5.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: NaF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.0.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.0.yaml index 901246da7..bf838dcae 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.0.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.0.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: NaF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.4.yaml b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.4.yaml index 6d9c20ce7..41ceac00f 100644 --- a/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.4.yaml +++ b/literature/briega-martos_2021_cation_XXX/briega-martos_2021_cation_XXX_p2_Fig1_Na_4.4.yaml @@ -34,7 +34,7 @@ electrochemical system: electrolyte: components: - concentration: - unit: M + unit: mol / l value: 0.1 name: NaF source: @@ -48,7 +48,7 @@ electrochemical system: sum formula: H2O type: solvent - concentration: - unit: M + unit: mol / l value: null name: perchloric acid source: diff --git a/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1a_flat.yaml b/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1a_flat.yaml index 1adf0892b..00d24d8e8 100644 --- a/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1a_flat.yaml +++ b/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1a_flat.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaBr # can be trivia name, sum formula, etc concentration: value: 10 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1b_bold.yaml b/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1b_bold.yaml index b2e6eecbd..37203a2a4 100644 --- a/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1b_bold.yaml +++ b/literature/endo_1999_in-situ_19/endo_1999_in-situ_19_p1_1b_bold.yaml @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/engstfeld_2018_polycrystalline_17743/engstfeld_2018_polycrystalline_17743_4b_1.yaml b/literature/engstfeld_2018_polycrystalline_17743/engstfeld_2018_polycrystalline_17743_4b_1.yaml index cb5126914..e273ce5aa 100644 --- a/literature/engstfeld_2018_polycrystalline_17743/engstfeld_2018_polycrystalline_17743_4b_1.yaml +++ b/literature/engstfeld_2018_polycrystalline_17743/engstfeld_2018_polycrystalline_17743_4b_1.yaml @@ -48,7 +48,7 @@ electrochemical system: LOT: null concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 13 uncertainty: none diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_black.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_black.yaml index b36173b2d..c23945672 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_black.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_black.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_blue.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_blue.yaml index 23a2dc6a4..e709e4b00 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_blue.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_blue.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_red.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_red.yaml index 18b6782ae..dcb23eac2 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_red.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p1_1_red.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_blue.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_blue.yaml index 79226bcf4..ef9673628 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_blue.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_blue.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.005 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_pink.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_pink.yaml index 52ce2255f..71757c49d 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_pink.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_pink.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.022 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_red.yaml b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_red.yaml index 8e01eac4f..0d56f859f 100644 --- a/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_red.yaml +++ b/literature/gomez-marin_2012_surface_558/gomez-marin_2012_surface_558_p2_red.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_dotted.yaml b/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_dotted.yaml index 4f2cf8362..2dd3381da 100644 --- a/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_dotted.yaml +++ b/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_dotted.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_solid.yaml b/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_solid.yaml index fa92a52c4..b2229e149 100644 --- a/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_solid.yaml +++ b/literature/hamad_2003_electrosorption_211/hamad_2003_electrosorption_211_p2_1a_solid.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.03 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -66,7 +66,7 @@ electrochemical system: LOT: concentration: value: 0.02 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dashed.yaml b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dashed.yaml index d0e88cda7..10a9ee9e8 100644 --- a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dashed.yaml +++ b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaF # can be trivia name, sum formula, etc concentration: value: 0.09 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dotted.yaml b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dotted.yaml index 756d3a762..27cde900d 100644 --- a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dotted.yaml +++ b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_dotted.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaF # can be trivia name, sum formula, etc concentration: value: 0.09 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_solid.yaml b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_solid.yaml index ebc868a29..5807e5957 100644 --- a/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_solid.yaml +++ b/literature/horswell_2004_a_10970/horswell_2004_a_10970_p2_1a_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaF # can be trivia name, sum formula, etc concentration: value: 0.09 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_dashed.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_dashed.yaml index 0fd6d694b..18d27474b 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_dashed.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_solid.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_solid.yaml index 88910f6cc..5e230b994 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_solid.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p1_1_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_4.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_4.yaml index 2973fbe2b..221299e7a 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_4.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_4.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_dashed.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_dashed.yaml index a58c20160..f1668200d 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_dashed.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_solid.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_solid.yaml index c2e115913..9ccaffde3 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_solid.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p3_6_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_dashed.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_dashed.yaml index afeadcb2a..9b46f70f9 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_dashed.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_dashed.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_solid.yaml b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_solid.yaml index 588b29f4a..5bdacf482 100644 --- a/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_solid.yaml +++ b/literature/jovic_1999_cyclic_247/jovic_1999_cyclic_247_p4_7_solid.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p2_2a.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p2_2a.yaml index 206ce6ebf..2becf1843 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p2_2a.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p2_2a.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thick.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thick.yaml index 933bfaaa5..2bfc9b525 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thick.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thick.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thin.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thin.yaml index 33b2b2780..ce8755271 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thin.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_3a_thin.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thick.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thick.yaml index 87efa3c6d..5a91341c1 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thick.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thick.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thin.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thin.yaml index 2fc92cb37..e85f3b9ff 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thin.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p3_4a_thin.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thick.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thick.yaml index 1c8e0d83c..057b09fa0 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thick.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thick.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thin.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thin.yaml index 7664b201f..f9a9f3717 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thin.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p4_5a_thin.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.2 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_1.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_1.yaml index 17e69416e..4d042a9d3 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_1.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_1.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_2.yaml b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_2.yaml index 07b82a2a1..32d59b3c2 100644 --- a/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_2.yaml +++ b/literature/kerner_2002_measurement_2055/kerner_2002_measurement_2055_p5_6a_2.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.2 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dash-dotted.yaml b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dash-dotted.yaml index cf5adc9f9..fa06fc9d9 100644 --- a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dash-dotted.yaml +++ b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dash-dotted.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: # source: supplier: @@ -57,7 +57,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -69,7 +69,7 @@ electrochemical system: LOT: concentration: value: 5 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: 3 uncertainty: diff --git a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dashed.yaml b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dashed.yaml index d2e91b3e8..18a1f7caf 100644 --- a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dashed.yaml +++ b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dashed.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: # source: supplier: @@ -57,7 +57,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -69,7 +69,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: 3 uncertainty: diff --git a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dotted.yaml b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dotted.yaml index 46811aac5..bbfa70ba5 100644 --- a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dotted.yaml +++ b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_dotted.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: # source: supplier: @@ -57,7 +57,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -69,7 +69,7 @@ electrochemical system: LOT: concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: 3 uncertainty: diff --git a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_solid.yaml b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_solid.yaml index 0f425a28d..09c30af5e 100644 --- a/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_solid.yaml +++ b/literature/li_2000_chronocoulometric_95/li_2000_chronocoulometric_95_p1_solid.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: # source: supplier: @@ -57,7 +57,7 @@ electrochemical system: - name: # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -69,7 +69,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 3 uncertainty: diff --git a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_blue.yaml b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_blue.yaml index 0aeb01f25..3fbd6ab7c 100644 --- a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_blue.yaml +++ b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_blue.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: LiBr # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 12.5 uncertainty: diff --git a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_green.yaml b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_green.yaml index d2edcf9a5..34c1acde7 100644 --- a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_green.yaml +++ b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_green.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: KBr # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -66,7 +66,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 12.5 uncertainty: diff --git a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_red.yaml b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_red.yaml index 3a4045e17..437f1726e 100644 --- a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_red.yaml +++ b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1a_red.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: CsBr # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -66,7 +66,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 12.5 uncertainty: diff --git a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_blue.yaml b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_blue.yaml index 8894b0b00..9ff73c49d 100644 --- a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_blue.yaml +++ b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_blue.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: CsBr # can be trivia name, sum formula, etc concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_red.yaml b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_red.yaml index 55afa67e5..ffc07919d 100644 --- a/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_red.yaml +++ b/literature/nakamura_2011_structure_165433/nakamura_2011_structure_165433_p1_1b_red.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: CsBr # can be trivia name, sum formula, etc concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -66,7 +66,7 @@ electrochemical system: LOT: concentration: value: 0.04 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/nakamura_2014_structural_22136/nakamura_2014_structural_22136_p1_1_inset.yaml b/literature/nakamura_2014_structural_22136/nakamura_2014_structural_22136_p1_1_inset.yaml index 751ec6d67..561d40d32 100644 --- a/literature/nakamura_2014_structural_22136/nakamura_2014_structural_22136_p1_1_inset.yaml +++ b/literature/nakamura_2014_structural_22136/nakamura_2014_structural_22136_p1_1_inset.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: CsBr # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -66,7 +66,7 @@ electrochemical system: LOT: concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: 12.5 uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_dotted.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_dotted.yaml index d8f9aa214..6dfa66a87 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_dotted.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_dotted.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_solid.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_solid.yaml index 51175d68b..a18b183c7 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_solid.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1A_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_dotted.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_dotted.yaml index e78f3b980..596d857ce 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_dotted.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_dotted.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_solid.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_solid.yaml index c2eee5e69..2a8784dee 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_solid.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p2_1B_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_a.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_a.yaml index be28b1787..b049c4a89 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_a.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_a.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.15 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_b.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_b.yaml index 6ebf3512f..467c2f623 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_b.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_b.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 50 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_dashed.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_dashed.yaml index 28afc8492..8cf155d07 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_dashed.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p3_3A_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_a.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_a.yaml index 03ce52f84..eaa8295b6 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_a.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_a.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: acid # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.15 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_b.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_b.yaml index 8cbc06049..4532f63f0 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_b.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_b.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.05 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 50 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_dashed.yaml b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_dashed.yaml index 71b5ec1dc..6d364298e 100644 --- a/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_dashed.yaml +++ b/literature/pajkossy_1996_impedance_209/pajkossy_1996_impedance_209_p6_8A_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p2_2_inset.yaml b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p2_2_inset.yaml index e94074a88..fdb96c355 100644 --- a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p2_2_inset.yaml +++ b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p2_2_inset.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: HClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p4_5A.yaml b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p4_5A.yaml index 905da8564..c111bcb7e 100644 --- a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p4_5A.yaml +++ b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p4_5A.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p5_6A.yaml b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p5_6A.yaml index 9bfab1923..b5a1ec81d 100644 --- a/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p5_6A.yaml +++ b/literature/pajkossy_2001_double_3063/pajkossy_2001_double_3063_p5_6A.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaF # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/rehim_1998_electrochemical_1103/rehim_1998_electrochemical_1103_p2_1.yaml b/literature/rehim_1998_electrochemical_1103/rehim_1998_electrochemical_1103_p2_1.yaml index 756357393..ceca4132f 100644 --- a/literature/rehim_1998_electrochemical_1103/rehim_1998_electrochemical_1103_p2_1.yaml +++ b/literature/rehim_1998_electrochemical_1103/rehim_1998_electrochemical_1103_p2_1.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaOH # can be trivia name, sum formula, etc concentration: value: 1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_dotted.yaml b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_dotted.yaml index 9b376020d..79288e17b 100644 --- a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_dotted.yaml +++ b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_dotted.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_solid.yaml b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_solid.yaml index 5c4dce3f7..eb706c626 100644 --- a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_solid.yaml +++ b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 0.001 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l ph: value: uncertainty: diff --git a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_dashed.yaml b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_dashed.yaml index e7cd24236..1ba3b6c9b 100644 --- a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_dashed.yaml +++ b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_dashed.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: diff --git a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_solid.yaml b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_solid.yaml index c9931ec66..4de9697a9 100644 --- a/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_solid.yaml +++ b/literature/shi_1996_chloride_225/shi_1996_chloride_225_p1_1a_solid.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: KClO4 # can be trivia name, sum formula, etc concentration: value: 0.1 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: # source: supplier: @@ -65,7 +65,7 @@ electrochemical system: LOT: concentration: value: 1 - unit: mM #[M, mM, µM, g kg-1, ...] + unit: mmol / l ph: value: uncertainty: diff --git a/literature/zei_1991_the_295/zei_1991_the_295_p3_3a.yaml b/literature/zei_1991_the_295/zei_1991_the_295_p3_3a.yaml index 582538e87..ead84938b 100644 --- a/literature/zei_1991_the_295/zei_1991_the_295_p3_3a.yaml +++ b/literature/zei_1991_the_295/zei_1991_the_295_p3_3a.yaml @@ -37,7 +37,7 @@ electrochemical system: - name: NaCl # can be trivia name, sum formula, etc concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/literature/zei_1991_the_295/zei_1991_the_295_p3_3b.yaml b/literature/zei_1991_the_295/zei_1991_the_295_p3_3b.yaml index 086e1f6b7..e6686dcb3 100644 --- a/literature/zei_1991_the_295/zei_1991_the_295_p3_3b.yaml +++ b/literature/zei_1991_the_295/zei_1991_the_295_p3_3b.yaml @@ -38,7 +38,7 @@ electrochemical system: - name: NaBr # can be trivia name, sum formula, etc concentration: value: 0.01 - unit: M #[M, mM, µM, g kg-1, ...] + unit: mol / l type: salt # source: supplier: diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 000000000..c48058999 --- /dev/null +++ b/templates/README.md @@ -0,0 +1,12 @@ +jinja Templates +=============== + +Templates to render MarkDown with the [Jinja Templating +Engine](https://jinja.palletsprojects.com/en/3.0.x/templates/). + +There are two kinds of templates. Those that render entire [pages/](pages/), +such as a template to render a page for an invididual CV, and those that render +shorter markdown snippets in [components/](components/). + +Technically, these are almost identical. But only the former render a +frontmatter. diff --git a/templates/components/electrolyte.md b/templates/components/electrolyte.md new file mode 100644 index 000000000..cb90d4880 --- /dev/null +++ b/templates/components/electrolyte.md @@ -0,0 +1,10 @@ +{% set plus = joiner(" + ") %} +{% for component in value.components + | selectattr("type", "in", ["acid", "base", "alkaline", "salt"]) %} + {{- plus() -}} + {% if component.concentration.value -%} + {{ component.concentration | render }} {{ component.name }} + {%- else -%} + {{ component.name }} + {%- endif %} +{% endfor %} diff --git a/templates/components/quantity.md b/templates/components/quantity.md new file mode 100644 index 000000000..0ceb2cb78 --- /dev/null +++ b/templates/components/quantity.md @@ -0,0 +1,6 @@ +{% if value.quantity.unit.is_equivalent('mol / m^3') %} + {{- value.quantity.to('mol / l').value }} M +{%- else %} + {{- value.quantity.value }} {{ value.quantity.unit.to_string("latex_inline") -}} +{% endif %} + diff --git a/templates/cv_entry.md b/templates/pages/cv_entry.md similarity index 90% rename from templates/cv_entry.md rename to templates/pages/cv_entry.md index ccc8157b9..a190ab5a0 100644 --- a/templates/cv_entry.md +++ b/templates/pages/cv_entry.md @@ -1,5 +1,5 @@ -# {{ entry.electrochemical_system.electrodes.working_electrode.material }}({{ entry.electrochemical_system.electrodes.working_electrode.crystallographic_orientation }}) - 0.1 M CsF + 0.1 M HClO4 +# {{ entry.electrochemical_system.electrodes.working_electrode.material }}({{ entry.electrochemical_system.electrodes.working_electrode.crystallographic_orientation }}) - {{ entry.electrochemical_system.electrolyte | render("components/electrolyte.md") }} @@ -7,9 +7,9 @@ A cyclic voltammogramm for {{ entry.electrochemical_system.electrodes.working_electrode.material }} ({{ entry.electrochemical_system.electrodes.working_electrode.crystallographic_orientation }}) recorded in -0.1 M CsF + 0.1 M HClO4 +{{ entry.electrochemical_system.electrolyte | render("components/electrolyte.md") }} at a scan rate of -50 mV s$^{-1}$ +{{ entry.figure_description.scan_rate | render }} from Figure {{entry.source.figure }} in diff --git a/templates/echemdb_id.md b/templates/pages/legacy/echemdb_id.md similarity index 100% rename from templates/echemdb_id.md rename to templates/pages/legacy/echemdb_id.md diff --git a/templates/element.md b/templates/pages/legacy/element.md similarity index 100% rename from templates/element.md rename to templates/pages/legacy/element.md diff --git a/templates/element_surface.md b/templates/pages/legacy/element_surface.md similarity index 100% rename from templates/element_surface.md rename to templates/pages/legacy/element_surface.md diff --git a/templates/surface.md b/templates/pages/legacy/surface.md similarity index 100% rename from templates/surface.md rename to templates/pages/legacy/surface.md diff --git a/templates/systems.md b/templates/pages/legacy/systems.md similarity index 100% rename from templates/systems.md rename to templates/pages/legacy/systems.md