Skip to content

Conversation

@DunklesArchipel
Copy link
Member

@DunklesArchipel DunklesArchipel commented Nov 11, 2025

Checklist

  • Added an entry in doc/news/.
  • Added a test for this change.
  • Adapted the documentation for this change.

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/AgCl might pose a problem, since the concentration is not given.
    • Add a custom AgAgCl electrode with a shift of 210 mV and raise a warning?
  • Hg/HgO/0.1M NaOH must 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.2c05655
  • Check all references (source) for the shifts in the potentials and provide a DOI.
  • move offset to unitpackage.entry.Entry
  • Adapt news
  • From linuxrider: CE is inconsistent with Ag/AgCl. We could always use Me/MeAnion: Hg/Hg2Cl2, CE could by a synonym. (-> Task in Improve reference electrode module #125)

"""
field_name = field_name or "E"
Copy link
Contributor

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?

Copy link
Member Author

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.

@DunklesArchipel DunklesArchipel marked this pull request as ready for review December 17, 2025 21:58
@dataclass(frozen=True)
class ReferenceElectrodeEntry: # pylint: disable=too-many-instance-attributes
"""
Represents an entry with a value of a specified reference electrode.
Copy link
Member

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.

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Member Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Comment on lines +120 to +126
EXAMPLES
>>> from unitpackage.electrochemistry.reference_electrode import ReferenceElectrode
>>> ref = ReferenceElectrode("Ag/AgCl-sat") # doctest: +NORMALIZE_WHITESPACE
"""
return f"{self.data}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this example incomplete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rename fields_fields to documentation add possibility to switch between between reference scales

3 participants