diff --git a/.gitignore b/.gitignore index 244b74d..e7ba3b2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ *.ipynb_checkpoints .ipynb_checkpoints */.ipynb_checkpoints/* -dist/ \ No newline at end of file +dist/ +docs/build \ No newline at end of file diff --git a/.pylintrc b/.pylintrc index 9ee81d9..64ee273 100644 --- a/.pylintrc +++ b/.pylintrc @@ -427,6 +427,7 @@ disable=raw-checker-failed, file-ignored, suppressed-message, useless-suppression, + useless-parent-delegation, deprecated-pragma, use-symbolic-message-instead, use-implicit-booleaness-not-comparison-to-string, diff --git a/src/cvsim/fit_curve.py b/src/cvsim/fit_curve.py index a335a71..4149744 100644 --- a/src/cvsim/fit_curve.py +++ b/src/cvsim/fit_curve.py @@ -259,7 +259,63 @@ def fit_function( class FitE_rev(FitMechanism): - """Scheme for fitting a CV for a reversible (Nernstian) one-electron transfer mechanism.""" + """ + Scheme for fitting a CV for a reversible (Nernstian) one-electron transfer mechanism. + + Parameters + ---------- + voltage_to_fit : list[float] | np.ndarray + Array of voltage data of the CV to fit. + current_to_fit : list[float] | np.ndarray + Array of current data of the CV to fit. + scan_rate : float + Potential sweep rate (V/s). + c_bulk : float + Bulk concentration of redox species (mM or mol/m^3). + step_size : float + Voltage increment during CV scan (mV). + disk_radius : float + Radius of disk macro-electrode (mm). + temperature : float + Temperature (K). + Default is 298.0 K (24.85C). + reduction_potential : float | None + Reduction potential of the one-electron transfer process (V vs. reference). + If known, can be fixed value, otherwise defaults to None. + diffusion_reactant : float | None + Diffusion coefficient of reactant (cm^2/s). + If known, can be fixed value, otherwise defaults to None. + diffusion_product : float | None + Diffusion coefficient of product (cm^2/s). + If known, can be fixed value, otherwise defaults to None. + + """ + + def __init__( + self, + voltage_to_fit: list[float] | np.ndarray, + current_to_fit: list[float] | np.ndarray, + scan_rate: float, + c_bulk: float, + step_size: float, + disk_radius: float, + temperature: float = 298.0, + reduction_potential: float | None = None, + diffusion_reactant: float | None = None, + diffusion_product: float | None = None, + ) -> None: + super().__init__( + voltage_to_fit, + current_to_fit, + scan_rate, + c_bulk, + step_size, + disk_radius, + temperature, + reduction_potential, + diffusion_reactant, + diffusion_product, + ) def _scheme(self, get_var: Callable[[str], float]) -> CyclicVoltammetryScheme: return E_rev( diff --git a/src/cvsim/mechanisms.py b/src/cvsim/mechanisms.py index 76edf49..54132a5 100644 --- a/src/cvsim/mechanisms.py +++ b/src/cvsim/mechanisms.py @@ -179,8 +179,60 @@ class E_rev(CyclicVoltammetryScheme): Provides a current-potential profile for a reversible (Nernstian) one-electron transfer mechanism. This is equation (7:7) from [1]. + Parameters + ---------- + start_potential : float + Starting potential of scan (V vs. reference). + switch_potential : float + Switching potential of scan (V vs. reference). + reduction_potential : float + Reduction potential of the one-electron transfer process (V vs. reference). + scan_rate : float + Potential sweep rate (V/s). + c_bulk : float + Bulk concentration of redox species (mM or mol/m^3). + diffusion_reactant : float + Diffusion coefficient of reactant (cm^2/s). + diffusion_product : float + Diffusion coefficient of product (cm^2/s). + step_size : float + Voltage increment during CV scan (mV). + Default is 1.0 mV, a typical potentiostat default. + disk_radius : float + Radius of disk macro-electrode (mm). + Default is 1.5 mm, a typical working electrode. + temperature : float + Temperature (K). + Default is 298.0 K (24.85C). + """ + def __init__( + self, + start_potential: float, + switch_potential: float, + reduction_potential: float, + scan_rate: float, + c_bulk: float, + diffusion_reactant: float, + diffusion_product: float, + step_size: float = 1.0, + disk_radius: float = 1.5, + temperature: float = 298.0, + ) -> None: + super().__init__( + start_potential, + switch_potential, + reduction_potential, + scan_rate, + c_bulk, + diffusion_reactant, + diffusion_product, + step_size, + disk_radius, + temperature, + ) + def simulate(self) -> tuple[np.ndarray, np.ndarray]: """ Simulates the CV for a reversible one-electron transfer mechanism.