diff --git a/Cargo.lock b/Cargo.lock index 7b36f722..b1078947 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,12 @@ dependencies = [ "rustc_version 0.4.0", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cbindgen" version = "0.18.0" @@ -220,12 +226,12 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", - "cast", + "cast 0.3.0", "clap", "criterion-plot", "csv", @@ -250,7 +256,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ - "cast", + "cast 0.2.7", "itertools", ] diff --git a/Cargo.toml b/Cargo.toml index aa53474c..737e9efe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ heapless = "0.7" inline-c = "0.1" postcard = "0.7.0" serde = "1.0.126" -criterion = "0.3" +criterion = "0.3.6" [build-dependencies] cbindgen = { version = "0.18.0", optional = true } diff --git a/convert_refdata/data/extract.m b/convert_refdata/data/extract.m new file mode 100644 index 00000000..daeb9b26 --- /dev/null +++ b/convert_refdata/data/extract.m @@ -0,0 +1,24 @@ +% Matlab script to extract checking values from reference dataset + + +load gsw_data_v3_0.mat + +fields = fieldnames(gsw_cv) + +% varnames = {'f', 'grav', 'distance', 'lat_chck_cast', 'p_chck_cast', 'SA_chck_cast', 'CT_chck_cast', 't_chck_cast', 'SP_from_C', 'C_from_SP', 'SP_from_R', 'R_from_SP', 'SP_from_SK', 'SA_from_SP', 'Sstar_from_SP', 'CT_from_t', 'deltaSA_from_SP', 'SR_from_SP', 'SP_from_SA', 'pt_from_CT', 't_from_CT', 't90_from_t48', 't90_from_t68', 'z_from_p' 'p_from_z' 'z_from_depth', 'specvol', 'alpha', 'beta', 'specvol_anom', 'specvol_anom_standard', 'rho', 'sigma0', 'sigma1', 'sigma2', 'sigma3', 'sigma4', 'enthalpy', 'enthalpy_diff', 'dynamic_enthalpy', 'sound_speed', 'internal_energy', 'SA_from_rho', 'CT_from_rho', 'CT_maxdensity', 'specvol_t_exact'}; + +% for v=varnames +% % specvol = gsw_cv.specvol +% eval([char(v), ' = gsw_cv.', char(v), ';']) +% end + + +for i=1:size(fields) + v = char(fields(i)) + eval([char(v), ' = gsw_cv.', char(v), ';']); +end + +command = 'save(''gsw_data_v3_0.chck_cast.mat'''; +% command = [command, ', ''', strjoin(varnames, ''', '''), ''', ''-v6'');'] +command = [command, ', ''version_number'', ''version_date'', ''', strjoin(fields, ''', '''), ''', ''-v6'');'] +eval(command) diff --git a/convert_refdata/data/gsw_data_v3_0.chck_cast.mat b/convert_refdata/data/gsw_data_v3_0.chck_cast.mat new file mode 100644 index 00000000..7fd12a51 Binary files /dev/null and b/convert_refdata/data/gsw_data_v3_0.chck_cast.mat differ diff --git a/convert_refdata/data/mods/conversions b/convert_refdata/data/mods/conversions new file mode 100644 index 00000000..180f7f47 --- /dev/null +++ b/convert_refdata/data/mods/conversions @@ -0,0 +1,19 @@ +SA_chck_cast +t_chck_cast +p_chck_cast +SP_chck_cast +CT_chck_cast +long_chck_cast +lat_chck_cast +deltaSA_from_SP +SR_from_SP +SP_from_SR +CT_from_PT +t90_from_t48 +t90_from_t68 +z_from_p +p_from_z +SP_from_SA +t_from_CT +entropy_from_CT +CT_from_entropy diff --git a/convert_refdata/data/mods/earth b/convert_refdata/data/mods/earth new file mode 100644 index 00000000..0f42e4f3 --- /dev/null +++ b/convert_refdata/data/mods/earth @@ -0,0 +1,4 @@ +lat_chck_cast +p_chck_cast +f +grav diff --git a/convert_refdata/data/mods/volume b/convert_refdata/data/mods/volume new file mode 100644 index 00000000..2e5d3f7e --- /dev/null +++ b/convert_refdata/data/mods/volume @@ -0,0 +1,47 @@ +p_chck_cast +p_chck_cast_deep +p_chck_cast_shallow +SA_chck_cast +CT_chck_cast +rho_chck_cast +specvol +rho +alpha +beta +alpha_on_beta +rho_alpha_beta +specvol_alpha_beta +specvol_first_derivatives +specvol_second_derivatives +specvol_first_derivatives_wrt_enthalpy +specvol_second_derivatives_wrt_enthalpy +specvol_anom +specvol_anom_standard +rho_first_derivatives +rho_second_derivatives +rho_first_derivatives_wrt_enthalpy +rho_second_derivatives_wrt_enthalpy +sigma0 +sigma1 +sigma2 +sigma3 +sigma4 +cabbeling +thermobaric +enthalpy +enthalpy_diff +sound_speed +kappa +internal_energy +internal_energy_first_derivatives +internal_energy_second_derivatives +CT_from_enthalpy +dynamic_enthalpy +SA_from_rho +CT_from_rho +CT_maxdensity +specvol_ice +specvol_diff +specvol_from_pot_enthalpy_ice +specvol_from_pot_enthalpy_ice_poly +specvol_p_parts diff --git a/convert_refdata/src/main.rs b/convert_refdata/src/main.rs index 0ac5fdae..3201a208 100644 --- a/convert_refdata/src/main.rs +++ b/convert_refdata/src/main.rs @@ -1,72 +1,121 @@ // use core::ops::Deref; -use heapless::{FnvIndexMap, String, Vec}; -use postcard::{from_bytes, to_vec}; +use heapless::FnvIndexMap; +use postcard::to_vec; use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; use std::fs::File; -use std::io::{BufWriter, Write}; +use std::io::{BufRead, BufWriter, Write}; use std::ops::Deref; +use std::path::PathBuf; // Structure of the validation dataset #[derive(Serialize, Deserialize, Debug)] struct DataRef { - version: String<8>, - src: String<32>, - src_md5: String<32>, - data_x: FnvIndexMap, Vec, 4>, - data2d: FnvIndexMap, Vec, 3>, 64>, + // created_at + version: heapless::String<8>, + src: heapless::String<32>, + src_md5: heapless::String<32>, + scalar: FnvIndexMap, f64, 2>, + data_x: FnvIndexMap, heapless::Vec, 32>, + data2d: FnvIndexMap, heapless::Vec, 3>, 32>, } fn main() { let file = std::fs::File::open("data/gsw_data_v3_0.chck_cast.mat").unwrap(); let mat_file = matfile::MatFile::parse(file).unwrap(); - let mut data_x = FnvIndexMap::, _, 4>::new(); - let mut data2d = FnvIndexMap::, _, 64>::new(); + let paths: Vec = std::fs::read_dir("data/mods/") + .unwrap() + .filter_map(|f| f.ok()) + .map(|f| f.path()) + .filter(|f| f.is_file()) + .collect(); - for variable in mat_file.arrays() { - // dbg!(variable.name()); - // dbg!(variable.size()); - if let Some(array) = mat_file.find_by_name(variable.name()) { - if let matfile::NumericData::Double { real, imag: _ } = array.data() { - let varname: String<24> = String::from(variable.name()); - match array.size()[..] { - [1, 3] => { - // dbg!(array.name()); - let values: Vec = Vec::from_slice(&real).unwrap(); - data_x.insert(varname, values).unwrap(); - } - [45, 3] => { - // dbg!(array.name()); - let values: Vec<_, 3> = real - .chunks(45) - .map(|x| Vec::::from_slice(x).unwrap()) - .collect(); + let mut groups: BTreeMap> = BTreeMap::new(); - data2d.insert(varname, values).unwrap(); - } - _ => { - dbg!("MISSING"); - dbg!(varname); - () - } + for p in paths.into_iter() { + let f = std::fs::File::open(&p).unwrap(); + let reader = std::io::BufReader::new(f); + let varlist = reader.lines().map(|l| l.unwrap()).collect::>(); + groups.insert(p.file_name().unwrap().to_str().unwrap().into(), varlist); + } + dbg!(&groups); + + for (group, varnames) in groups { + let mut scalar = FnvIndexMap::, _, 2>::new(); + let mut data_x = FnvIndexMap::, _, 32>::new(); + let mut data2d = FnvIndexMap::, _, 32>::new(); + + let mut scalar_size: isize = 0; + let mut datax_size: isize = 0; + let mut datax2_size: isize = 0; + for variable in mat_file.arrays() { + //dbg!(variable.name()); + //dbg!(variable.size()); + if let Some(array) = mat_file.find_by_name(variable.name()) { + if let matfile::NumericData::Double { real, imag: _ } = array.data() { + if varnames.contains(&variable.name().to_string()) { + let varname: heapless::String<64> = heapless::String::from(variable.name()); + match array.size()[..] { + [1, 1] => { + scalar_size += 1; + let value: f64 = real[0]; + scalar.insert(varname, value).unwrap(); + } + [1, 3] => { + datax_size += 1; + let values: heapless::Vec = + heapless::Vec::from_slice(&real).unwrap(); + data_x.insert(varname, values).unwrap(); + } + [45, 3] => { + datax2_size += 1; + let values: heapless::Vec<_, 3> = real + .chunks(45) + .map(|x| heapless::Vec::::from_slice(x).unwrap()) + .collect(); + + data2d.insert(varname, values).unwrap(); + } + _ => { + /* + dbg!("MISSING"); + dbg!(varname); + dbg!(array.size()); + */ + () + } + } + }; }; - }; + } } - } + dbg!("DATA SCALAR", &scalar_size); + dbg!("DATA 1D", &datax_size); + dbg!("DATA 2D", &datax2_size); - let dataset = DataRef { - version: String::from("3.06.12"), - src: String::from("gsw_data_v3_0.mat"), - src_md5: String::from("f9b65955407a8ed00246de4871ef0505"), - data_x, - data2d, - }; + // let nd_arr: ndarray::ArrayD = specvol.try_into().expect("Fail converting into array"); + /* + let gsw_cv = mat_file.find_by_name("gsw_cv"); + println!("{:#?}", gsw_cv); + */ - // dbg!("{:?}", &dataset); + let dataset = DataRef { + version: heapless::String::from("3.06.12"), + src: heapless::String::from("gsw_data_v3_0.mat"), + src_md5: heapless::String::from("25b840e6f8bdd72522e28d99eccd9e99"), + scalar, + data_x, + data2d, + }; - let stream: Vec = to_vec(&dataset).expect("Failed to vectorize dataset"); + let stream: heapless::Vec = + to_vec(&dataset).expect("Failed to vectorize dataset"); + // let serialized = serde_json::to_string(&dataset).unwrap(); - let f = File::create("gsw_validation.bin").expect("Unable to create file"); - let mut f = BufWriter::new(f); - f.write_all(stream.deref()).expect("Unable to write data"); + let outputfilename = format!("data/gsw_{}_validation.bin", group); + let f = File::create(dbg!(outputfilename)).expect("Unable to create file"); + let mut f = BufWriter::new(f); + f.write_all(stream.deref()).expect("Unable to write data"); + } } diff --git a/convert_refdata/tests/check.rs b/convert_refdata/tests/check.rs new file mode 100644 index 00000000..e65592dd --- /dev/null +++ b/convert_refdata/tests/check.rs @@ -0,0 +1,52 @@ +use heapless::{FnvIndexMap, String, Vec}; +use postcard::from_bytes; +use serde::{Deserialize, Serialize}; +use std::fs::File; +use std::io::Read; + +// Structure of the validation dataset +#[derive(Serialize, Deserialize, Debug)] +struct DataRef { + version: String<8>, + src: String<32>, + src_md5: String<32>, + scalar: FnvIndexMap, f64, 512>, + data_x: FnvIndexMap, Vec, 16>, + data2d: FnvIndexMap, Vec, 3>, 512>, +} + +#[test] +#[cfg(not(windows))] +fn check_version() { + let mut input = File::open("data/gsw_validation.bin").expect("Unable to open file"); + let mut contents = vec![]; + input + .read_to_end(&mut contents) + .expect("Failed to read content"); + let out: DataRef = from_bytes(&contents).unwrap(); + assert_eq!(out.version, "3.06.12"); + assert_eq!(out.src, "gsw_data_v3_0.mat"); +} + +#[test] +#[cfg(not(windows))] +fn check_1d() { + let mut input = File::open("data/gsw_validation.bin").expect("Unable to open file"); + let mut contents = vec![]; + input + .read_to_end(&mut contents) + .expect("Failed to read content"); + let out: DataRef = from_bytes(&contents).unwrap(); + for key in out.data_x.keys() { + dbg!(key); + } + for (key, val) in out.data_x.iter() { + dbg!("key: {} val: {}", key, val); + } + let neutral_density = out.data_x.get(&String::from("Neutral_Density")).unwrap(); + dbg!(neutral_density); + let f = out.data_x.get(&heapless::String::from("f")); + dbg!(f); + let f = out.data_x.get(&String::from("f")).unwrap(); + dbg!(f); +} diff --git a/tests/conversions.rs b/tests/conversions.rs new file mode 100644 index 00000000..cf9d1187 --- /dev/null +++ b/tests/conversions.rs @@ -0,0 +1,44 @@ +use heapless::{FnvIndexMap, String, Vec}; +use postcard::from_bytes; +use serde::{Deserialize, Serialize}; +use std::fs::File; +use std::io::Read; + +// Structure of the validation dataset +#[derive(Serialize, Deserialize, Debug)] +struct DataRef { + version: String<8>, + src: String<32>, + src_md5: String<32>, + scalar: FnvIndexMap, f64, 2>, + data_x: FnvIndexMap, Vec, 2>, + data2d: FnvIndexMap, Vec, 3>, 32>, +} + +#[test] +#[cfg(not(windows))] +fn sr_from_sp() { + let mut input = + File::open("tests/data/gsw_conversions_validation.bin").expect("Unable to open file"); + let mut contents = vec![]; + input + .read_to_end(&mut contents) + .expect("Failed to read content"); + + let out: DataRef = from_bytes(&contents).unwrap(); + + let sp = out.data2d.get(&String::from("SP_chck_cast")).unwrap(); + let sr_from_sp = out.data2d.get(&String::from("SR_from_SP")).unwrap(); + let tol = if cfg!(feature = "compat") || (f64::EPSILON > 1e-12) { + f64::EPSILON + } else { + 1e-12 + }; + for i in 0..3 { + for j in 0..45 { + if !sr_from_sp[i][j].is_nan() { + assert!((gsw::conversions::sr_from_sp(sp[i][j]) - sr_from_sp[i][j]).abs() <= tol); + } + } + } +} diff --git a/tests/data/gsw_conversions_validation.bin b/tests/data/gsw_conversions_validation.bin new file mode 100644 index 00000000..8e2a5df8 Binary files /dev/null and b/tests/data/gsw_conversions_validation.bin differ diff --git a/tests/data/gsw_earth_validation.bin b/tests/data/gsw_earth_validation.bin new file mode 100644 index 00000000..9145d7f3 Binary files /dev/null and b/tests/data/gsw_earth_validation.bin differ diff --git a/tests/data/gsw_validation.bin b/tests/data/gsw_validation.bin deleted file mode 100644 index aa4ed9c6..00000000 Binary files a/tests/data/gsw_validation.bin and /dev/null differ diff --git a/tests/data/gsw_volume_validation.bin b/tests/data/gsw_volume_validation.bin new file mode 100644 index 00000000..91193f55 Binary files /dev/null and b/tests/data/gsw_volume_validation.bin differ diff --git a/tests/earth.rs b/tests/earth.rs index 235d676e..3440c463 100644 --- a/tests/earth.rs +++ b/tests/earth.rs @@ -10,14 +10,15 @@ struct DataRef { version: String<8>, src: String<32>, src_md5: String<32>, - data_x: FnvIndexMap, Vec, 4>, - data2d: FnvIndexMap, Vec, 3>, 64>, + scalar: FnvIndexMap, f64, 2>, + data_x: FnvIndexMap, Vec, 32>, + data2d: FnvIndexMap, Vec, 3>, 32>, } #[test] #[cfg(not(windows))] fn coriolis_parameter() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = File::open("tests/data/gsw_earth_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -39,7 +40,7 @@ fn coriolis_parameter() { #[test] #[cfg(not(windows))] fn gravity() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = File::open("tests/data/gsw_earth_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) diff --git a/tests/volume.rs b/tests/volume.rs index c908e0bd..fc3eef85 100644 --- a/tests/volume.rs +++ b/tests/volume.rs @@ -10,14 +10,16 @@ struct DataRef { version: String<8>, src: String<32>, src_md5: String<32>, - data_x: FnvIndexMap, Vec, 4>, - data2d: FnvIndexMap, Vec, 3>, 64>, + scalar: FnvIndexMap, f64, 2>, + data_x: FnvIndexMap, Vec, 2>, + data2d: FnvIndexMap, Vec, 3>, 32>, } #[test] #[cfg(not(windows))] fn specvol() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -45,7 +47,8 @@ fn specvol() { #[test] #[cfg(not(windows))] fn alpha() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -72,7 +75,8 @@ fn alpha() { #[test] #[cfg(not(windows))] fn beta() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -99,7 +103,8 @@ fn beta() { #[test] #[cfg(not(windows))] fn specvol_anom_standard() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -131,7 +136,8 @@ fn specvol_anom_standard() { #[test] #[cfg(not(windows))] fn sigma0() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -157,7 +163,8 @@ fn sigma0() { #[test] #[cfg(not(windows))] fn sigma1() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -183,7 +190,8 @@ fn sigma1() { #[test] #[cfg(not(windows))] fn sigma2() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -209,7 +217,8 @@ fn sigma2() { #[test] #[cfg(not(windows))] fn sigma3() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -235,7 +244,8 @@ fn sigma3() { #[test] #[cfg(not(windows))] fn sigma4() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -263,7 +273,7 @@ fn sigma4() { #[test] #[cfg(not(windows))] fn enthalpy_diff() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -276,8 +286,7 @@ fn enthalpy_diff() { let ct = out.data2d.get(&String::from("CT_chck_cast")).unwrap(); let enthalpy_diff = out.data2d.get(&String::from("enthalpy_diff")).unwrap(); let tol = if cfg!(feature = "compat") || (f64::EPSILON > 1e-10) { - // f64::EPSILON - 1e-11 + f64::EPSILON } else { 1e-10 }; @@ -303,7 +312,8 @@ fn enthalpy_diff() { #[test] #[cfg(not(windows))] fn rho() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -332,10 +342,42 @@ fn rho() { } } +/* +#[test] +#[cfg(not(windows))] +fn specvol() { + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); + let mut contents = vec![]; + input + .read_to_end(&mut contents) + .expect("Failed to read content"); + + let out: DataRef = from_bytes(&contents).unwrap(); + + let p = out.data2d.get(&String::from("p_chck_cast")).unwrap(); + let sa = out.data2d.get(&String::from("SA_chck_cast")).unwrap(); + let ct = out.data2d.get(&String::from("CT_chck_cast")).unwrap(); + let specvol = out.data2d.get(&String::from("specvol")).unwrap(); + for i in 0..3 { + for j in 0..45 { + if !specvol[i][j].is_nan() { + assert!( + (gsw::volume::specvol(sa[i][j], ct[i][j], p[i][j]).unwrap() - specvol[i][j]) + .abs() + <= f64::EPSILON + ); + } + } + } +} +*/ + #[test] #[cfg(not(windows))] fn sound_speed() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -371,7 +413,8 @@ fn sound_speed() { #[test] #[cfg(not(windows))] fn internal_energy() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -406,7 +449,8 @@ fn internal_energy() { #[test] #[cfg(not(windows))] fn dynamic_enthalpy() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents) @@ -441,7 +485,8 @@ fn dynamic_enthalpy() { #[test] #[cfg(not(windows))] fn sa_from_rho() { - let mut input = File::open("tests/data/gsw_validation.bin").expect("Unable to open file"); + let mut input = + File::open("tests/data/gsw_volume_validation.bin").expect("Unable to open file"); let mut contents = vec![]; input .read_to_end(&mut contents)