-
Notifications
You must be signed in to change notification settings - Fork 3
Add rescaling of reference scales in EchemdbEntry #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| """ | ||
| field_name = field_name or "E" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is an arbitrary field_name necessary in the frame of echemdb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, for example, you could have a potential given for a ring electrode or the counter electrode that you might want to shift as well.
Co-authored-by: Johannes Hermann <linuxrider@web.de>
| @dataclass(frozen=True) | ||
| class ReferenceElectrodeEntry: # pylint: disable=too-many-instance-attributes | ||
| """ | ||
| Represents an entry with a value of a specified reference electrode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"entry" as in :class:Entry? Just trying to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is an entry within a reference electrode. So for each electrode one can find different values in the literature. Each entry provides such a value, including its source and additional details.
| "entries": [ | ||
| { | ||
| "value": 0.000, | ||
| "preferred": True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the "science" here. But that preferred looks really odd. Why not just always say that the first one is the preferred one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named it now "standard" with a value "ECHEMDB-2026". This relates to the approach used by astropy to indicate the CODATA standard for SI units.
| @@ -0,0 +1,5 @@ | |||
| **Added:** | |||
|
|
|||
| * Added `unitpackage.electrochemistry.reference_electrodes` with contains reference electrode data and a dataclass to interact with the data, including functions to shift the potentials between different reference scales. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Added `unitpackage.electrochemistry.reference_electrodes` with contains reference electrode data and a dataclass to interact with the data, including functions to shift the potentials between different reference scales. | |
| * Added `unitpackage.electrochemistry.reference_electrodes` witch contains reference electrode data and a dataclass to interact with the data, including functions to shift the potentials between different reference scales. |
| EXAMPLES | ||
| >>> from unitpackage.electrochemistry.reference_electrode import ReferenceElectrode | ||
| >>> ref = ReferenceElectrode("Ag/AgCl-sat") # doctest: +NORMALIZE_WHITESPACE | ||
| """ | ||
| return f"{self.data}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this example incomplete?
Co-authored-by: Johannes Hermann <linuxrider@web.de>
Checklist
doc/news/.Fixes #101
Fixes #107
So far we have the following reference electrodes in the echemdb database for aqueous systems, which have to be accounted for:
['RHE', 'SHE', 'SCE', 'Ag/AgCl', 'Hg/HgO/0.1M NaOH']Ag/AgClmight pose a problem, since the concentration is not given.Hg/HgO/0.1M NaOHmust be implemented. As long as we do not deconvolute the names, we should for the few cases simply add the offset. Reference values can be found here for all kinds of electrolytes: https://pubs.acs.org/doi/10.1021/acscatal.2c05655unitpackage.entry.Entry