Add rescaling of reference scales in EchemdbEntry#115
Add rescaling of reference scales in EchemdbEntry#115DunklesArchipel merged 48 commits intoechemdb:mainfrom
Conversation
|
|
||
|
|
||
| """ | ||
| field_name = field_name or "E" |
There was a problem hiding this comment.
Is an arbitrary field_name necessary in the frame of echemdb?
There was a problem hiding this comment.
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>
Co-authored-by: Johannes Hermann <linuxrider@web.de>
| if filename or outdir: | ||
| if filename is None: | ||
| filename = "reference_electrode.json" | ||
| if outdir: | ||
| os.makedirs(outdir, exist_ok=True) | ||
| filepath = os.path.join(outdir, filename) | ||
| else: | ||
| filepath = filename | ||
| with open(filepath, "w", encoding="utf-8") as f: | ||
| json.dump(self.data, f, ensure_ascii=False, indent=4) | ||
| # json.dump does not save files with a newline, which compromises the tests | ||
| # where the output files are compared to an expected json. | ||
| f.write("\n") | ||
|
|
||
| return None |
There was a problem hiding this comment.
I assume this can be omitted and leave it to the user how the data should be exported from json. For those not versed with JSON, we could include and example in the documentation.
| full_name="0.5 M mercury / mercurous sulfate electrode", | ||
| temperature_dependence=[ | ||
| { | ||
| "formula": "E = 0.63495 - 781.44E-6 * T - 426.89E-9 * T**2", |
There was a problem hiding this comment.
I hope we don't expect to be able to parse this some day?
There was a problem hiding this comment.
We still have to decide how we should handle these cases. But that will be a matter of discussion in the future.
|
|
||
| resource.custom["MutableResource"] = df_resource | ||
|
|
||
| # update offset in the fields |
There was a problem hiding this comment.
I can't make sense of the code that follows. It's extremely complicated to me. I get what you're trying to do: record an offset in the resource and update the existing one if there's already one. But it's really hard to follow.
saraedum
left a comment
There was a problem hiding this comment.
I'd try to simplify things a bit but in principle this looks totally fine to me.
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