Pyco2sys

Latest version: v1.8.3.4

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

1.4.3

***Bug fixes***

* Corrected missing a pH scale conversion in [SLH20](https://pyco2sys.readthedocs.io/en/latest/refs/#s) option for carbonic acid dissociation. **Any calculations with this option in PyCO2SYS v1.4.1 or v1.4.2 should be updated!**

***Validation***

* Results validated against new release candidate version of CO2SYS-MATLAB v3.

***New API***

* New wrapper function with the same input order and default gas constant option as the new CO2SYS-MATLAB v3 available in `PyCO2SYS.api.CO2SYS_MATLABv3`.

***Internal reorganisation***

* `_approx` function inputs in `PyCO2SYS.solve.delta` updated to match the exact Autograd functions for easier switching.

1.4.2

***Bug fixes***

* Swapped order of `totals` and `Ks` arguments for all functions in `PyCO2SYS.solve.delta` for consistency with other modules.
* Inverted the alkalinity-pH residual equations in `PyCO2SYS.solve.delta`.

***Reorganisation***

* Broke out some parts of `PyCO2SYS.equilibria.assemble` into separate functions.

1.4.1

***Extra calculation options***

* Added the [2018 CODATA](https://physics.nist.gov/cgi-bin/cuu/Value?r) value for the universal gas constant *R* as an option for consistency with forthcoming CO2SYS-MATLAB v3. The original DOEv2 version remains default.
* Added the [SLH20](https://pyco2sys.readthedocs.io/en/latest/refs/#s) equations as option `16` for the carbonic acid dissociation constants.

1.4.0

***New features***

* Added `uncertainty` module with functions to evaluate derivatives of PyCO2SYS outputs with respect to inputs, along with corresponding [documentation](https://pyco2sys.readthedocs.io/en/latest/uncertainty).
* Specific input values can optionally be provided for all total concentrations and equilibrium constants that are estimated internally from salinity, temperature and pressure.

***General improvements***

* Added basic sanity checking to prevent some invalid marine carbonate system parameter input values.
* Nutrient concentrations have always been set to zero internally for `K1K2CONSTANTS` options `6` and `8`, and salinity too for `8`, regardless of the input values. This is now reflected in the output values of these variables in the `CO2dict`.

***New outputs***

* Substrate:inhibitor ratio (SIR) of [B15](https://pyco2sys.readthedocs.io/en/latest/refs/#b), calculated with `SIratio` in new module `bio`.
* Inputs `PAR1` and `PAR2`.
* The "Peng correction" factor.
* The fugacity factor for converting between CO<sub>2</sub> partial pressure and fugacity.
* The activity coefficient of the H<sup>+</sup> ion for NBS pH scale conversions.

***Validation***

* Calculations compare very favourably against the forthcoming [CO2SYS for MATLAB v3](https://github.com/jonathansharp/CO2-System-Extd) - see the [validation documentation](https://pyco2sys.readthedocs.io/en/latest/validate/#external-comparisons) for a discussion of the results.

1.3.0

***New features***

* Added bicarbonate ion (type `7`) and aqueous CO<sub>2</sub> (type `8`) as options for known input marine carbonate system variables.
* Added module `test` with functions to perform internal consistency checks on `PyCO2SYS.CO2SYS` calculations and compare results with those from other sources.
* Added module `api` with a wrapper for `PyCO2SYS.CO2SYS` to allow inputs as Pandas Series and/or Xarray DataArrays.

***Improved calculations***

* The Revelle factor and all other buffer factors added in v1.2 are now evaluated using automatic differentiation, which means that the effects of all equilibrating species are taken into account.
* The original, non-automatic functions that do not account for nutrient effects are still available in `buffers.explicit`.
* Can switch between calculation methods using new optional input `buffers_mode`.
* Corrected Revelle factor calculations:
* Added missing "Peng correction" to Revelle factor calculation at output conditions. *Note that this correction is currently also missing from CO2SYS for MATLAB!*
* Decreased DIC perturbation size for more accurate finite-difference "explicit" evaluation.
* Finite-difference calculation now references the correct DIC value.
* Implemented better initial guesses for pH in all iterative solvers in `solve.get` following [M13](https://pyco2sys.readthedocs.io/en/latest/refs/#m) and [OE15](https://pyco2sys.readthedocs.io/en/latest/refs/#o).
* Switched to using exact slopes in iterative solvers in `solve.get`, evaluated using Autograd in new submodule `solve.delta`.
* Updated entire package to be [Autograd](https://github.com/HIPS/autograd)-able.
* Return NaN instead of negative DIC if an impossible pH-alkalinity combination is given as input (i.e. pH is too high).
* Return NaN where DIC and one of its components is given if the component is impossibly large.

***Internal reorganisation***

* Major internal reorganisation that is probably not fully captured in these notes.
* Renamed modules:
* `assemble` is now `engine`.
* `concentrations` is now `salts`.
* `extra` is now `buffers.explicit`.
* Module `equilibria` now contains sub-modules:
* `p1atm` for calculating constants at atmospheric pressure.
* `pcx` for determining pressure correction factors.
* `pressured` for calculating constants at given pressure.
* Module `solve` now contains sub-modules:
* `initialise` to generate first-guess estimates of pH for the TA-pH solvers.
* `get` to calculate a new system variable from various input pairs.
* Added module `solubility` for mineral solubility calculations.
* Relocated `_CaSolubility` function from root to `solubility.CaCO3`.
* Separated out its internal calculations into a set of subfunctions also in the `solubility` module.
* Added calcium molinity `TCa` as an input, instead of being evaluated internally.
* Added calcium molininty `TCa` (estimated from salinity) into the main `CO2dict` output from `PyCO2SYS.CO2SYS`.
* Relocated `_RevelleFactor` function from root to `buffers.RevelleFactor`.
* Relocated `_FindpHOnAllScales` function from root to `convert.pH2allscales`.
* Added module `constants` for storing values of universal physical constants.
* Lists of equilibrium constants and total concentrations now passed around internally as dicts, for safety.
* Total sulfate and bisulfate dissociation constant renamed from `TS` and `KS` to `TSO4` and `KSO4` internally to avoid confusion with sulfide species.
* The as-close-as-possible MATLAB clone in `PyCO2SYS.original` no longer produces a dict but just the original `DATA`, `HEADERS` and `NICEHEADERS` outputs.

***Miscellaneous***

* Documentation substantially expanded and switched to using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
* Validation section added with internal consistency checks and an external comparison of PyCO2SYS calculations with CO2SYS for MATLAB.
* All code now formatted with [Black](https://github.com/psf/black) (except for module `original`).
* Version number now reported with `PyCO2SYS.say_hello()` in homage to the original MS-DOS program.

1.3.0.0

Identical to v1.3.0, but fixing Zenodo error.

Page 3 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.