Context-dependent Descriptors + Electrolyte Rendering - #81
Merged
Conversation
saraedum
commented
Dec 1, 2021
| import yaml | ||
| return yaml.dump(self._descriptor) | ||
|
|
||
| class UnitValueDescriptor(GenericDescriptor): |
Member
Author
There was a problem hiding this comment.
This class is new. A descriptor wrapper for descriptors that have value and unit.
saraedum
commented
Dec 1, 2021
Functionally, these are the same, but morally these are quite different. In particular, the pages will have a frontmatter eventually, while the components won't.
run doctests with `pytest -n auto --doctest-plus --doctest-modules echemdb/` to skip all tests that download the echemdb and run the tests in parallel.
22 tasks
saraedum
commented
Dec 5, 2021
saraedum
marked this pull request as ready for review
December 5, 2021 08:09
saraedum
force-pushed
the
unit-value
branch
3 times, most recently
from
December 7, 2021 18:51
b8bd77f to
e777079
Compare
saraedum
force-pushed
the
unit-value
branch
2 times, most recently
from
December 7, 2021 21:39
4277b7d to
57a7dba
Compare
saraedum
enabled auto-merge
December 21, 2021 03:09
saraedum
commented
Dec 21, 2021
saraedum
disabled auto-merge
December 21, 2021 16:17
saraedum
enabled auto-merge
December 21, 2021 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70.
This PR introduces a descriptor factory that can be used to add custom features to descriptors. Here a
QuantityDescriptorthat adds a astropy.quantitywhen there are exactlyunitandvalueas keys in the metadata.This also implements proper rendering of such quantities and rendering of the electrolyte through the
| renderfilter. Both are rendered from MarkDown templates, seequantity.mdandelectrolyte.md.Finally, this fixes some bugs in the data. Namely, it replaces
Mwithmol / lwhich astropy understands.Sorry for doing several things at once in the same PR.
Dependencies