Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need more comprehensive testing harness #4

Open
brews opened this issue Feb 23, 2018 · 2 comments
Open

Need more comprehensive testing harness #4

brews opened this issue Feb 23, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@brews
Copy link
Owner

brews commented Feb 23, 2018

Need more comprehensive testing harness.

Right now I just have one basic smoke test for my specific use-case. Should look at coverage and be sure to write tests that at least cover all the major use-cases based on input into co2sys.CO2SYS().

@brews brews added the enhancement New feature or request label Feb 23, 2018
@aholdsworth
Copy link

aholdsworth commented Aug 31, 2018

The code only seems to work for scalar inputs. I would have liked to use it for 3d fields, but it's not yet working for even the following simple test case. This is example 6 found here (https://github.com/jamesorr/CO2SYS-MATLAB/blob/master/notebooks/CO2SYS-Matlab_tutorial.ipynb) for the matlab version:

par1type = 1; # The first parameter supplied is of type "1", which is "alkalinity"
par1 = 2300; # value of the first parameter
par2type = 2; # The first parameter supplied is of type "1", which is "DIC"
par2 =np.arange(2000,2200,5) # value of the second parameter, which is a long vector of different DIC's!
sal = 35; # Salinity of the sample
tempin = 10; # Temperature at input conditions
presin = 0; # Pressure at input conditions
tempout = 0; # Temperature at output conditions - doesn't matter in this example
presout = 0; # Pressure at output conditions - doesn't matter in this example
sil = 50; # Concentration of silicate in the sample (in umol/kg)
po4 = 2; # Concentration of phosphate in the sample (in umol/kg)
pHscale = 1; # pH scale at which the input pH is reported ("1" means "Total Scale") - doesn't matter in this example
k1k2c = 4; # Choice of dissociation constants K1 and K2 ("4" means "Mehrbach refit")
kso4c = 1; # Choice of KSO4 ("1" means "Dickson")
print('par2', par2)

A =co2sys.CO2SYS(par1,par2,par1type,par2type,sal,tempin,tempout,presin,presout,sil,po4,pHscale,k1k2c,kso4c)

@brews
Copy link
Owner Author

brews commented Sep 5, 2018

Hey @aholdsworth! Thanks for posting this issue.

You're right in that I've only been using co2syspy for scalar input. It might not be too much trouble to get the functions to broadcast for larger input, though. I'll open a new issue for this specifically and well I'll post any updates there: #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants