PyCO2SYS: marine carbonate system calculations in Python
Bibliographic record
Abstract
PyCO2SYS is a Python toolbox for solving the marine carbonate system and calculating related seawater properties. Its core is a Python implementation of CO2SYS for MATLAB. Documentation is online: pyco2sys.readthedocs.io. Changes in v1.3.0 New features Added bicarbonate ion (type 7) and aqueous CO2 (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 and OE15. 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-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. Validation section added with internal consistency checks and an external comparison of PyCO2SYS calculations with CO2SYS for MATLAB. All code now formatted with Black (except for module original). Version number now reported with PyCO2SYS.say_hello() in homage to the original MS-DOS program.
Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.
How this classification was reachedexpand
Full frame machine prediction
Teacher imitationNot calibrated prevalence, not ground truth. Human validation pending. The Gemma side is a direct model label for every work in the frame, read from the title-only record. The Codex side is a classifier learned from the 10,348 direct Codex labels and calibrated to design-weighted sample rates; fields without enough sample support carry no Codex call. Candidate is the union of the two sides; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels.
Distilled classifier scores by category (both heads)
| Category | Codex | Gemma |
|---|---|---|
| Metaresearch | 0.001 | 0.005 |
| Meta-epidemiology (narrow) | 0.002 | 0.001 |
| Meta-epidemiology (broad) | 0.001 | 0.002 |
| Bibliometrics | 0.001 | 0.001 |
| Science and technology studies | 0.001 | 0.001 |
| Scholarly communication | 0.002 | 0.003 |
| Open science | 0.004 | 0.003 |
| Research integrity | 0.001 | 0.003 |
| Insufficient payload (model declined to judge) | 0.110 | 0.044 |
Machine scores (provisional)
The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.
Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.
score_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from itClassification
machine, unvalidatedMachine predicted; a candidate call from one source (direct Gemma or distilled Codex), not a consensus.
How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".