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 2 of 5

1.8.0

***New features***

* Adds `pressure_atmosphere` and `pressure_atmosphere_out` arguments, rather than assuming 1 atm total barometric pressure.

***Behind-the-scenes improvements***

* Adds additional constraint to the initial pH estimate for more robust results for the alkalinity-CO<sub>2</sub> fugacity parameter pair.
* Difference derivatives for uncertainties now have a fixed step size for each argument, instead of scaling depending on arguments, for more reproducible results.

1.7.1

*Bug fixes*

* Improved handling of zero-valued inputs.
* Adjusted `CO2SYS_wrap` to work with latest pandas release.

1.7.0

***New features***

* Can now run `pyco2.sys` with no carbonate system parameter arguments provided, to just return all the equilibrium constants etc. under the specified conditions.
* Can also run `pyco2.sys` with only one carbonate system parameter argument. This does not solve the carbonate system, but does calculate all that can be calculated with that parameter.
* Added carbonic acid constants parameterisation of [SB21](https://pyco2sys.readthedocs.io/en/latest/refs/#s).
* Added bisulfate dissociation constant parameterisation of [WM13](https://pyco2sys.readthedocs.io/en/latest/refs/#w)/[WMW14](https://pyco2sys.readthedocs.io/en/latest/refs/#w).
* Added spreadsheet-to-spreadsheet function `pyco2.ezio` (with thanks to [Daniel Sandborn](https://github.com/d-sandborn)).
* Integrated uncertainty propagation into the main `pyco2.sys` function and expanded its capabilities.

***Internal updates***

* Switched default first-guess pH for solving from the alkalinity-carbonate ion parameter pair at low alkalinity from 10 to 3.
* Renamed various internal functions and variables for better consistency with the Pythonic `pyco2.sys` i/o syntax.
* Removed the `PyCO2SYS.test` module, instead defining the round-robin test functions it contained directly in the test suite.
* Added various internal settings for testing and validation against older CO2SYS-MATLAB versions.
* Adjust aqueous CO<sub>2</sub> calculation for better consistency with CO2SYS-MATLAB (but negligible changes in the results).
* Can now use `PyCO2SYS.hello()` to find version number and credits (alias for `PyCO2SYS.say_hello()`).
* The final component of DIC (or DIC itself) to be calculated is now always computed by difference from the known components.
* Various functions in `convert` module renamed.

***Validation***

* Rigorous validation against various CO2SYS-MATLAB versions performed, as described in forthcoming PyCO2SYS manuscript (Humphreys et al., in prep.).

***Bug fixes***

* `par1`, `par2`, `par1_type` and `par2_type` arguments now always get broadcasted to the maximum size, even if they are scalar.
* Erroneous `"k_phosphate_*"` keys corrected to `"k_phosphoric_"`.
* Override values for equilibrium constants under output conditions now assigned correctly.
* Fixed minor errors in initial pH estimates when solving from alkalinity and either DIC or [CO$_2$(aq)].

1.6.0

***Bug fixes***

* Updates the total alkalinity equation to fix minor error in pH scale conversions inherited from CO2SYS-MATLAB (see related note in [v1.5.0 release notes](https://pyco2sys.readthedocs.io/en/latest/versions/#150-29-july-2020)).

***New inputs and outputs***

* Enables inputting total molalities and equilibrium constants for up to two additional contributors to total alkalinity.
* Full chemical speciation returned in the output dict of `pyco2.sys`, not just the alkalinity components as before.

***New syntax***

* Adds `sys` as an alias for `CO2SYS_nd` at the top level. Recommended Python-style syntax is thus now `pyco2.sys`.

1.5.1

***Bug fixes***

* Switched `dx`-scaling function in `PyCO2SYS.uncertainties` to use `numpy.nanmedian` instead of `numpy.median`.
* Fixed `PyCO2SYS.uncertainties.propagate_nd` bug that prevented calculations on non-scalar arguments.

1.5.0

***New top-level functions***

* Adds `PyCO2SYS.CO2SYS_nd` top-level function with a more Pythonic interface and with NumPy broadcasting of $n$-dimensional inputs.
* In `PyCO2SYS.CO2SYS_nd`, results at "output" conditions are only calculated if output temperature or pressure is provided.
* Adds corresponding `PyCO2SYS.uncertainty.forward_nd` and `PyCO2SYS.uncertainty.propagate_nd` functions for uncertainty propagation.

***Alternative calculations***

* New alkalinity equation fixing pH scale conversion bug inherited from CO2SYS-MATLAB is available, but not yet implemented by default.

***Extra arguments and results***

* Solubility constants for aragonite and calcite available directly as outputs from `PyCO2SYS.CO2SYS` and `PyCO2SYS.CO2SYS_nd`
* Explicit values for the solubility constants can be given as arguments to override the default internal calculation.

***Internal reorganisation***

* All 2-to-3 functions in `PyCO2SYS.solve.get` now have a more consistent set of inputs.
* Revised pH scale conversion functions for consistency and added tests for their internal accuracy.
* Switched preallocations to use `np.shape` not `np.size` in preparation for working with $n$-dimensional inputs.
* Updated style to import the whole NumPy module as `np` instead of individual functions separately.
* Converted `PyCO2SYS.engine` to a sub-module.

Page 2 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.