Feat: add CO2CONTENT.m algo, #9
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major new feature to the
canyonbpypackage: the addition of the CONTENT method for generating internally-consistent carbonate system estimates, alongside significant improvements to input broadcasting and documentation. The update also refines the handling of input shapes and coordinates, making predictions more robust and user-friendly when working with multi-dimensionalxarraydatasets. The package version is bumped to 0.4.0 to reflect these changes.New CONTENT functionality:
contentmethod to theCanyonBAccessorclass, enabling users to compute internally-consistent carbonate system variables (AT, CT, pH, pCO₂) by combining CANYON-B neural network outputs with CO2SYS estimates, including uncertainty propagation and options to include raw or full sub-outputs._pack_content_resultsmethod to correctly package CONTENT outputs asxarray.Datasetobjects, preserving dimensions and coordinates, and supporting optional output details.Input broadcasting and shape handling:
DatasetToNumpyclass to broadcast all input variables to a common shape before flattening, ensuring compatibility with multi-dimensional datasets and robust reshaping of outputs. Addedoriginal_dimsto track dimension names (following feat: native xarray support viads.canyonbaccessor (v0.3.0) #7)._pack_resultsand_pack_content_resultsto use the broadcasted shapes and dimension names, ensuring that output datasets align correctly with their input grids (following feat: native xarray support viads.canyonbaccessor (v0.3.0) #7).Documentation and usability:
canyonband clarified default values and units.Tests:
xarray.