Package: electrolytes
electrolyteselectrolytesprovides command-line and programmatic access to a database of electrolytes and their properties. It includes 518 components by default (seecredits). The package covers basic management of the database, including support for storing user-defined electrolytes.electroMicroTransportelectrolytesis primarily developed as a utility to assist in preparing simulation cases for theelectroMicroTransporttoolbox for electromigrative separations. However, it is an independent package and can be installed and used separately.InstallationInstall withpip:$python3-mpipinstallelectrolyteselectrolytescurrently requires Python 3.7 or later, and a relatively recent version of pip (pip may be upgraded withpython3 -m pip install --upgrade pip).Command-line usageInvoke theelectrolytescommand-line application to search the database, find the details of a particular component, or to add/remove user-defined components. In your terminal, run:$electrolytesor, alternatively:$python3-melectrolytesAdd the--helpflag to learn what options are available.Python APIThe Python API is provided forelectroMicroTransportcase initialization scripts.fromelectrolytesimportdatabase,PropertiesYou can look up components in thedatabaseas you would withdict(with component names as keys), and also add user-defined components with theaddmethod (as ifdatabasewere a set). Components are instances of theConstituentclass. Extra methods are also defined fordatabase:defuser_defined(self)->Iterable[str]:...defis_user_defined(self,name:str)->bool:...Thedatabaseobject is also usable as a context manager (i.e.with database:), which allows multiple operations to be performed with exclusive access to the database (locking out any other processes for the duration).Constituentnames are case insensitive and will be automatically converted to all uppercase. Any instances added to (or removed from) thedatabasewill be saved for the current operating system user. Default components cannot be changed or removed (expect aValueErrorif you try).The public interface of theConstituentclass is:classConstituent:name:stru_neg:Sequence[float]=[]# mobilities for [..., -3, -2, -1], SI units*1e-9u_pos:Sequence[float]=[]# mobilities for [+1, +2, +3, ...], SI units*1e-9pkas_neg:Sequence[float]=[]# pKas for [..., -3, -2, -1]pkas_pos:Sequence[float]=[]# pKas for [+1, +2, +3, ...]# Interface for electroMicroTransportdefmobilities(self)->Sequence[float]:...# for [..., +3, +2, +1, -1, -2, -3, ...], SI unitsdefpkas(self)->Sequence[float]:...# for [..., +3, +2, +1, -1, -2, -3, ...]# NOTE: the above are padded if needed so that +3 and -3 are always present (len >= 6)defdiffusivity(self)->float:...# SI unitsData creditsElectrolyte data taken from the Simul 6 application[^simul6] (homepage,GitHub). The dataset of different electrolytes was originally compiled by Prof. Hirokawa[^Hirokawa].[^simul6]: GAŠ, Bohuslav; BRAVENEC, Petr. Simul 6: A fast dynamic simulator of electromigration. Electrophoresis, 2021, vol. 42, no. 12-13, pp. 1291-1299. DOI:10.1002/elps.202100048[^Hirokawa]: HIROKAWA, Takeshi, et al. Table of isotachophoretic indices: I. Simulated qualitative and quantitative indices of 287 anionic substances in the range ph 3–10. Journal of Chromatography A, 1983, vol. 271, no. 2, pp. D1-D106. DOI:10.1016/S0021-9673(00)80225-3